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 Xn=(X1,,Xt,,Xn) modeled with an AR(1) model, i.e. (24.1)Xt=ϕ1Xt1+ut, then, the null hypothesis H0 of the test is the absence of autocorrelation, i.e.  H0:ϕ1=0,H1:ϕ10. The Durbin-Watson statistic, denoted as DW, is computed as: DW(xn)=i=2n(xixi1)2i=2nxi122(1ϕ1), and under H0 the DW statistic is approximately DW(Xn)H02. 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 a generalization of the Durbin-Watson allowing multiple lags in the regression. The null hypothesis H0 of the test is the absence of autocorrelation up to the order p, i.e.  H0:ϕ1==ϕp=0absence of autocorrelationH1:ϕ10,,ϕp0autocorrelation To evaluate H0 usually is fitted an AR(p) model on the a time series Xn=(X1,,Xt,,Xn), i.e. (24.2)Xt=ϕ1Xt1++ϕpXtp+ut. and then look at the F-test (), that under H0 is distributed as a Fisher–Snedecor (), with p and np1 degrees of freedom. Alternatively, is is possible to use the LM statistic, i.e.  LM=nR2χ(p), where R2 is the R-squared () of the AR(p) regression defined in .

24.3 Box–Pierce test

Let’s consider a sequence of n IID observations with mean zero and finite variance, i.e. XtIID(0,σ2) and 0<σ2<. Then, the autocorrelation for a generic k-lag can be estimated as: ρ^k(xn)=t=k+1nxtxtkt=1nxt2. One can note that the numerator is a sum of IID random variables with variance σ4. By CLT as n V1=1nt=k+1nxtxtkndN(0,σ4). The denominator instead can be seen as V2=1nt=1nXt2npσ2. Taking the ratio of V1 and V2 gives nρ^k(Xn)=V1V2=1nt=k+1nxtxtk1nt=1nXt2ndnpN(0,σ4)σ2. Therefore, as n ρ^k(Xn)ndN(0,1n)nρ^k(Xn)ndN(0,1). A classic result gives from Bartlett () provides the covariance matrix of sample autocorrelations of a stationary process for large n, i.e.  V{ρ^k(Xn)}1n(1+2j=1k1ρj2),Cv{ρ^j(Xn),ρ^k(Xn)}0. with jk. Under white noise assumption (ρj=0 for j>0), this simplifies to V{ρ^k(Xn)}1n. Hence, recalling that under normality nρ^k2(Xn)χ2(1) one can generalize the result considering p-auto correlations. More precisely, let’s define a vector containing the first p standardized auto-correlations. Due to the previous result it converges in distribution to a multivariate standard normal, i.e.  n[ρ^1(Xn)ρ^k(Xn)ρ^p(Xn)]dnMVNp(0,Ip). To test the following set of hypothesis, H0:ρ1==ρp=0H1:ρ10,,ρp0 it is possible to recall that the sum of the squares of p-normal random variable is distributed as a χ2(p). Then, Box and Pierce () proved that the statistic defined as QpBP(Xn)=nk=1pρ^k2(Xn)dH0χ2(p), is distributed as a χ2 with p degrees of freedom. In general, depending on the value of the statistic on a sample xn, one obtain that {QpBP(xt)>q1αH0 rejectedQpBP(xt)<q1αH0 not rejected where q1α is the quantile with probability 1α of a χ2 random variable with p degrees of freedom.

Large samples and heteroskedasticity.

Note that such test, also known as Portmanteau test, provide an asymptotic result valid only for large samples. Moreover, the assumption of the test is that the observations are IID, hence the test does no apply in presence of heteroskedasticity.

24.3.1 Ljung-Box test

In general, the Box–Pierce test is an asymptotic test that holds as n. For finite n, QpBP tends to underestimate the true correlation ρk. Ljung and Box () sharpened the analysis by deriving the finite-sample second moments of the residual autocorrelations when the model is correct. They show (for k1): V{ρ^k(Xn)}=nkn(n+2), where nk appears because the numerator of ρ^k uses only nk usable pairs. The extra n+2 reflects exact finite-sample algebra for sums of products and the random denominator (sum of squares). Hence, instead of treating each ρ^k as if it had variance 1/n (Box–Pierce assumption), the Ljung–Box statistic rescales by (n+2)/(nk) to better match the finite-sample distribution.

Standardizing ρ^k and taking the square one obtain the Ljung-box statistic, i.e.  QpLB(Xn)=n(n+2)k=1pρ^k2(Xn)nkdH0χ2(m). In general, depending on the value of the statistic on a sample xn, one obtain that {QpLB(xn)>q1αH0 rejectedQpLB(xn)<q1αH0 not rejected where q1α is the quantile with probability 1α of the χ2(p) distribution with p degrees of freedom. If we reject H0, the time series presents autocorrelation, otherwise if H0 is not rejected we have no autocorrelation.