Professional Documents
Culture Documents
AUTOCORRELATION
(Lec 12)
• Inertia
• Specification Bias: Excluded variables case.
• Specification Bias: Incorrect functional form
• Cobweb phenomenon
• Lags
• “Manipulation” of Data
• Data transformation
Y 1 2 X 2t 3 X 3t Vt
Vt 4 X 4t U t
The error term will reflect a systematic pattern, thus
creating autocorrelation.
Nguyen Thu Hang, BMNV, FTU CS2 7
Why does serial correlation occur?
• Specification Bias: Incorrect functional form
- Suppose the correct model in a cost-output study:
MC i 1 2 Qi 3 Qi2 U i
Where MC= marginal cost, Q= output
- But we run the model: MC Q V
i 1 2 i i
- Or: Vi 3Qi U i
2
Yt 1 2 X t u t E (u i u j ) 0
ˆ 2
S xy
xt y t var( ˆ2 )
2
S xx t
x 2
t
x 2
n1 n2
2 xt xt 1 xt xt 2
x x
var( ˆ2 ) AR(1) 1 2 t 1
2 2 t 1
... 2 n1 1 n
xt
2
n
x 2
n
x 2
n
x 2
t 1
t
t 1
t
t 1
t
( x x )
2 n 2
t 2 t t 1
2
Var ( ˆ GLS
) D
2
( x t x t 1 )
n 2
t 2
4
predict i3hat, xb
2
gen uhat= i3-i3hat uhat
year
-4
3
sduhat= uhat/Root
2
MSE= uhat/1.8432
1
sduhat
twoway scatter
sduhat year 0
-1
-2
4
tsset year
gen uhatlag=l.uhat
2
uhat
0
twoway scatter uhat
uhatlag
-2
-4
-4 -2 0 2 4
uhatlag
Define
N: total number of observations (N=N1+N2)
N1: number of + symbols (i.e. + residuals)
N2: number of ─ symbols (i.e. ─ residuals)
R: number of runs
Assuming that the N1 >10 and N2 >10, then
the number of runs is normally distributed
with:
Nguyen Thu Hang, BMNV, FTU CS2 32
4.2. The Runs Test
Then, 2N1 N 2 2 N 1 N 2 (2 N 1 N 2 N )
E ( R) 1 2
( N ) 2 ( N 1)
R
N
If the null hypothesis of randomness is sustainable,
following the properties of the normal distribution,
we should expect that
Prob [E(R) – 1.96 R ≤ R ≤ E(R) – 1.96 R]
Hypothesis: do not reject the null hypothesis of
randomness with 95% confidence if R, the number
of runs, lies in the preceding confidence interval;
reject otherwise
t t 1
(uˆ
t 2
ˆ
u ) 2
d t n
t
ˆ
u 2
t 1
d
t t 1 2 uˆ t uˆ t 1
ˆ
u 2
ˆ
u 2
21
uˆ uˆ
t t 1
t
ˆ
u 2
uˆ 2
t
d 21 ̂
Where ˆ
uˆ uˆt t 1
uˆ 2
t
Zone of Zone of
No
indecision indecision
autocorrelation Reject H0,
Reject H0,
evidence of evidence of
positive negative
auto- auto-
correlation correlation
0 dL dU 2 4-dU 4-dL 4
u t 1u t 1 2 u t 2 ........ p u t p t
H o : 1 2 ..... p 0
1 20.154 1 0.0000
3 20.773 3 0.0001
Point to note:
The regressors included in the regression model may
contain lagged values of the regressand Y. In DW,
this is not allowed.
The BG test is applicable even if the disturbances
follow a pth-order moving averages (MA) process,
that is ut is integrated as follows:
u t t 1 t 1 2 t 2 ........ p t p
A drawback of the BG test is that the value of p, the
length of the lag cannot be specified as a priori.
Nguyen Thu Hang, BMNV, FTU CS2 48
What to do when you find autocorrelation:
• Try to find out if the autocorrelation is pure autocorrelation
and not the result of mis-specification of the model.
Sometimes, we observe patterns in residuals because the
model is mis-specified- it has excluded some important
variables or because its functional form is incorrect.
• If it is pure autocorrelation, one can use appropriate
transformation of the original model so that in the
transformed model we do not have the problem of pure
autocorrelation. Use generalized least square (GLS)
method.
• In large samples, we can use the Newey-West method to
obtain standard errors of OLS estimators that are corrected
for autocorrelation. This method is an extension of White’s
heteroskedasticity-consistent standard errors method.
• In some situations, we canThucontinue
Nguyen Hang, BMNV, FTU to
CS2 use the OLS method. 49
Model Misspecification vs. Pure Autocorrelation
It is important to find out whether
autocorrelation is pure autocorrelation and not
the result of mis-specification of the model.
Suppose that the Durbin Watson test of a
given regression model reveals a value of
0.716. This indicates positive autocorrelation .
However, could this correlation have arisen
because the model was not correctly
specified?
Time series model do exhibit trend, so add a
trend variable in the equation.
Nguyen Thu Hang, BMNV, FTU CS2 50
Example
The Newey-West method
. newey i3 inf def, lag(1)
Newey-West
i3 Coef. Std. Err. t P>|t| [95% Conf. Interval]