I am fitting an ARMA model to my data and here is my code
import statsmodels.tsa.arima_model as ari model=ari.ARMA(pivoted['price'],(2,1)) ar_res=model.fit() preds=ar_res.predict(100,400)
What I want is to train the ARMA model up to the 100th data point and then test out-of-sample on the 100-400th data points. But I don't think that is what's happening. I think this is because the model is fit on the entire data set, so how can the predictions be out-of-sample? It says here that out-of-sample prediction is possible. Can someone please help me understand this?
OK here is my new code
model=ari.ARMA(pivoted['price'][:100],order=(2,1)) ar_res=model.fit() preds=ar_res.predict(100,400)
however it return the error
AssertionError: Index length did not match values