Search code examples
pythontime-seriesforecastingarima

When using a ARIMA in python, and have a garde of integration how do you get the forecast to be not integrated?


So I am using an ARIMA(2,1,1)

 model = ARIMA(value, order=(2, 1, 1))
 results = model.fit()
 model_fit = model.fit()

 predict=model_fit.predict(start=1, end=120, exog=None)
 data = pd.DataFrame(data = predict)
 print(data)

 results.plot_predict(95,115)

The printed data has the grade of integration how do I get that my values are the actual values?

The real values shows be somehtin along 18000 and I am getting -201, 75 or things like that and if I change the ARIMA to ARIMA(2,0,1) I get the normal values.

Could anyone please help me out?


Solution

  • When having a differenced time-series and you want to undifference the output.

     predict=model_fit.predict(start=1, end=120, exog=None, typ ='levels' )
    

    That should do the trick

    typ = 'levels'
    

    converts the differenced data to undifferenced data