I have fitted an ARIMA model using the fable R package. When I go to use the model to forecast the distribution using bootstrap resampled errors it returns all NAs.
ARIMA_model <- targets %>%
as_tsibble(key = 'key', index = 'time') %>%
model(ARIMA(y ~ x))
ARIMA_fable <- ARIMA_model %>%
generate(new_data = scenarios, bootstrap = TRUE, times = 100)
I can get it to run using forecast()
but I want to see each ensemble member and the errors are not expected to be normally distributed.
ARIMA_fable <- ARIMA_model %>% forecast(new_data = scenarios, bootstrap = FALSE)
Here is a reproducible example:
key <- c('A', 'B', 'C')
time <- seq(start, by = 1, length.out = 15)
set.seed(123)
targets <- expand.grid(time = time, key = key) %>%
mutate(x = sort(runif(45, 0, 30)),
y = sort(runif(45, 0, 30)))
ARIMA_model <- targets %>%
as_tsibble(key = 'key', index = 'time') %>%
model(ARIMA(y ~ x))
test_scenarios <- targets %>%
mutate(time = time + lubridate::days(16),
x = sort(runif(45, 0, 30)),
y = sort(runif(45, 0, 30))) %>%
as_tsibble(key = 'key', index = 'time')
ARIMA_model %>%
forecast(new_data = test_scenarios, bootstrap = T)