Hi,
There's an error with the hilo()
function regarding fable and distributional packages, using bootstrap = FALSE
, but not bootstrap = TRUE
> fit |>
+ forecast(h = 10, bootstrap = FALSE) |>
+ hilo()
Error in `mutate()`:
ℹ In argument: `80% = hilo(value, 80)`.
Caused by error in `new_hilo()`:
! `upper` can't be lower than `lower`.
Run `rlang::last_trace()` to see where the error occurred.
Here's a minimal reproducible example:
#===============================
library(quantmod)
library(tsbox)
library(fpp3)
#===============================
quantmod::getSymbols("JTSJOL", src = "FRED")
x <- na.omit(JTSJOL)
JTSJOL <- tsbox::ts_tsibble(x)
DATE <- yearmonth(JTSJOL$time)
JTSJOL <- JTSJOL$value
tb <- bind_cols(DATE = DATE, JTSJOL = JTSJOL) |>
mutate(nIndex = row_number()) |>
gather("Series", "value", -DATE) |>
as_tsibble(index = DATE, key = Series)
tb
#===============================
start <- make_yearmonth(2000,12)
begin <- make_yearmonth(2023,12)
#===============================
# Series for IS period
JTSJOL <- tb |>
filter(Series == "JTSJOL") |>
select(value)
y <- JTSJOL |> filter(DATE >= start & DATE <= begin)
y
#===============================
# fit ARIMA
fit <- y |>
model('arima_search'= ARIMA( sqrt(value),
method = "CSS-ML",
optim.control = list(maxit = 1000))
)
fit
fit |>
forecast(h = 10, bootstrap = TRUE) |>
hilo()
fit |>
forecast(h = 10, bootstrap = FALSE) |>
hilo()
Amarjit