# ARIMA forecasts with autocorrelated residuals

I have a time series on consumer price index (CPI) and want to forecast inflation which is in my case the first difference of the log of CPI: π_t=Log(P_t) - Log(P_t-1). This is the time series:

The ACF of the series decreases slowly as the lag increases (trend?) and a typical “scalloped” shape is also observable (seasonality?).

From my perspective there is no clear evidence for seasonality according to the seasonalityplot. However in the final ARIMA model when applying auto.arima seasonality is taken into account.

Both the ADF test and KPSS test verify that this time series is nonstationary. Ndiffs() suggest to use d=1. the ADF test and KPSS test verify that the first diff series is stationary. The ACF and PACF plots are the following: Applying the auto.arima function yields the following results:

Series: ts_cpi
ARIMA(3,1,1)(0,0,2)[12]

Coefficients:
ar1      ar2      ar3      ma1     sma1     sma2
0.1740  -0.0102  -0.1190  -0.8345  -0.0764  -0.1181
s.e.  0.0466   0.0415   0.0414   0.0306   0.0370   0.0352

sigma^2 estimated as 4.914e-06:  log likelihood=3442.04
AIC=-6870.08   AICc=-6869.93   BIC=-6837.9

Training set error measures:
ME        RMSE         MAE
Training set 4.863658e-06 0.002206118 0.001545581


The Ljung-Box test indicates that the residuals are autocorrelated (24lags):

Ljung-Box test

data:  Residuals from ARIMA(3,1,1)(0,0,2)[12]
Q* = 38.23, df = 18, p-value = 0.003611

Model df: 6.   Total lags used: 24


How can i proceed in order to have uncorrelated residuals and thus stable forecast estimations? Should i manually add more lags to the ARIMA model or make use of heteroskedastic robust errors?

• You cannot take a log of the first or second difference, because these differences contain negative values. You can take a difference (first or second order) of the log, though. Futher, you can usually undo the transformation: transform --> model --> un-transform. Jun 6, 2020 at 9:49
• Thanks for your reply. So in my case this means, i should transform (e.g. take the difference) the inflation time series and fit the model to this data. Then i use this model to forecast time points in the original inflation time series ?
– 29ML
Jun 6, 2020 at 10:29
• Yes, you can do that. Just be careful not to difference a series that does not have a unit root. This would lead to overdifferencing and all the problems that come with it. Jun 6, 2020 at 10:34
• applied to R: i use the auto.arima function, which will transform my series properly (will check it though) and fit a model to this transformed data. Assume ARIMA (2,1,2) is the best model. Then i fit an ARIMA (2,0,2) model to the original time series?
– 29ML
Jun 6, 2020 at 10:54
• Apply auto.arima on data that has not been differenced. auto.arima will take care of that. Jun 6, 2020 at 11:09

As you already see in your data, inflation is a highly persistent, non-stationary, process.

(The sample ACF of your inflation series is probably significant at all lags, up to the size of your sample.)

As it does not make sense to speak of forecast for non-stationary series, one typically performs forecast for change in inflation, i.e. its first-difference.

Taking the first-difference loses information on the mean of the series. If your data is from an advanced economy, this is not an issue. The sample mean of the inflation series would typically be very close to the central bank's announced inflation target (you should verify this).

Fit ARMA models to the first-difference of inflation series and select by comparing pseudo-out of sample forecast mean square errors. Start with simple AR models, as they have the most economic meaning in this context. You can already notice the standard OLS/conditional MLE estimate of the AR(1) parameter is going to be negative, as it should be---this reflects the central bank's attempt at stabilizing inflation when it over/under shoots the target. Yes, use robust standard errors to compute MSFE if applicable.

• I took the first difference of the inflation series and the unit root tests suggests stationarity. The best ARIMA model is ARIMA(2,0,1) but the Ljung-Box test indicates autocorrelation in the residuals. [without robust standard errors] Can this model still be used for point forecasts? Since im not calculating predicition intervalls.
– 29ML
Jun 8, 2020 at 8:19
• It's not very useful to have forecast without forecast error but in principle, yes. Try a pseudo out-of-sample forecast horse race between ARMA(2,1) and, say, AR(2). You might well find AR(2) does just as well. Jun 8, 2020 at 9:14
• Allright thanks! The best ARIMA model is ARIMA(2,0,1)(0,0,2) which implies that there is a seasonal part in the model. Since i want to apply varies models for forecasting i need a deseasonalized time series. When i check the seasonal plots and the time plot there is no clear evidence for seasonality. Further the variance of the time series explained by the variance of each component gives the following results: seasonal: 0.02650165 ; trend:0.005972118 ; remainder:0.968919304. The dataset is seasonally adjusted according to the authors. But the final ARIMA model contradict these findings?
– 29ML
Jun 8, 2020 at 10:24
• The fact that an SARIMA estimation procedure (full maximum likelihood, probably) found a (weak) seasonal component does not mean much, unless you can identify a specific economic reason. Can you explain why change in inflation should have a seasonality of 12 lags (3 years if quarterly data)? Economic time series cannot be analyzed by blindly applying purely statistical procedures. Also, for forecasting, there's a trade off between in-sample fit and out-of-sample forecast performance. Jun 8, 2020 at 12:09
• That was my main question. From my perspective there is no econmic reason for seasonality in the change in inflation, however the ARIMA model suggests taking seasonality into account. I´m applying various types of models to this time series, and therefore also purely statistical procedures are included. (and show there limitations compared to ML methods) Since the sample is split into training and out-of-sample sets the AIC in case of ARIMA will in general "protect" the model from overfitting.
– 29ML
Jun 8, 2020 at 12:36