statsmodels: [ARMA] Predict model gives "Wrong number of items passed X, placement implies Y"
Hi,
I fitted my ARMA model using the Dataframe below, and try to predict the next 60 days:
>>> print(endog_products)
2014-06-17 1.0
2014-06-19 0.0
2014-06-20 0.0
2014-06-21 0.0
2014-06-22 0.0
2014-06-23 0.0
2014-06-24 0.0
2014-06-25 2.0
2014-06-26 2.0
2014-06-27 3.0
2014-06-28 3.0
2014-06-29 0.0
2014-06-30 0.0
2014-07-01 3.0
2014-07-02 2.0
2014-07-03 2.0
2014-07-04 1.0
2014-07-05 1.0
2014-07-06 0.0
2014-07-07 1.0
2014-07-08 1.0
2014-07-09 1.0
2014-07-10 1.0
2014-07-11 4.0
2014-07-12 1.0
2014-07-13 1.0
2014-07-14 0.0
2014-07-15 2.0
2014-07-16 1.0
2014-07-17 0.0
2014-07-18 1.0
2014-07-19 1.0
2014-07-20 0.0
2014-07-21 0.0
2014-07-22 3.0
2014-07-23 3.0
2014-07-24 2.0
2014-07-25 2.0
2014-07-26 0.0
2014-07-27 1.0
2014-07-28 0.0
2014-07-29 1.0
2014-07-30 0.0
2014-07-31 1.0
2014-08-01 0.0
This is my code to fit the model, and it works great:
arma_order = arma_order_select_ic(endog_products, ic=['aic', 'bic', 'hqic'], trend='c', fit_kw=dict(method='css-mle'))
p = arma_order.aic_min_order[0]
q = arma_order.aic_min_order[1]
arma_model = ARMA(endog_products, freq='D', order=(p, 0, q))
arma_res = arma_model.fit()
When I try to predict the next 60 days using this code (prediction_values = arma_res.predict(start=prelearning_date, end=max_date)), Python returns this error: Error when computing ARMA model for product 3035668: Wrong number of items passed 106, placement implies 107.
I don’t understand what this error means. I checked on Google and on issues but I don’t find some issues that are corresponding to my problem.
Thanks a lot for your answers.
About this issue
- Original URL
- State: closed
- Created 8 years ago
- Comments: 18 (9 by maintainers)
No problem and thanks for following up and closing the issue.