55

Lecture 2: Serial correlation - web.sgh.waw.plweb.sgh.waw.pl/~atoroj/econometric_methods/lecture_2_3_sc.pdf · Lecture 2: Serial correlation Econometric Methods Warsaw School of Economics

  • Upload
    others

  • View
    5

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Lecture 2: Serial correlation - web.sgh.waw.plweb.sgh.waw.pl/~atoroj/econometric_methods/lecture_2_3_sc.pdf · Lecture 2: Serial correlation Econometric Methods Warsaw School of Economics

What is serial correlation? Testing for serial correlation Dealing with serial correlation

Lecture 2: Serial correlation

Econometric Methods Warsaw School of Economics

Andrzej Torój

Andrzej Torój

(2) Serial correlation 1 / 37

Page 2: Lecture 2: Serial correlation - web.sgh.waw.plweb.sgh.waw.pl/~atoroj/econometric_methods/lecture_2_3_sc.pdf · Lecture 2: Serial correlation Econometric Methods Warsaw School of Economics

What is serial correlation? Testing for serial correlation Dealing with serial correlation

Outline

1 What is serial correlation?

Variance-covariance matrix

Consequences of serial correlation

Exercise2 Testing for serial correlation

Testing

Exercise3 Dealing with serial correlation

Robust standard errors

Generalised Least Squares estimator

ExerciseAndrzej Torój

(2) Serial correlation 2 / 37

Page 3: Lecture 2: Serial correlation - web.sgh.waw.plweb.sgh.waw.pl/~atoroj/econometric_methods/lecture_2_3_sc.pdf · Lecture 2: Serial correlation Econometric Methods Warsaw School of Economics

What is serial correlation? Testing for serial correlation Dealing with serial correlation

Outline

1 What is serial correlation?

2 Testing for serial correlation

3 Dealing with serial correlation

Andrzej Torój

(2) Serial correlation 3 / 37

Page 4: Lecture 2: Serial correlation - web.sgh.waw.plweb.sgh.waw.pl/~atoroj/econometric_methods/lecture_2_3_sc.pdf · Lecture 2: Serial correlation Econometric Methods Warsaw School of Economics

What is serial correlation? Testing for serial correlation Dealing with serial correlation

Variance-covariance matrix

Variance-covariance matrix of ε

E(εεT

)= E

ε1ε2

.

.

.εT

[ ε1 ε2 . . . εT] = E

ε21

ε1ε2 . . . ε1εTε1ε2 ε2

2. . . ε2εT

.

.

.

.

.

....

.

.

.

ε1εT ε2εT . . . ε2T

=

=

E (ε1 − E (ε1))

2 E (ε1 − E (ε1)) (ε2 − E (ε2)) . . . E (ε1 − E (ε1)) (εT − E (εT ))

E (ε1 − E (ε1)) (ε2 − E (ε2)) E (ε2 − E (ε2))2 . . . E (ε2 − E (ε2)) (εT − E (εT ))

.

.

.

.

.

....

.

.

.

E (ε1 − E (ε1)) (εT − E (εT )) E (ε2 − E (ε2)) (εT − E (εT )) . . . E (εT − E (εT ))2

=

=

var (ε1) cov (ε1ε2) . . . cov (ε1εT )

cov (ε1ε2) var (ε2) . . . cov (ε2εT )

.

.

.

.

.

....

.

.

.cov (ε1εT ) cov (ε2εT ) . . . var (εT )

OLS assumptions=

σ2 0 . . . 0

0 σ2 . . . 0

.

.

.

.

.

....

.

.

.

0 0 . . . σ2

Andrzej Torój

(2) Serial correlation 4 / 37

Page 5: Lecture 2: Serial correlation - web.sgh.waw.plweb.sgh.waw.pl/~atoroj/econometric_methods/lecture_2_3_sc.pdf · Lecture 2: Serial correlation Econometric Methods Warsaw School of Economics

What is serial correlation? Testing for serial correlation Dealing with serial correlation

Variance-covariance matrix

Spherical disturbances

σ2 0 . . . 0

0 σ2 . . . 0.

.

.

.

.

.

.

.

.

.

.

.

0 0 . . . σ2

a spherical matrix

more general than identity matrix

more restrictive than diagonal matrix

zero non-diagonal elements (if broken: serial correlation)constant diagonal elements (if broken: heteroskedasticity)

Andrzej Torój

(2) Serial correlation 5 / 37

Page 6: Lecture 2: Serial correlation - web.sgh.waw.plweb.sgh.waw.pl/~atoroj/econometric_methods/lecture_2_3_sc.pdf · Lecture 2: Serial correlation Econometric Methods Warsaw School of Economics

What is serial correlation? Testing for serial correlation Dealing with serial correlation

Consequences of serial correlation

Serial correlation in data

no serial correlation positive negative

-.6

-.4

-.2

.0

.2

.4

.6

-.6

-.4

-.2

.0

.2

.4

.6

2000 2001 2002 2003 2004 2005 2006

Residual Actual Fitted

-2

-1

0

1

2

-3

-2

-1

0

1

2

2000 2001 2002 2003 2004 2005 2006

Residual Actual Fitted

-1.5

-1.0

-0.5

0.0

0.5

1.0

1.5

-1.5

-1.0

-0.5

0.0

0.5

1.0

1.5

2000 2001 2002 2003 2004 2005 2006

Residual Actual Fitted

Andrzej Torój

(2) Serial correlation 6 / 37

Page 7: Lecture 2: Serial correlation - web.sgh.waw.plweb.sgh.waw.pl/~atoroj/econometric_methods/lecture_2_3_sc.pdf · Lecture 2: Serial correlation Econometric Methods Warsaw School of Economics

What is serial correlation? Testing for serial correlation Dealing with serial correlation

Consequences of serial correlation

Does serial correlation cause bias?

E(β)

= E((XTX

)−1XTy

)=

= E((XTX

)−1XT (Xβ + ε)

)=

= E((XTX

)−1XTXβ

)+ E

((XTX

)−1XTε

)=

= β +(XTX

)−1XTE (ε) = β

unbiasedness of OLS proved did we use the assumption of

spherical disturbances ε?

Andrzej Torój

(2) Serial correlation 7 / 37

Page 8: Lecture 2: Serial correlation - web.sgh.waw.plweb.sgh.waw.pl/~atoroj/econometric_methods/lecture_2_3_sc.pdf · Lecture 2: Serial correlation Econometric Methods Warsaw School of Economics

What is serial correlation? Testing for serial correlation Dealing with serial correlation

Consequences of serial correlation

NO!

...but note that

serial correlation can be a symptom of misspecication......which in turn can bias the estimates

Andrzej Torój

(2) Serial correlation 8 / 37

Page 9: Lecture 2: Serial correlation - web.sgh.waw.plweb.sgh.waw.pl/~atoroj/econometric_methods/lecture_2_3_sc.pdf · Lecture 2: Serial correlation Econometric Methods Warsaw School of Economics

What is serial correlation? Testing for serial correlation Dealing with serial correlation

Consequences of serial correlation

NO!

...but note that

serial correlation can be a symptom of misspecication......which in turn can bias the estimates

Andrzej Torój

(2) Serial correlation 8 / 37

Page 10: Lecture 2: Serial correlation - web.sgh.waw.plweb.sgh.waw.pl/~atoroj/econometric_methods/lecture_2_3_sc.pdf · Lecture 2: Serial correlation Econometric Methods Warsaw School of Economics

What is serial correlation? Testing for serial correlation Dealing with serial correlation

Consequences of serial correlation

Does serial correlation cause ineciency?

Recall: β = β +(XTX

)XTε (do the previous derivation without

the expected value operator)

Var(β)

= E

[(β − β

)(β − β

)T]=

= E((

XTX)−1

XTε · εTX(XTX

)−1)

=

=(XTX

)−1

XTE(εεT

)X(XTX

)−1

= ...

under spherical disturbances: E(εεT

)= σ2I

... =(XTX

)−1

XTσ2IX(XTX

)−1

= σ2(XTX

)−1

XTX(XTX

)−1

=

σ2(XTX

)−1

(square roots of diagonal elements are standard errors of estimation)

under non-spherical disturbances: E(εεT

)= Ω

... =(XTX

)−1

XTΩX(XTX

)−1

Andrzej Torój

(2) Serial correlation 9 / 37

Page 11: Lecture 2: Serial correlation - web.sgh.waw.plweb.sgh.waw.pl/~atoroj/econometric_methods/lecture_2_3_sc.pdf · Lecture 2: Serial correlation Econometric Methods Warsaw School of Economics

What is serial correlation? Testing for serial correlation Dealing with serial correlation

Consequences of serial correlation

Does serial correlation cause ineciency?

Recall: β = β +(XTX

)XTε (do the previous derivation without

the expected value operator)

Var(β)

= E

[(β − β

)(β − β

)T]=

= E((

XTX)−1

XTε · εTX(XTX

)−1)

=

=(XTX

)−1

XTE(εεT

)X(XTX

)−1

= ...

under spherical disturbances: E(εεT

)= σ2I

... =(XTX

)−1

XTσ2IX(XTX

)−1

= σ2(XTX

)−1

XTX(XTX

)−1

=

σ2(XTX

)−1

(square roots of diagonal elements are standard errors of estimation)

under non-spherical disturbances: E(εεT

)= Ω

... =(XTX

)−1

XTΩX(XTX

)−1

Andrzej Torój

(2) Serial correlation 9 / 37

Page 12: Lecture 2: Serial correlation - web.sgh.waw.plweb.sgh.waw.pl/~atoroj/econometric_methods/lecture_2_3_sc.pdf · Lecture 2: Serial correlation Econometric Methods Warsaw School of Economics

What is serial correlation? Testing for serial correlation Dealing with serial correlation

Consequences of serial correlation

Does serial correlation cause ineciency?

Recall: β = β +(XTX

)XTε (do the previous derivation without

the expected value operator)

Var(β)

= E

[(β − β

)(β − β

)T]=

= E((

XTX)−1

XTε · εTX(XTX

)−1)

=

=(XTX

)−1

XTE(εεT

)X(XTX

)−1

= ...

under spherical disturbances: E(εεT

)= σ2I

... =(XTX

)−1

XTσ2IX(XTX

)−1

= σ2(XTX

)−1

XTX(XTX

)−1

=

σ2(XTX

)−1

(square roots of diagonal elements are standard errors of estimation)

under non-spherical disturbances: E(εεT

)= Ω

... =(XTX

)−1

XTΩX(XTX

)−1

Andrzej Torój

(2) Serial correlation 9 / 37

Page 13: Lecture 2: Serial correlation - web.sgh.waw.plweb.sgh.waw.pl/~atoroj/econometric_methods/lecture_2_3_sc.pdf · Lecture 2: Serial correlation Econometric Methods Warsaw School of Economics

What is serial correlation? Testing for serial correlation Dealing with serial correlation

Consequences of serial correlation

YES! The assumption of spherical matrix used explicitly in the

derivation!

If broken...

loss of eciencydistorted statistical inference based on variance-covariancematrix of the error term, including t-tests of variablesignicance recall from previous lecture:

Andrzej Torój

(2) Serial correlation 10 / 37

Page 14: Lecture 2: Serial correlation - web.sgh.waw.plweb.sgh.waw.pl/~atoroj/econometric_methods/lecture_2_3_sc.pdf · Lecture 2: Serial correlation Econometric Methods Warsaw School of Economics

What is serial correlation? Testing for serial correlation Dealing with serial correlation

Consequences of serial correlation

Sources of serial correlation

inertia and persistence of economic phenomena:

serial correlation approach (accept the serial correlation andtry to improve the eciency and statistical inference)

specication error (misspecied functional form, misspecied

dynamics, omitted variables)

re-specication approach (modify the model specicationuntil serial correlation vanishes)

Andrzej Torój

(2) Serial correlation 11 / 37

Page 15: Lecture 2: Serial correlation - web.sgh.waw.plweb.sgh.waw.pl/~atoroj/econometric_methods/lecture_2_3_sc.pdf · Lecture 2: Serial correlation Econometric Methods Warsaw School of Economics

What is serial correlation? Testing for serial correlation Dealing with serial correlation

Consequences of serial correlation

Sources of serial correlation

inertia and persistence of economic phenomena:

serial correlation approach (accept the serial correlation andtry to improve the eciency and statistical inference)

specication error (misspecied functional form, misspecied

dynamics, omitted variables)

re-specication approach (modify the model specicationuntil serial correlation vanishes)

Andrzej Torój

(2) Serial correlation 11 / 37

Page 16: Lecture 2: Serial correlation - web.sgh.waw.plweb.sgh.waw.pl/~atoroj/econometric_methods/lecture_2_3_sc.pdf · Lecture 2: Serial correlation Econometric Methods Warsaw School of Economics

What is serial correlation? Testing for serial correlation Dealing with serial correlation

Consequences of serial correlation

Re-specication approach: idea

True model: yt = β0 + β1x1,t + β2x2,t + εtEstimated model: yt = β0 + β1x1,t + εt

Andrzej Torój

(2) Serial correlation 12 / 37

Page 17: Lecture 2: Serial correlation - web.sgh.waw.plweb.sgh.waw.pl/~atoroj/econometric_methods/lecture_2_3_sc.pdf · Lecture 2: Serial correlation Econometric Methods Warsaw School of Economics

What is serial correlation? Testing for serial correlation Dealing with serial correlation

Exercise

Exercise (1/3)

Gasoline demand model

Our regression model explains the log-demand for gasoline percapita (log_Q_gasoline) with the following variables: log fuelprice (log_P_gasoline), log per capita income (log_Income)and log prices of new and used cars (log_P_new_car andlog_P_used_car , respectively). Model should contain a constant.

1 What is the consequence of using logged variables for theinterpretation of the regression results?

2 Which signs of the estimates do You expect? How do theseexpectations relate to familiar microeconomic theories?

3 Write down the estimated equation.

4 Were the expectations from point 2 fullled?

Andrzej Torój

(2) Serial correlation 13 / 37

Page 18: Lecture 2: Serial correlation - web.sgh.waw.plweb.sgh.waw.pl/~atoroj/econometric_methods/lecture_2_3_sc.pdf · Lecture 2: Serial correlation Econometric Methods Warsaw School of Economics

What is serial correlation? Testing for serial correlation Dealing with serial correlation

Outline

1 What is serial correlation?

2 Testing for serial correlation

3 Dealing with serial correlation

Andrzej Torój

(2) Serial correlation 14 / 37

Page 19: Lecture 2: Serial correlation - web.sgh.waw.plweb.sgh.waw.pl/~atoroj/econometric_methods/lecture_2_3_sc.pdf · Lecture 2: Serial correlation Econometric Methods Warsaw School of Economics

What is serial correlation? Testing for serial correlation Dealing with serial correlation

Testing

Durbin-Watson (1)

Durbin-Watson test

H0 : error term has no serial correlation of order 1

H1 : error term does have serial correlation of order 1

DW =

T∑t=2

(εt−εt−1)2

T∑t=1

ε2t

≈ 2 (1− ρ)

where ρ correlation between εt and εt−1

Test statistics has its own distribution tables.

Andrzej Torój

(2) Serial correlation 15 / 37

Page 20: Lecture 2: Serial correlation - web.sgh.waw.plweb.sgh.waw.pl/~atoroj/econometric_methods/lecture_2_3_sc.pdf · Lecture 2: Serial correlation Econometric Methods Warsaw School of Economics

What is serial correlation? Testing for serial correlation Dealing with serial correlation

Testing

Durbin-Watson (2)

Limitations:

model with a constant

...without lagged dependent variable

...with normally distributed error term

detects serial correlation of order at most 1

inconclusive range

Andrzej Torój

(2) Serial correlation 16 / 37

Page 21: Lecture 2: Serial correlation - web.sgh.waw.plweb.sgh.waw.pl/~atoroj/econometric_methods/lecture_2_3_sc.pdf · Lecture 2: Serial correlation Econometric Methods Warsaw School of Economics

What is serial correlation? Testing for serial correlation Dealing with serial correlation

Testing

Durbin-Watson (2)

Limitations:

model with a constant

...without lagged dependent variable

...with normally distributed error term

detects serial correlation of order at most 1

inconclusive range

Andrzej Torój

(2) Serial correlation 16 / 37

Page 22: Lecture 2: Serial correlation - web.sgh.waw.plweb.sgh.waw.pl/~atoroj/econometric_methods/lecture_2_3_sc.pdf · Lecture 2: Serial correlation Econometric Methods Warsaw School of Economics

What is serial correlation? Testing for serial correlation Dealing with serial correlation

Testing

Durbin-Watson (2)

Limitations:

model with a constant

...without lagged dependent variable

...with normally distributed error term

detects serial correlation of order at most 1

inconclusive range

Andrzej Torój

(2) Serial correlation 16 / 37

Page 23: Lecture 2: Serial correlation - web.sgh.waw.plweb.sgh.waw.pl/~atoroj/econometric_methods/lecture_2_3_sc.pdf · Lecture 2: Serial correlation Econometric Methods Warsaw School of Economics

What is serial correlation? Testing for serial correlation Dealing with serial correlation

Testing

Durbin-Watson (2)

Limitations:

model with a constant

...without lagged dependent variable

...with normally distributed error term

detects serial correlation of order at most 1

inconclusive range

Andrzej Torój

(2) Serial correlation 16 / 37

Page 24: Lecture 2: Serial correlation - web.sgh.waw.plweb.sgh.waw.pl/~atoroj/econometric_methods/lecture_2_3_sc.pdf · Lecture 2: Serial correlation Econometric Methods Warsaw School of Economics

What is serial correlation? Testing for serial correlation Dealing with serial correlation

Testing

Durbin-Watson (2)

Limitations:

model with a constant

...without lagged dependent variable

...with normally distributed error term

detects serial correlation of order at most 1

inconclusive range

Andrzej Torój

(2) Serial correlation 16 / 37

Page 25: Lecture 2: Serial correlation - web.sgh.waw.plweb.sgh.waw.pl/~atoroj/econometric_methods/lecture_2_3_sc.pdf · Lecture 2: Serial correlation Econometric Methods Warsaw School of Economics

What is serial correlation? Testing for serial correlation Dealing with serial correlation

Testing

h-Durbin

DW test biased towards rejecting serial correlation when

lagged dependent variable is a regressor

see e.g. Nerlove, Wallis (1966)

Durbin proposed a modication to take account of that:

h-Durbin test

H0 : error term has no serial correlation of order 1

H1 : error term does have serial correlation of order 1

hd =(1− DW

2

)√T

1−T ·var(βy(t−1)))∼ N (0, 1)

Andrzej Torój

(2) Serial correlation 17 / 37

Page 26: Lecture 2: Serial correlation - web.sgh.waw.plweb.sgh.waw.pl/~atoroj/econometric_methods/lecture_2_3_sc.pdf · Lecture 2: Serial correlation Econometric Methods Warsaw School of Economics

What is serial correlation? Testing for serial correlation Dealing with serial correlation

Testing

Lagrange multiplier

Step 1: regression equation estimated via OLS

yt = xtβ + εt β =(XTX

)−1XTy εt = yt − xtβ

Step 2: auxiliary regression for residuals from step 1

εt = xtβ + βk+1εt−1 + βk+2εt−2 + . . .+ βk+P εt−P

Under no serial correlation up to order P, the R2 of auxiliary

regression should be low.

Lagrange multiplier test

H0 : error term has no serial correlation of order up to P

H1 : error term does have serial correlation of order from 1 to P

LM = TR2 ∼ χ2 (P)Attention! Asymptotic test (short samples may distort the

inference).

Andrzej Torój

(2) Serial correlation 18 / 37

Page 27: Lecture 2: Serial correlation - web.sgh.waw.plweb.sgh.waw.pl/~atoroj/econometric_methods/lecture_2_3_sc.pdf · Lecture 2: Serial correlation Econometric Methods Warsaw School of Economics

What is serial correlation? Testing for serial correlation Dealing with serial correlation

Testing

Lagrange multiplier

Step 1: regression equation estimated via OLS

yt = xtβ + εt β =(XTX

)−1XTy εt = yt − xtβ

Step 2: auxiliary regression for residuals from step 1

εt = xtβ + βk+1εt−1 + βk+2εt−2 + . . .+ βk+P εt−P

Under no serial correlation up to order P, the R2 of auxiliary

regression should be low.

Lagrange multiplier test

H0 : error term has no serial correlation of order up to P

H1 : error term does have serial correlation of order from 1 to P

LM = TR2 ∼ χ2 (P)Attention! Asymptotic test (short samples may distort the

inference).

Andrzej Torój

(2) Serial correlation 18 / 37

Page 28: Lecture 2: Serial correlation - web.sgh.waw.plweb.sgh.waw.pl/~atoroj/econometric_methods/lecture_2_3_sc.pdf · Lecture 2: Serial correlation Econometric Methods Warsaw School of Economics

What is serial correlation? Testing for serial correlation Dealing with serial correlation

Testing

Lagrange multiplier

Step 1: regression equation estimated via OLS

yt = xtβ + εt β =(XTX

)−1XTy εt = yt − xtβ

Step 2: auxiliary regression for residuals from step 1

εt = xtβ + βk+1εt−1 + βk+2εt−2 + . . .+ βk+P εt−P

Under no serial correlation up to order P, the R2 of auxiliary

regression should be low.

Lagrange multiplier test

H0 : error term has no serial correlation of order up to P

H1 : error term does have serial correlation of order from 1 to P

LM = TR2 ∼ χ2 (P)Attention! Asymptotic test (short samples may distort the

inference).

Andrzej Torój

(2) Serial correlation 18 / 37

Page 29: Lecture 2: Serial correlation - web.sgh.waw.plweb.sgh.waw.pl/~atoroj/econometric_methods/lecture_2_3_sc.pdf · Lecture 2: Serial correlation Econometric Methods Warsaw School of Economics

What is serial correlation? Testing for serial correlation Dealing with serial correlation

Testing

Ljung-Box

Ljung-Box test

H0 : error term has no serial correlation of order up to P

H1 : error term does have serial correlation of order from 1 to P

Q = T (T + 2)P∑j=1

1T−j ·

T∑t=j+1

εt εt−j

T∑t=1

ε2t

High values of Q imply serial correlation (reject the null).

Andrzej Torój

(2) Serial correlation 19 / 37

Page 30: Lecture 2: Serial correlation - web.sgh.waw.plweb.sgh.waw.pl/~atoroj/econometric_methods/lecture_2_3_sc.pdf · Lecture 2: Serial correlation Econometric Methods Warsaw School of Economics

What is serial correlation? Testing for serial correlation Dealing with serial correlation

Exercise

Exercise (2/3)

Gasoline demand model

Look at our model.

1 Are the residuals serially correlated of order 1? Can we use

Durbin-Watson test?

2 Are they serially correlated of order up to 2? Use LM and

Ljung-Box test.

3 Is there serial correlation of order 2? Can we give a

conclusive answer?

4 Would the residuals be serially correlated if we considered a

model with additional lag of the dependent variable?

Andrzej Torój

(2) Serial correlation 20 / 37

Page 31: Lecture 2: Serial correlation - web.sgh.waw.plweb.sgh.waw.pl/~atoroj/econometric_methods/lecture_2_3_sc.pdf · Lecture 2: Serial correlation Econometric Methods Warsaw School of Economics

What is serial correlation? Testing for serial correlation Dealing with serial correlation

Outline

1 What is serial correlation?

2 Testing for serial correlation

3 Dealing with serial correlation

Andrzej Torój

(2) Serial correlation 21 / 37

Page 32: Lecture 2: Serial correlation - web.sgh.waw.plweb.sgh.waw.pl/~atoroj/econometric_methods/lecture_2_3_sc.pdf · Lecture 2: Serial correlation Econometric Methods Warsaw School of Economics

What is serial correlation? Testing for serial correlation Dealing with serial correlation

Robust standard errors

What are robust standard errors (and what they are not)?

formula for variance-covariance matrix of β, Var(β)= σ2

(XTX

)−1,

true only when errors are spherical

under serial correlation it is false, in particular:

the standard errors of estimation s(β0

)from the diagonal

Var(β)...

...t-statistics t = βis(β1)

...

...and conclusions concerning the signicance of variables

robust standard errors alternative way of estimating s(β0

)Choosing robust standard errors does not aect estimation results...

...but only the assessment of standard errors and the resulting conclusions as

regards the signicance of variables.

Andrzej Torój

(2) Serial correlation 22 / 37

Page 33: Lecture 2: Serial correlation - web.sgh.waw.plweb.sgh.waw.pl/~atoroj/econometric_methods/lecture_2_3_sc.pdf · Lecture 2: Serial correlation Econometric Methods Warsaw School of Economics

What is serial correlation? Testing for serial correlation Dealing with serial correlation

Robust standard errors

What are robust standard errors (and what they are not)?

formula for variance-covariance matrix of β, Var(β)= σ2

(XTX

)−1,

true only when errors are spherical

under serial correlation it is false, in particular:

the standard errors of estimation s(β0

)from the diagonal

Var(β)...

...t-statistics t = βis(β1)

...

...and conclusions concerning the signicance of variables

robust standard errors alternative way of estimating s(β0

)Choosing robust standard errors does not aect estimation results...

...but only the assessment of standard errors and the resulting conclusions as

regards the signicance of variables.

Andrzej Torój

(2) Serial correlation 22 / 37

Page 34: Lecture 2: Serial correlation - web.sgh.waw.plweb.sgh.waw.pl/~atoroj/econometric_methods/lecture_2_3_sc.pdf · Lecture 2: Serial correlation Econometric Methods Warsaw School of Economics

What is serial correlation? Testing for serial correlation Dealing with serial correlation

Robust standard errors

What are robust standard errors (and what they are not)?

formula for variance-covariance matrix of β, Var(β)= σ2

(XTX

)−1,

true only when errors are spherical

under serial correlation it is false, in particular:

the standard errors of estimation s(β0

)from the diagonal

Var(β)...

...t-statistics t = βis(β1)

...

...and conclusions concerning the signicance of variables

robust standard errors alternative way of estimating s(β0

)Choosing robust standard errors does not aect estimation results...

...but only the assessment of standard errors and the resulting conclusions as

regards the signicance of variables.

Andrzej Torój

(2) Serial correlation 22 / 37

Page 35: Lecture 2: Serial correlation - web.sgh.waw.plweb.sgh.waw.pl/~atoroj/econometric_methods/lecture_2_3_sc.pdf · Lecture 2: Serial correlation Econometric Methods Warsaw School of Economics

What is serial correlation? Testing for serial correlation Dealing with serial correlation

Robust standard errors

What are robust standard errors (and what they are not)?

formula for variance-covariance matrix of β, Var(β)= σ2

(XTX

)−1,

true only when errors are spherical

under serial correlation it is false, in particular:

the standard errors of estimation s(β0

)from the diagonal

Var(β)...

...t-statistics t = βis(β1)

...

...and conclusions concerning the signicance of variables

robust standard errors alternative way of estimating s(β0

)Choosing robust standard errors does not aect estimation results...

...but only the assessment of standard errors and the resulting conclusions as

regards the signicance of variables.

Andrzej Torój

(2) Serial correlation 22 / 37

Page 36: Lecture 2: Serial correlation - web.sgh.waw.plweb.sgh.waw.pl/~atoroj/econometric_methods/lecture_2_3_sc.pdf · Lecture 2: Serial correlation Econometric Methods Warsaw School of Economics

What is serial correlation? Testing for serial correlation Dealing with serial correlation

Robust standard errors

Newey-West robust SE

Newey and West (1987) robust to serial correlation (and

heteroskedasticity):

Var(β)

= 1T

T∑t=1

ε2t xtxTt

(XTX

)−1+

+ 1T

L∑l=1

T∑t=l+1

(1− l

L+1

)εt εt−l

(xtx

Tt−l + xt−lx

Tt

)whereby L arbitrary (L ≈ T

14 ).

Andrzej Torój

(2) Serial correlation 23 / 37

Page 37: Lecture 2: Serial correlation - web.sgh.waw.plweb.sgh.waw.pl/~atoroj/econometric_methods/lecture_2_3_sc.pdf · Lecture 2: Serial correlation Econometric Methods Warsaw School of Economics

What is serial correlation? Testing for serial correlation Dealing with serial correlation

Generalised Least Squares estimator

Generalised Least Squares estimator (1)

y = Xβ + ε ε ∼(E [ε] = 0,E

[εεT

]= σ2Ω

)With well-dened, symmetric matrix Ω...

...there is a unique decomposition Ω−1 = VTV.

Pre-multiply both sides of equation with V:

Vy = VXβ + Vε

The error term in this model is spherical:

var (Vε) = E[(Vε) (Vε)T

]= E

[VεεTVT

]=

= VE[εεT

]VT = Vσ2ΩVT =

= σ2V(VTV

)−1VT = σ2VV−1

(VT)−1

VT = σ2I

Andrzej Torój

(2) Serial correlation 24 / 37

Page 38: Lecture 2: Serial correlation - web.sgh.waw.plweb.sgh.waw.pl/~atoroj/econometric_methods/lecture_2_3_sc.pdf · Lecture 2: Serial correlation Econometric Methods Warsaw School of Economics

What is serial correlation? Testing for serial correlation Dealing with serial correlation

Generalised Least Squares estimator

Generalised Least Squares estimator (1)

y = Xβ + ε ε ∼(E [ε] = 0,E

[εεT

]= σ2Ω

)With well-dened, symmetric matrix Ω...

...there is a unique decomposition Ω−1 = VTV.

Pre-multiply both sides of equation with V:

Vy = VXβ + Vε

The error term in this model is spherical:

var (Vε) = E[(Vε) (Vε)T

]= E

[VεεTVT

]=

= VE[εεT

]VT = Vσ2ΩVT =

= σ2V(VTV

)−1VT = σ2VV−1

(VT)−1

VT = σ2I

Andrzej Torój

(2) Serial correlation 24 / 37

Page 39: Lecture 2: Serial correlation - web.sgh.waw.plweb.sgh.waw.pl/~atoroj/econometric_methods/lecture_2_3_sc.pdf · Lecture 2: Serial correlation Econometric Methods Warsaw School of Economics

What is serial correlation? Testing for serial correlation Dealing with serial correlation

Generalised Least Squares estimator

Generalised Least Squares estimator (1)

y = Xβ + ε ε ∼(E [ε] = 0,E

[εεT

]= σ2Ω

)With well-dened, symmetric matrix Ω...

...there is a unique decomposition Ω−1 = VTV.

Pre-multiply both sides of equation with V:

Vy = VXβ + Vε

The error term in this model is spherical:

var (Vε) = E[(Vε) (Vε)T

]= E

[VεεTVT

]=

= VE[εεT

]VT = Vσ2ΩVT =

= σ2V(VTV

)−1VT = σ2VV−1

(VT)−1

VT = σ2I

Andrzej Torój

(2) Serial correlation 24 / 37

Page 40: Lecture 2: Serial correlation - web.sgh.waw.plweb.sgh.waw.pl/~atoroj/econometric_methods/lecture_2_3_sc.pdf · Lecture 2: Serial correlation Econometric Methods Warsaw School of Economics

What is serial correlation? Testing for serial correlation Dealing with serial correlation

Generalised Least Squares estimator

Generalised Least Squares estimator (1)

y = Xβ + ε ε ∼(E [ε] = 0,E

[εεT

]= σ2Ω

)With well-dened, symmetric matrix Ω...

...there is a unique decomposition Ω−1 = VTV.

Pre-multiply both sides of equation with V:

Vy = VXβ + Vε

The error term in this model is spherical:

var (Vε) = E[(Vε) (Vε)T

]= E

[VεεTVT

]=

= VE[εεT

]VT = Vσ2ΩVT =

= σ2V(VTV

)−1VT = σ2VV−1

(VT)−1

VT = σ2I

Andrzej Torój

(2) Serial correlation 24 / 37

Page 41: Lecture 2: Serial correlation - web.sgh.waw.plweb.sgh.waw.pl/~atoroj/econometric_methods/lecture_2_3_sc.pdf · Lecture 2: Serial correlation Econometric Methods Warsaw School of Economics

What is serial correlation? Testing for serial correlation Dealing with serial correlation

Generalised Least Squares estimator

GLS estimator (2)

Vy = VXβ + Vε

Assume that V (and, hence, Ω) is known. Then the estimation of

the original equation with GLS is equivalent to the estimation of

the above equation with OLS (using transformed data):

βOLS

=(XTX

)−1XTy

βGLS

=[(VX)T (VX)

]−1(VX)T (Vy) =

=[XTVTVX

]−1XTVTVy =

[XTΩ−1X

]−1XTΩ−1y

Andrzej Torój

(2) Serial correlation 25 / 37

Page 42: Lecture 2: Serial correlation - web.sgh.waw.plweb.sgh.waw.pl/~atoroj/econometric_methods/lecture_2_3_sc.pdf · Lecture 2: Serial correlation Econometric Methods Warsaw School of Economics

What is serial correlation? Testing for serial correlation Dealing with serial correlation

Generalised Least Squares estimator

How to nd matrix Ω?

unknown and cannot be estimated in general (contains T 2

parameters under T observations)

but can be expressed as a function of a low number of parameters

this requires some assumption about the stochastic process for εt ,

e.g.:

εt = ρεt−1 + ηt η ∼(0, σ2I

), then Ω = Ω (ρ)

εt = ρ1εt−1 + ρ2εt−2 + ηt η ∼(0, σ2I

), then

Ω = Ω (ρ1, ρ2)etc.

Andrzej Torój

(2) Serial correlation 26 / 37

Page 43: Lecture 2: Serial correlation - web.sgh.waw.plweb.sgh.waw.pl/~atoroj/econometric_methods/lecture_2_3_sc.pdf · Lecture 2: Serial correlation Econometric Methods Warsaw School of Economics

What is serial correlation? Testing for serial correlation Dealing with serial correlation

Generalised Least Squares estimator

How to nd matrix Ω?

unknown and cannot be estimated in general (contains T 2

parameters under T observations)

but can be expressed as a function of a low number of parameters

this requires some assumption about the stochastic process for εt ,

e.g.:

εt = ρεt−1 + ηt η ∼(0, σ2I

), then Ω = Ω (ρ)

εt = ρ1εt−1 + ρ2εt−2 + ηt η ∼(0, σ2I

), then

Ω = Ω (ρ1, ρ2)etc.

Andrzej Torój

(2) Serial correlation 26 / 37

Page 44: Lecture 2: Serial correlation - web.sgh.waw.plweb.sgh.waw.pl/~atoroj/econometric_methods/lecture_2_3_sc.pdf · Lecture 2: Serial correlation Econometric Methods Warsaw School of Economics

What is serial correlation? Testing for serial correlation Dealing with serial correlation

Generalised Least Squares estimator

How to nd matrix Ω?

unknown and cannot be estimated in general (contains T 2

parameters under T observations)

but can be expressed as a function of a low number of parameters

this requires some assumption about the stochastic process for εt ,

e.g.:

εt = ρεt−1 + ηt η ∼(0, σ2I

), then Ω = Ω (ρ)

εt = ρ1εt−1 + ρ2εt−2 + ηt η ∼(0, σ2I

), then

Ω = Ω (ρ1, ρ2)etc.

Andrzej Torój

(2) Serial correlation 26 / 37

Page 45: Lecture 2: Serial correlation - web.sgh.waw.plweb.sgh.waw.pl/~atoroj/econometric_methods/lecture_2_3_sc.pdf · Lecture 2: Serial correlation Econometric Methods Warsaw School of Economics

What is serial correlation? Testing for serial correlation Dealing with serial correlation

Generalised Least Squares estimator

AR(1) example: Ω = Ω (ρ) (1)

Suppose: εt = ρεt−1 + ηt η ∼(0, σ2ηI

)var(εt) = var(ρεt−1 + ηt) = var(ρ2εt−2 + ρηt−1 + ηt) =

var(ηt + ρηt−1 + ρ2ηt−2 + ...

)= σ2η + σ2ηρ

2 + σ2ηρ4 + ... =

σ2η1−ρ2

cov(εt , εt−1) = cov (ρεt−1 + ηt , εt−1) = ρvar(εt−1) = ρσ2η

1−ρ2

cov(εt , εt−2) = cov(ρ2εt−2 + ρεt−1 + ηt , εt−2

)= ρ2var(εt−2) = ρ2

σ2η1−ρ2

...

Ω =σ2

η

1−ρ2

1 ρ ρ2 · · · ρT−1

ρ 1 ρ. . .

...

ρ2 ρ 1. . . ρ2

.... . .

. . .. . . ρ

ρT−1 · · · ρ2 ρ 1

Andrzej Torój

(2) Serial correlation 27 / 37

Page 46: Lecture 2: Serial correlation - web.sgh.waw.plweb.sgh.waw.pl/~atoroj/econometric_methods/lecture_2_3_sc.pdf · Lecture 2: Serial correlation Econometric Methods Warsaw School of Economics

What is serial correlation? Testing for serial correlation Dealing with serial correlation

Generalised Least Squares estimator

AR(1) example: Ω = Ω (ρ) (2)

Under such circumstances, one can show that:

Ω−1

= 1σ2η

1 −ρ 0 · · · 0

−ρ 1+ ρ2 −ρ. . .

...

0 −ρ 1+ ρ2. . . 0

.... . .

. . .. . . −ρ

0 · · · 0 −ρ 1

V =

√1− ρ2 0 0 · · · 0

−ρ 1 0. . .

...

0 −ρ 1. . . 0

.... . .

. . .. . . 0

0 · · · 0 −ρ 1

Proof: Compute ΩΩ

−1(should be equal to I ) and V

TV (should be equal to Ω

−1).

Andrzej Torój

(2) Serial correlation 28 / 37

Page 47: Lecture 2: Serial correlation - web.sgh.waw.plweb.sgh.waw.pl/~atoroj/econometric_methods/lecture_2_3_sc.pdf · Lecture 2: Serial correlation Econometric Methods Warsaw School of Economics

What is serial correlation? Testing for serial correlation Dealing with serial correlation

Generalised Least Squares estimator

Feasible GLS in practice

Ω ← ρ

↓↑ε

Start: ↑βOLS → βGLS → y

Andrzej Torój

(2) Serial correlation 29 / 37

Page 48: Lecture 2: Serial correlation - web.sgh.waw.plweb.sgh.waw.pl/~atoroj/econometric_methods/lecture_2_3_sc.pdf · Lecture 2: Serial correlation Econometric Methods Warsaw School of Economics

What is serial correlation? Testing for serial correlation Dealing with serial correlation

Generalised Least Squares estimator

Feasible GLS in practice

Ω ← ρ

↓↑ε

Start: ↑βOLS → βGLS → y

Andrzej Torój

(2) Serial correlation 30 / 37

Page 49: Lecture 2: Serial correlation - web.sgh.waw.plweb.sgh.waw.pl/~atoroj/econometric_methods/lecture_2_3_sc.pdf · Lecture 2: Serial correlation Econometric Methods Warsaw School of Economics

What is serial correlation? Testing for serial correlation Dealing with serial correlation

Generalised Least Squares estimator

Feasible GLS in practice

Ω ← ρ

↓↑ε

Start: ↑βOLS → βGLS → y

Andrzej Torój

(2) Serial correlation 31 / 37

Page 50: Lecture 2: Serial correlation - web.sgh.waw.plweb.sgh.waw.pl/~atoroj/econometric_methods/lecture_2_3_sc.pdf · Lecture 2: Serial correlation Econometric Methods Warsaw School of Economics

What is serial correlation? Testing for serial correlation Dealing with serial correlation

Generalised Least Squares estimator

Feasible GLS in practice

Ω ← ρ

↓↑ε

Start: ↑βOLS → βGLS → y

Andrzej Torój

(2) Serial correlation 32 / 37

Page 51: Lecture 2: Serial correlation - web.sgh.waw.plweb.sgh.waw.pl/~atoroj/econometric_methods/lecture_2_3_sc.pdf · Lecture 2: Serial correlation Econometric Methods Warsaw School of Economics

What is serial correlation? Testing for serial correlation Dealing with serial correlation

Generalised Least Squares estimator

Feasible GLS in practice

Ω ← ρ

↓↑ε

Start: ↑βOLS → βGLS → y

Andrzej Torój

(2) Serial correlation 33 / 37

Page 52: Lecture 2: Serial correlation - web.sgh.waw.plweb.sgh.waw.pl/~atoroj/econometric_methods/lecture_2_3_sc.pdf · Lecture 2: Serial correlation Econometric Methods Warsaw School of Economics

What is serial correlation? Testing for serial correlation Dealing with serial correlation

Generalised Least Squares estimator

Cochrane-Orcutt's method

Special case of GLS: 1st order serial correlation assumed.

yt = xtβ + εt εt = ρ1εt−1 + ηt

yt−1 = xt−1β + εt−1 ηt = εt − ρ1εt−1

Subtract both sides with second equation multiplied by ρ1:

yt − ρ1yt−1 = xtβ − ρ1xt−1β + εt − ρ1εtyt − ρ1yt−1︸ ︷︷ ︸

transformed independent

= (xt − ρ1xt−1)︸ ︷︷ ︸transformed dependent

β + ηt︸︷︷︸spherical error

Generalized Cochrane-Orcutt: serial correlation of higher orders.

Andrzej Torój

(2) Serial correlation 34 / 37

Page 53: Lecture 2: Serial correlation - web.sgh.waw.plweb.sgh.waw.pl/~atoroj/econometric_methods/lecture_2_3_sc.pdf · Lecture 2: Serial correlation Econometric Methods Warsaw School of Economics

What is serial correlation? Testing for serial correlation Dealing with serial correlation

Exercise

Exercise (3/3)

Gasoline demand model

Look at our model again and compare the estimates (and their

signicance) obtained with.

1 OLS

2 OLS with robust standard errors

3 Cochrane-Orcutt method

Discuss.

Andrzej Torój

(2) Serial correlation 35 / 37

Page 54: Lecture 2: Serial correlation - web.sgh.waw.plweb.sgh.waw.pl/~atoroj/econometric_methods/lecture_2_3_sc.pdf · Lecture 2: Serial correlation Econometric Methods Warsaw School of Economics

What is serial correlation? Testing for serial correlation Dealing with serial correlation

Exercise

Readings

Greene: chapter Serial correlation

Greene: chapter Nonspherical Disturbances The Generalized

Regression Model (sub-chapter about feasible GLS)

Andrzej Torój

(2) Serial correlation 36 / 37

Page 55: Lecture 2: Serial correlation - web.sgh.waw.plweb.sgh.waw.pl/~atoroj/econometric_methods/lecture_2_3_sc.pdf · Lecture 2: Serial correlation Econometric Methods Warsaw School of Economics

What is serial correlation? Testing for serial correlation Dealing with serial correlation

Exercise

Homework

Gasoline demand model

Write manually an R programme performing the GLS estimation

with AR(p) residuals, for any sensible value of p. Use it to estimate

the version of the model with AR(2) residuals.

Other models

Do the exercises specied in the comments of the R code.

Andrzej Torój

(2) Serial correlation 37 / 37