Used to extract a specified prediction interval at a particular confidence level from a distribution or fable.
# S3 method for fbl_ts hilo(x, level = c(80, 95), ...) hilo(x, ...) # S3 method for fcdist hilo(x, level = 95, ...)
x | Object to create hilo from |
---|---|
level | The confidence levels for the plotted prediction intervals. |
... | Additional arguments for the distribution's quantile function. |
#> [4.120108, 15.87989]95if (requireNamespace("fable", quietly = TRUE)) { library(fable) library(tsibbledata) library(dplyr) aus_production %>% model(ets = ETS(log(Beer) ~ error("M") + trend("Ad") + season("A"))) %>% forecast(h = "3 years") %>% mutate(interval = hilo(.distribution, 95)) }#> Error in length(i) > 1 && regular: invalid 'y' type in 'x && y'