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

Error when try to use the direct multi-step approach with ARIMA models #551

Closed
NunopRolo opened this issue Sep 21, 2023 · 4 comments
Closed

Comments

@NunopRolo
Copy link

Hi,
I'm trying to forecast a time series using an ARIMA model with a direct multi-step approach, but when running the code found in the documentation, I always get the same error, which is: TypeError: n_periods must be an int

Here I put some example code that I'm using:

forecaster = ForecasterAutoregDirect(
                 regressor     = ARIMA(order=(1,0,0)),
                 steps         = 24,
                 lags          = 24
             )

forecaster.fit(y=data_train)

Does anyone know what the problem is?

Thanks!

@JoaquinAmatRodrigo
Copy link
Owner

Hi @NunopRolo,
Thanks for using skforecast.
The current implementation of ForecasterAutoreg and ForecasterAutoregDirect does not allow to use ARIMA models as regressors. The reason is that the underlying matrices for fitting the model are not compatible. For ARIMA-SARIMAX models, we suggest using ForecasterSarimax.
Hope this helps.

@NunopRolo
Copy link
Author

Hi @JoaquinAmatRodrigo

Thanks for the quick response.
Ok, but with ForecasterSarimax it is not possible to perform the direct multi-step approach.
Do you know of any way, or another library, to perform this direct multi-step approach, in ARIMA models?

Thank you!

@JoaquinAmatRodrigo
Copy link
Owner

Unfortunately, there is currently no way to do this in skforecast, and I am not aware of any other library that does it.
Still, I am not sure if it makes sense to combine a direct strategy with an arima model. These types of models are forced to use a recursive strategy because they need the previous errors in their MA component. Therefore, for an arima model to predict step +3, it needs to predict step +1 and step +2 before. They cannot point directly to step +3.

@NunopRolo
Copy link
Author

Ok @JoaquinAmatRodrigo, thank you.
I closed the issue then.

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