Autocorrelation tests

Author
Affiliation

Beniamino Sartini

University of Bologna

Published

May 1, 2024

Modified

June 19, 2024

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. (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.

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. (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 .

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.

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 non 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.

Back to top

Citation

BibTeX citation:
@online{sartini2024,
  author = {Sartini, Beniamino},
  title = {Autocorrelation Tests},
  date = {2024-05-01},
  url = {https://greenfin.it/statistics/tests/autocorrelation-tests.html},
  langid = {en}
}
For attribution, please cite this work as:
Sartini, Beniamino. 2024. “Autocorrelation Tests.” May 1, 2024. https://greenfin.it/statistics/tests/autocorrelation-tests.html.