Comparing Results from ARIMA Stat Models with Source Data

I have a time series with seasonal components. I installed statsmodels ARIMA using

model = tsa.arima_model.ARIMA(data, (8,1,0)).fit() 

For instance. Now I understand that ARIMA is changing my data. How to compare results from

 prediction = model.predict() fig, ax = plt.subplots() data.plot() prediction.plot() 

since the data will be the original data, and the prediction will be different, and therefore has an average value of about 0, different from the average value of the data?

+1
source share
1 answer

As the documentation shows, if the typ keyword is passed to the predict method, the answer can be shown in the original predictor variables:

 typ : str {'linear', 'levels'} 'linear' : Linear prediction in terms of the differenced endogenous variables. 'levels' : Predict the levels of the original endogenous variables. 

So the call will be

 model = tsa.arima_model.ARIMA(data, (12,1,0)).fit() arima_predict = model.predict('2015-01-01','2016-01-01', typ='levels') 
+1
source

All Articles