Skip to content
Advertisement

How to forecast time series using AutoReg in python

I’m trying to build old school model using only auto regression algorithm. I found out that there’s an implementation of it in statsmodel package. I’ve read the documentation, and as I understand it should work as ARIMA. So, here’s my code:

JavaScript

And when I want to predict new values, I’m trying to follow the documentation:

JavaScript

Both returns a list of NaNs.

Also, when I type model.predict(0, df_train.size - 1) it predicts real values, but model.predict(0, df_train.size) predicts NaNs list.

Am I doing something wrong?


P.S. I know there’s ARIMA, ARMA or SARIMAX algorithms, that can be used as basic auto regression. But I need exactly AutoReg.

Advertisement

Answer

User contributions licensed under: CC BY-SA
1 People found this is helpful
Advertisement