Autocorrelated
Error
I. What it is
A. Ordinary
least squares regression assumes that the errors are independent, normally
distributed with mean 0 and constant variance.
When the independence assumption is violated one will obtain unreliable
estimates of the regression parameters.
However, because the ei are correlated, the standard errors
of the regression coefficients will be smaller than they should be and hence
the statistical tests of these parameters will be misleading; they will suggest
that the estimates of the parameters are more precise than they really are.
II.
How to know that you have it
A. Plot the data - especially plot the residuals
against the estimated y values and against variables that may be related to
time.
B. Compute autocorrelations and see
if they are large.
1) 1st order
autocorrelation r(etet-1)
2) 2nd order
autocorrelation r(etet-2)
3) ith order
autocorrelation r(etet-i)
C. Compute the Durbin-Watson
statistic:
D=
Note that when r=0, D=2; when r=1, D=0, and when
r=-1, D=4. So the test is whether D is
close to 2. Because the value of r(etet-1)
will depend on the configuration of the Xi's, the Durbin-Watson
statistic can only give bounds for critical values of D.
To evaluate D:
1) locate values of DL and
DU in Durbin-Watson statistic table
2) For positive autocorrelation
a)
If D<DL then there is positive autocorrelation.
b) If D>DU then there is
no positive autocorrelation.
c)
If DL<D<DU then the test is inconclusive.
3) For negative
autocorrelation
a) If D<4-DU then there
is no negative autocorrelation.
b) If D>4-DL then there
is negative autocorrelation.
c)
If 4-DU<D<4-DL then the test is inconclusive.
Note that the Durbin-Watson test is only a test for
1st order autocorrelation.
III. What to do about it
A. Depends
on the type of problem -- three prototypical types of autocorrelation:
1. With a steady trend, one can simply regress time or some simple
function of time on the dependent variable.
2. With a seasonal fluctuation, one can regress dummy variables
indicating season on the dependent variable.
a. or one can use a moving
average smooth and then use the smoothed data.
3. often one will want to use both trend and seasonal fluctuation
variables.
4. With random tracking, one can regress on "differenced"
data or apply one of the specialized techniques described below.
B.
Regression on differenced data
1. The model of the error terms in this
situation is:
et=pet-1
+ vt
where vt
is N(0,s2)
2. Often, the model can be simplified to et=
et-1 + vt.
In this case, one can manipulate the regression
equation to arrive at a simple solution for the autocorrelation problem.
yt= a + bXt + et
yt-1 = a + bXt-1 + et-1
(yt-yt-1)= b(Xt-Xt-1)
+ (et-et-1)
which can be rewritten as:
Y* = bX* + vt
where Y*=(yt-yt-1), X*=(Xt-Xt-1),
and vt=(et-et-1).
By assumption, vt is normally distributed
and so the regression on "first differences" will yield unbiased
estimates of b. Whether the
autocorrelation problem has been corrected can be ascertained by examining the
autocorrelations of the differenced data.
3. In
general, one would like to estimate p in the generalized difference equation
above. A similar technique can be
applied:
yt=a
+ bXt +et
pyt-1=pa
+ pbxt-1 + pet-1
(multiplying equation for t-1 by p)
(yt-pyt-1)=a(1-p)
+ b(xt-pxt-1) + (et-pet-1)
which can be rewritten as:
Y*=
a(1-p) + bX* + vt
however, in this equation, Y*=(yt-pyt-1)
and X*=(xt-pxt-1)
so we still need to estimate p to create the new variables Y* and X*. One could regress et = pet-1
+ error, but this model will underestimate p because the et will
fluctuate around 0 more than do the true residuals (because of the
autocorrelation). One can obtain a
better estimate by applying:
yt=a(1-p)
+ pyt-1 + bXt - bpxt-1 + et - pet-1
= a* + pyt-1 + bXt -
b*xt-1 + vt
and discard all of the results except for the
coefficient of yt-1 which is p.
Then this can be used to form the new variables for use in the
generalized difference regression above.
IV. Special Techniques
A.
Generalized Least Squares (GLS)
1. If we
know the covariance matrix between the ei, one could simply use a
modified regression equation in which the differing variances are taken into
account:
(Y-XB)'U-1(Y-XB)
where U-1
is the inverse of the covariance matrix of the errors:
U = se2
The MLE estimate of B= (X'U-1X)-1X'U-1Y
B.
Autoregressive integrated moving average models (ARIMA)
1. An autoregressive model (of order p) has the
form:
yt=
f1yt-1 +f 2yt-1 + ... +fpyt-p + vt
In this model the score on the dependent variable at
time t is considered to be a function of the previous scores of the dependent
variable at times t-1 through t-p.
Once, enough of a time lag is considered, the errors vt
should be distributed N(0,s2) and r(vt,vt+h)=0, h<>0.
2. A moving
average model (of order q) has the form:
yt= vt - q1vt-1 - q2vt-2 - ... - qqvt-q
In this model the score on the dependent variable at
time t is considered to be a function of random processes occurring at times t
through t-q which are themselves properly distributed.
3. An ARIMA
model combines the two:
yt= f1yt-1 + f2yt-1 + ... + fpyt-p + vt
- q1vt-1 - q2vt-2 - ... - qqvt-q
In general, the estimation of ARIMA models is
difficult and requires specialized statistical programs.
C. Fourier
and Spectral Analysis
1. These techniques attempt to decompose the complex
pattern of data into a set of sine waves with different amplitudes and
periods. For example, in the graph
below, series 4 is composed of the sum of the previous 3 series. A Fourier analysis could decompose series 4
into its components.