Statsmodels ARIMA - Different results using predict() and forecast()

Viewed 20202

I use (Statsmodels) ARIMA in order to predict values from a series:

plt.plot(ind, final_results.predict(start=0 ,end=26))
plt.plot(ind, forecast.values)
plt.show()

I thought that I would get the same results from these two methods, but instead I get this: enter image description here

I would like to know whether to use predict() or forecast().

2 Answers

Continuing noteven2degrees's reply, I submitted a pull request to correct in method B from history_f.append(yhat_p) to history_p.append(yhat_p).

Also, as noteven2degrees suggested, unlike forecast(), the predict() requires an argument typ='levels' to output a forecast, instead of a differenced forecast.

After the above two changes, method B produces the same result as method C, while method C takes far less time, which is reasonable. And both converges to a trend, as I think is related to the stationarity of the model itself.

No matter in which method, forecast() and predict() produce the same result with whatever configurations of p,d,q .

Related