Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot forecast of a reconciled ensemble model which includes prophet() #372

Closed
ewlundstrom opened this issue Nov 21, 2022 · 1 comment
Closed

Comments

@ewlundstrom
Copy link

I find that while I am able to forecast a reconciled ensemble forecast that does not include a prophet model, an error occurs when a prophet model is included.

Reproducible example:

library(tsibble)
library(tsibbledata)
library(remotes)
remotes::install_github("tidyverts/fable")
library(fable)
library(fabletools)
library(fable.prophet)

## Creating aggregate TS
Agg_Retail <- aus_retail %>% aggregate_key(State,
                                               Turnover = sum(Turnover))

## Ensemble Model without Prophet

Agg_Retail %>%
  model(Ensemble = combination_ensemble(ARIMA(Turnover),
                             ETS(Turnover),
                             weights = "inv_var")) %>%
  reconcile(min_trace(Ensemble)) %>%
  forecast(h = 12)


## Ensemble Model with Prophet


Agg_Retail %>%
  model(Ensemble = combination_ensemble(ARIMA(Turnover),
                                        ETS(Turnover),
                                        prophet(Turnover),
                                        weights = "inv_var")) %>%
  reconcile(min_trace(Ensemble)) %>%
  forecast(h = 12)

Error encountered:

! Problem with `mutate()` input `min_trace(Ensemble)`.
x min_trace needs covariance matrix to be positive definite.
i Input `min_trace(Ensemble)` is `(function (object, ...) ...`.
Run `rlang::last_error()` to see where the error occurred.
Warning message:
9 errors (1 unique) encountered for Ensemble
[9] .onLoad failed in loadNamespace() for 'processx', details:
  call: NULL
  error: 'ps_is_supported' is not an exported object from 'namespace:ps'```

@mitchelloharawild
Copy link
Member

This should now be possible since ensemble models can now produce bootstrapped forecasts. This was added recently in dfc4011.

To produce ensemble forecasts from models with different distributions, produce bootstrap or simulated sample paths with forecast(bootstrap = TRUE) or forecast(simulate = TRUE).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants