R – Confidence Bands for ARIMA Models in Time-Series Analysis

armaautocorrelationrtime series

I want to look at the acf and pacf of my data, to identify the model for my mean equation, so I want to fit an ARMA for my mean equation and later on model the conditional variance by a ARCH/GARCH (I know I have to do jointly model estimation). In the first step I want to look at the ACF and PACF for identifying, I used the standard Acf of the forecast library, but I noticed, that the confidence bands in these plots are given for testing randomness and not for fitting a ARMA.

As wikipedia says:

Correlograms are also used in the model identification stage for
fitting ARIMA models. In this case, a moving average model is assumed
for the data and the following confidence bands should be generated:

$ \pm z_{1-\alpha/2}\sqrt{\frac{1}{N}\left(1+2\sum_{i=1}^{k} y_i^2\right)} $
How can I get these confidence bands, which increase as the lag increases?

Best Answer

Use acf from the stats package (or Acf from the forecast package) with ci.type="ma". Note that some people use the simpler approximation all the time - it's just to give an idea what models might be worth considering so accuracy isn't so important.

Bartlett's approximation (the one you quote from Wikipedia) is only relevant to examining the autocorrelation function: the confidence interval for a lag $q$ is given assuming, as a null hypothesis, a moving average process of order $q-1$; it's conditional upon the estimated autocorrelations of all previous lags. (So note that it's not especially relevant to deciding between, say, an ARMA(1,1) & an ARMA (1,2).)

You might suppose a similar formula for confidence intervals on the partial autocorrelations, mutatis mutandis; but you'd be wrong: if you assume an autoregressive process of order $p-1$, the standard errors on the partial autocorrelations are asymptotically $\frac{1}{\sqrt{n}}$, where $n$ is the number of observations. Quenouille (1949), "Approximate tests of correlation in time-series", JRSS B, 11, 1.