0

While trying to forecast a non stationary time series in Python, I tried two methods for forecasting -

  • Method 1 : Fitting an ARMA (4,4) after manually differencing the series once

Code -

data['d1'] = diff(data['X1'], k_diff =1)

model = ARIMA(data['d1'],order=(4,0,4), exog=data[['E1', 'E2']]) results = model.fit() results.summary()

  • Method 2 : Fitting an ARIMA(4,1,4) model

Code -

model = ARIMA(data['X1'],order=(4,1,4),
                exog=data[['E1', 'E2']])

results = model.fit() results.summary()

I notice that when I add back the forecasts (d(t)hat) on the differenced series d(t) to Y(t-1) in order to get forecasted values of Y(t), the forecasts are hugely different from Method 2. I have also tried using trend = "t" in Method 2 but the results still don't match to Method 1

How can I achieve the same results using Method 2, i.e. an ARIMA(4,1,4) model as I am getting from Method 1 in Python?

I have checked this question : ARIMA vs ARMA on the differenced series and would appreciate a similar answer but for Python to replicate the results from both Methods.

Richard Hardy
  • 67,272
  • Your problem may be with the exogenous variables and whether they should be differenced. If you compare a pure ARMA(4,4) on $\Delta y$ with an ARIMA(4,1,4) on $y$ (without exogenous regressors), you should get sensible results. – Richard Hardy Mar 24 '24 at 11:24
  • I'm using differenced Exogeneous variables for both Methods – Akashnil Datta Mukherjee Mar 24 '24 at 14:43
  • And that is likely the problem. If you want compatible results, you should likely use different orders of differencing in the two cases. – Richard Hardy Mar 24 '24 at 14:44
  • I'm confident that it is not because of Exogeneous variables. I've tried running both methods without any exogeneous variables and they still give different results. – Akashnil Datta Mukherjee Mar 24 '24 at 15:21

0 Answers0