24  Autocorrelation tests

24.1 Durbin-Watson test

The aim of the Durbin-Watson test is to verify if a time series presents autocorrelation or not. Specifically, let’s consider a time series Xt=(x1,,xi,,xt), then evaluating an AR(1) model, i.e. (24.1)xt=ϕ1xt1+ut we would like to verify if ϕ1 is significantly different from zero. The test statistic, denoted as DW, is computed as: DW=i=2t(xixi1)2i=2txi122(1ϕ1) The null hypothesis H0 is the absence of autocorrelation, i.e.  H0:ϕ1=0H1:ϕ10 Under H0 the Durbin-Watson statistic is approximated as DW2(10)=2. The test always generates a statistic between 0 and 4. However, there is not a known distribution for critical values. Hence to establish if we can reject or not H0 when we have values very different from 2, we should look at the tables.

24.2 Breush-Godfrey

The Breush-Godfrey test is similar to Durbin-Watson, but it allows for multiple lags in the regression. In order to perform the test let’s fit an AR(p) model on the a time series Xt=(x1,,xi,,xt), i.e. (24.2)xt=ϕ1xt1++ϕpxtp+ut The null hypothesis H0 is the absence of autocorrelation, i.e.  H0:ϕ1==ϕp=0H1:ϕ10,,ϕp0 The null hypothesis H0 is tested looking at the F statistic that is distributed as a Fisher–Snedecor distribution, i.e FFp,np1. Alternatively is is possible to use the LM statistic, i.e. LM=nR2χ(p) where R2 is the R squared of the regression in .

24.3 Box–Pierce test

Let’s consider a sequence of n IID observations, i.e. utIID(0,σ2). Then, the autocorrelation for the k-lag can be estimated as: ρ^k=Cr{ut,utk}=t=knututkt=knut2. Moreover, since ρ^kN(0,1n), standardizing ρ^k one obtain
nρ^kN(0,1)nρ^k2χ12. It is possible to generalize the result considering m-auto correlations. In specific, let’s define a vector containing the first m standardized auto-correlations. Due to the previous result it converges in distribution to a multivariate standard normal, i.e.  n[ρ^1ρ^kρ^m]dnN(0m×0,Im×m). Remembering that the sum of the squares of m-normal random variable is distributed as a χ2(m), one obtain the Box–Pierce test as BPm=nk=1mρ^k2dH0χm2, where the null hypothesis and the alternative are H0:ρ1==ρm=0H1:ρ10,,ρp0 Note that such test, also known as Portmanteau test, provide an asymptotic result valid only for large samples.

IID assumption

Note that the assumption of the test is that the observations are IID. Therefore, the test do no apply in the case of heteroskedasticity.

24.3.1 Ljung-Box test

Since the Box–Pierce test provide a consistent framework only for large samples, when dealing with a small samples it is preferable to use an alternative version, known as Ljung-box test, defined with a correction factor, i.e.  LBm=n(n+2)k=1mρ^k2nkdH0χ2(m)

Independently from the statistic test used, i.e. Qm=BPm or Qm=LBm, in general both are rejected when {Qm>χ1α,m2H0 rejectedQm<χ1α,m2H0 not rejected where χ1α,m2 is the quantile with probability 1α of the χm2 distribution with m degrees of freedom. If we reject H0, the time series presents autocorrelation, otherwise if H0 is non rejected we have no autocorrelation.