Python out of sample forecasting ARIMA predict()
Asked Answered
A

1

0

Does statsmodels.api.tsa.ARIMA(mylist, (p,d,q)).fit().predict(start, end) only work for d=0?...

myList is a list of 72 decimals all >0, p=2, d=1, q=1, start=72, end=12 and the majority of the forecasts are negative decimal numbers which leads me to believe statsmodels doesn't automatically undifference after performing the forecasts.

Algol answered 2/12, 2014 at 20:35 Comment(0)
A
2

See the typ keyword of predict in the docstring. It determines whether you get predictions in terms of differences or levels. The default is 'linear' differences not levels. As an aside, your start should not be greater than your end. If this works, then this may NOT be giving you what you want and should probably be reported as a bug.

Arteriole answered 2/12, 2014 at 22:51 Comment(4)
Thank you for the quick response! Glad I have the attention of a statsmodel developer:)... these are the changes I made:predict = fit.predict(start=len(thirtyRR), end = len(thirtyRR)+11, typ = 'levels')Algol
Was wondering if I could bother you with my full script and get your feedback...I'm trying to replicate a function similar to auto.arima in R using statsmodels (to be used for forecasting literally hundreds of variables at once), but I'm wondering if I'm better off just importing R script using auto.arima through rpy2?Algol
For large scale automatic order selection, you might be better of using auto.arima. I've also exposed autolag from X13-ARIMA in the latest statsmodels, which you might find useful. It outperformed auto.arima in my last project where I needed this but I wouldn't say it will always outperform the heuristics in auto.arima.Arteriole
I should also note that it's limited to monthly and quarterly data. You can see an example here. More here.Arteriole

© 2022 - 2024 — McMap. All rights reserved.