unit8co / darts

A python library for user-friendly forecasting and anomaly detection on time series.
https://unit8co.github.io/darts/
Apache License 2.0
8.1k stars 881 forks source link

[QUESTION]Exog vs. Future Covariates: Comparing Statsmodels ARIMA and Darts #2539

Open VitalyLub opened 2 months ago

VitalyLub commented 2 months ago

In the statsmodels documentation, ARIMA accepts exog as an array of exogenous regressors, typically representing past external variables.

In Darts, I noticed there’s only an option for future_covariates, but no direct support for past_covariates, which is what I understand exog to be in statsmodels.

Could you explain the difference or gap in how exogenous variables are handled between these libraries?

furkancanturk commented 2 months ago

Related: #2457

madtoinou commented 2 months ago

Hi @VitalyLub,

Darts maps the future_covariates to the exog argument of statsmodels. Furthermore, future_covariates are actually more "powerful" than past_covariates because they can actually give access to information during the forecasted period (after the first forecasted point). You can find an illustration of the difference between the two here.

If you only have access to past information, you should be able to pass them to the future_covariates argument and expect the model to leverage them as expected.

VitalyLub commented 2 months ago

@madtoinou Thanks for the quick response. In my project I don't have any information about the future. If for example I want to predict 10 steps, how you'd suggest handle this? load 10 steps from history to the future_covariates?

madtoinou commented 1 month ago

From the equations I can see in statsmodels documentation, the exogenous information should correspond to the forecasted period.

If you don't have access to future values of your covariates, you could eventually shift the values into the future (for an horizon of 10, use the 10 last values of the covariates as exogenous variables) but it's not ideal.