tidyverts / fable

Tidy time series forecasting
https://fable.tidyverts.org
GNU General Public License v3.0
559 stars 65 forks source link

ARIMA - Could not find an appropriate ARIMA model. #337

Closed mayanklal closed 3 years ago

mayanklal commented 3 years ago

I'm trying to build a forecasting model that predicts monthly commodity price based on the information provided by exogenous variables.

Based on my analysis of the dataset, I have identified that the data has lagged predictors.

I have tried to incorporate the same into the model.

fit <- commodity_tsbl %>%
  model(m1_arimax = ARIMA(Rate ~ 0 + CNE + CCI +
                          CP + IP +
                          FS + SC +
                          IX+ EX+
                          mat_input + PI + lag(FD,3) +
                          Exchange_Rate + Input0+ lag(RR,3) +
                          Input1 + Input2 +
                          Input3 + lag(SP,1)))

It is giving me this error:

Warning message:
4 errors (1 unique) encountered for m1_arimax
[4] Could not find an appropriate ARIMA model.
This is likely because automatic selection does not select models with characteristic roots that may be numerically unstable.
For more details, refer to https://otexts.com/fpp3/arima-r.html#plotting-the-characteristic-roots

Based on some guess work, this error goes away when I remove this predictor from the equation - lag(FD,3). It gives this model after removing the mentioned predictor - <LM w/ ARIMA(0,0,0) errors>

Due to paucity of information available online on implementing SARIMAX in R, I would request you to help me with the following questions:

  1. How to select predictors in ARIMAX Model? Should we use the same concepts are that of Multivariate Regression?
  2. How to model a non-stationary dataset with more than one predictors? Given that the predictors can also be non-stationary and may have lagging influence as well.
  3. How to forecast the values using the final model when there is no data available for predictors in the future time period? Do we need to forecast their values separately?

I hope that these questions are not too naïve for this forum.

mitchelloharawild commented 3 years ago
  1. fable::ARIMA() models with exogenous regressors are regression models with ARIMA errors (https://robjhyndman.com/hyndsight/arimax/) not ARIMAX models. As such, selecting predictors can be done similarly to regression.
  2. The regression errors will need to be stationary for an ARMA model to be used.
  3. You will need to forecast these values separately. Note that the forecast uncertainty will not factor in the uncertainty of the regressors forecasted.
mitchelloharawild commented 3 years ago

Also note for statistics type questions as yours, you may get better help on https://stats.stackexchange.com/ Issues on GitHub are appropriate for issues with the codebase.

mayanklal commented 3 years ago

Thank you for answering my queries. It was really helpful.

On Thu, 26 Aug, 2021, 8:27 am mitchelloharawild, @.***> wrote:

Also note for statistics type questions as yours, you may get better help on https://stats.stackexchange.com/ Issues on GitHub are appropriate for issues with the codebase.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/tidyverts/fable/issues/337#issuecomment-906052398, or unsubscribe https://github.com/notifications/unsubscribe-auth/AIBINO5YKLHFBPLQ4LDFQLTT6WURZANCNFSM5AQ7NI6Q . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&utm_campaign=notification-email .