0% found this document useful (0 votes)
5 views

Cap0_Slides

The document outlines the assumptions and properties of the Generalized Regression Model, focusing on finite and large sample conditions, including linearity, exogeneity, and homoscedasticity. It discusses the implications of autocorrelation and heteroscedasticity on Ordinary Least Squares (OLS) estimators, noting that while OLS can remain unbiased, traditional inference methods may be invalid under these conditions. Additionally, it covers testing for serial correlation in regression models, providing methodologies for both strictly exogenous and predetermined regressors.

Uploaded by

explicacoesun
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
5 views

Cap0_Slides

The document outlines the assumptions and properties of the Generalized Regression Model, focusing on finite and large sample conditions, including linearity, exogeneity, and homoscedasticity. It discusses the implications of autocorrelation and heteroscedasticity on Ordinary Least Squares (OLS) estimators, noting that while OLS can remain unbiased, traditional inference methods may be invalid under these conditions. Additionally, it covers testing for serial correlation in regression models, providing methodologies for both strictly exogenous and predetermined regressors.

Uploaded by

explicacoesun
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 53

1

0 The Generalized Regression Model and Autocorrelation

You need to review the following assumptions (See the slides of Econometria I)

Finite Sample
Assumption (FS1 - Linearity). yi = 1 + 2xi2 + ::: + K xiK + "i. The model speci…es
a linear relationship between y and x1; :::; xK (The model is linear in the parameters).
Assumption (FS2 - Full column rank). There is no exact linear relationship among any of
the independent variables in the model, rank (X) = K
Assumption (FS3 - Exogeneity of the independent variables - Strict Exogeneity). E "ijxj1; :::; xj
0; 8i; j , E ( "ij X) = 0; 8i , E ( "j X) = 0:
Assumption (FS4 - Homoscedasticity and Nonautocorrelation). Var ( "ij X) = E "2i X =
2 > 0; 8i; Cov "i; "j X = 0; 8i; j ; i 6= j

Assumption (FS5 - Normal Distribution). "ij X N 0; 2


2

Large Sample (n ! 1)
Assumption (LS1 - Linearity, S&WD). The model is linear yi = x0i + "i and f(yi; xi)g
is jointly S&WD.
X0X P p
Assumption (LS2 - Rank Condition). n = n1 n
i=1 xi x0
i ! E xix0i = Q and Q is
nonsingular.
Assumption (LS3 - Predetermined Regressors). All the regressors are predetermined in the
sense that they are orthogonal to the contemporaneous error term: E (xik "i) = 0; 8i; k.
Assumption (LS4 - fxi"ig is a Martingale Di¤erence with Finite Second Moments). fwig,
where wi := xi"i; is a martingale di¤erence sequence (so a fortiori E (xi"i) = 0). The
K K matrix of cross moments, E "2i xix0i , is nonsingular.
Assumption (LS5 - Conditional Homocedasticity). Var ( "ij xi) = 2; 8i.
3

0.1 Introduction

The generalized linear regression model is

y = X +"
E ( "j X) = 0
0 2 =
E "" X = where 6= I
The hypothesis E ( "j X) = 0 is too strong and it does not hold in general for time-series
analysis. We may consider the weaker hypotheses E ( "tj xt) = 0.
4

Spherical Disturbances:
2 3 2 3
E "21 X E ( "1"2j X) E ( "1"nj X) 2 0 0
6 7 6 7
6 7
0 6 E ( "2"1j X) E "22 X E ( "2"nj X) 7 6 0 2 0 7
E "" X =6 ... ... ... ... 7=6
6 ... ... ... ... 7
7
6 7 4 5
4 5
0 0 2
E ( "n"1j X) E ( "n"2j X) E "2n X

Heteroscedasticity (and no Autocorrelation)


2 3
2 0 0
6 1 7
6 0 2 0 7
0 =6 2 7
E "" X 6 ... ... ... ... 7
4 5
0 0 2
n
5

Autocorrelation (and Homocedasticity):


2 3
1 ! 12 ! 1n
6 ! 12 1 ! 2n 7
""0 X = 26 7
E 6 ... ... ... ... 7
4 5
! 1n ! 2n 1

(at least one ! ij 6= 0; i; j = 1; 2; ::; n)

Autocorrelation and Heteroscedasticity:


2 3
! 11 ! 12 ! 1n
6 ! 12 ! 22 ! 2n 7
""0 X = 26 7
E 6 ... ... ... ... 7
4 5
! 1n ! 2n ! nn
6

0.2 OLS Properties under Autocorrelation and/or Heterocedasticity

0.2.1 Finite-Sample Properties of OLS

Assumptions FS1-FS3 may hold under Autocorrelation and/or Heterocedasticity, so the OLS
estimator may be unbiased:

E (b) = E ( bj X) = :
However, it can be proved [board] that
1 2 1
Var ( bj X) = X0X X0 X X0X :

Additionally, if Assumptoin FS5 holds (The disturbances are normally distributed), then
1 2 1
bj X N ; X0X X0 X X0X

and statistical inference can be carried out from this result.


7

0.2.2 Asymptotic Properties of OLS

Assumptions LS1-LS3 may hold under Autocorrelation and/or Heterocedasticity, so the OLS
estimator may be consistent:
p
b ! :
However, usual inference is not valid. To see why consider the following.

We know that b = X0X 1X0". Hence,


! 1 P ! 1
p X0X p 0 1 X
1 i xixi
n (b )= p X0" or n (b )= p xi"i
n n n n i
Under “some conditions” (that we will analyse later on) we have
P ! 1
0
i xixi p
! Q 1 where Q := E xix0i and
n
0 1
1 X d 1 X
p xi"i ! N (0; S) ; where S := AVar @ p xi"iA :
n i n i
8

Hence,
p d d
n (b ) ! Q 1Z where Z ! N (0; S) or
p d
n (b ) ! N 0; Q 1SQ 1 :

Under the Assumptions LS1-LS4 the expression Q 1SQ 1 reduces to 2Q 1. Now this
simpli…cation cannot be done because S does not coincide with 2Q; due to the presence
of Autocorrelation and/or Heterocedasticity.

Remarks:

The Gauss-Markov Theorem (based on Assumptions FS1-FS4) no longer holds for the
OLS estimator, because FS4 does not hold. The BLUE is some other estimator.

However, the OLS estimator b is unbiased and can still be used even if FS4 does not
hold.
9

Because the variance of the least squares estimator is not 2 X0X 1 statistical infer-
ence based on 2 X0X 1 is incorrect. The usual t-ratio is not distributed as the t
distribution. The same comment applies to the F-test.

It can be proved that s2 is a biased estimator of 2; however, s2 may be consistent for


2 under certain conditions.

Therefore s2 X0X 1 is (completely) inadequate to estimate Var ( bj X) : There is


usually no way to know whether 2 X0X 1 is larger or smaller than the true variance
of b.

If is known we may develop the theory under the Assumption FS1-FS3 and FS5. Oth-
erwise we need the Assumptions LS1-LS4 to estimate through a consistent estimator.
10

0.3 Heteroskedasticity

ECONOMETRIA I
11

0.4 Autocorrelation

Because the issue of serial correlation arises almost always in time-series models, we use the
subscript "t" instead of "i" in this section.

We consider now the case


2 3
1 ! 12 ! 1n
6 ! 12 1 ! 2n 7
""0 X = 26 7
E 6 ... ... ... ... 7
4 5
! 1n ! 2n 1
or
Cov ( "t; "sj X) 6= 0; 8t; s:
In most cases of interest Cov ( "t; "sj X) = Cov ("t; "s) : To simplify we assume that

Cov ( "t; "sj X) = Cov ("t; "s) :


Note Cov ("t; "s) = E ("t"s) since E ("t) = 0:
12

Example 0.4.1. AP IConsider

yt = 1 + 2xt2 + "t;
"t = "t 1 + ut; j j<1
where futg is a sequence of i.i.d. r.v. with E (ut) = 0, Var (ut) = 2u and E "t k ut = 0
8k 2 N: We say that f"tg follows an AR(1) [autoregressive process of order 1]. We have:
2 2
u u j;
Var ( "tj X) = ::: = 2
; E "t"t j X = ::: = 2
j 0
1 1
2 3
1 n 1
2 6 n 2 7
0 0 u 6 1 7
6
E "" X = E "" = 26 ... ... ... ... 7
7:
1 4 5
n 1 n 2 1
13

Example 0.4.2 (Cont.). Previous example with = 0:95 (See 00_ilustra_autoc.py). It


is clear that Cov "i; "j = 0 fails.
14

Another example where E "t"t j 6= 0 (Misspeci…cation, see below):


15

Autocorrelated errors could arise for several reasons:

Prolonged in‡uence of shocks. In time series data, random shocks (disturbances) have
e¤ects that often persist over more than one time period. An earthquake, ‡ood, strike,
pandemic, or war, for example, will probably a¤ect the economy’s operation in periods
following the period in which it occurs.

Inertia. Owing to inertia or psychological conditioning, past actions often have a strong
e¤ect on current actions, so that a positive disturbance in one period is likely to in‡uence
activity in succeeding periods.

Spatial autocorrelation. In regional cross-section data, a random shock a¤ecting economic


activity in one region may cause economic activity in an adjacent region to change because
of close economic ties between the regions.

Data manipulation. Published data often undergo interpolation or smoothing, procedures


that average true disturbances over successive time periods.

Misspeci…cation. An omitted relevant independent variable that is autocorrelated will


make the disturbance (associated with the misspeci…ed model) autocorrelated. An incorrect
functional form or a misspeci…cation of the equation’s dynamics could do the same. In these
instances, the appropriate procedure is to correct the misspeci…cation.
16

0.4.1 Testing Serial Correlation

We assume a more general structure of autocorrelation:


"t = 1"t 1 + ::: + p"t p + ut
where futg is a White Noise process and 1; :::; p are such that f"tg is stationary (We will
see later in what conditions f"tg is stationary, as a function of i).

Testing with Strictly Exogenous Regressors

Under strictly exogenous regressors (FS3):

E ( "tj X) = 0; t = 1; 2; :::; n
it can be shown that the hypothesis H0 : 1 = 2 = ::: = p = 0 can be tested through
the following auxiliary regression:
regression et on et 1; :::; et p:
Under the null
d
LM = nR2 ! 2(p)

where R2 refers to the auxiliar regression.


17

Testing with Predetermined, but Not Strictly Exogenous, Regressors (Breusch-


Godfrey test)

If the regressors are not strictly exogenous, for example, if there is a lagged endogenous
(yt 1; or yt 2; etc.) as explanatory variable the test presented in the previous slide is not
valid: The reason is somewhat technical and is explained in Hayashi’s book, pp. 144-146.

The trick consists in removing the e¤ect of xt in the regression of et on et 1; :::; et p by


considering now the regression

et on xt,et 1; :::; et p
and then calculating the LM statistic for the hypothesis that the p coe¢ cients of et 1; :::; et p
are all zero. This regression is still valid when the regressors are strictly exogenous (so you
may always use that regression).
18

Given
et = 1 + 2xt2 + ::: + K xtK + 1et 1 + ::: + pet p + errort
the null hypothesis can be formulated as

H0 : 1 = 2 = ::: = p = 0
Unde the null
d
LM = nR2 ! 2(p)

where R2 refers to the auxiliar regression.


19

To sump up. To test H0 : 1 = 2 = ::: = p = 0

Select p

– For annual data, use p = 1 or 2;

– For quarterly data, use e.g. p = 4; For monthly data, use e.g. p = 12

xt are strictly exogenous

– Run the regression of et on et 1; :::; et p

– Test that all coe¢ cients are zero using the 2(p) test

xt are not strictly exogenous

– Run the regression of et on xt and et 1; :::; et p

– Test that all coe¢ cients associated with et j are zero using 2(p) test
20

Example 0.4.3. AP IConsider, chnimp: the volume of imports of barium chloride from
China, chempi: index of chemical production in USA (to control for overall demand for
barium chloride), gas: the volume of gasoline production (another demand variable), rtwex:
an exchange rate index (measures the strength of the dollar against several other currencies).
File: 00_auto_resid_graph.py
21

OLS Regression Results


==============================================================================
Dep. Variable: lchnimp R-squared: 0.281
Model: OLS Adj. R-squared: 0.264
Method: Least Squares F-statistic: 16.54
Date: Nan Prob (F-statistic): 3.94e-09
Time: Nan Log-Likelihood: -117.01
No. Observations: 131 AIC: 242.0
Df Residuals: 127 BIC: 253.5
Df Model: 3
Covariance Type: nonrobust
==============================================================================
coef std err t P>|t| [0.025 0.975]
------------------------------------------------------------------------------
const -19.7599 21.086 -0.937 0.350 -61.485 21.965
lchempi 3.0443 0.479 6.356 0.000 2.097 3.992
lgas 0.3498 0.906 0.386 0.700 -1.444 2.143
lrtwex 0.7176 0.349 2.053 0.042 0.026 1.409
==============================================================================
22
23

Example 0.4.4 (continuation of the previous example). AP ISee 00_auto_test.py. Since


we have montly data we may have a seasonal e¤ect. Thus, we test
H0 : 1 = 2 = ::: = 12 = 0:
The auxiliar regression to test autocorrelation is
et = 1 + 2lchempit + 2lgast + 3lrtwext + 1et 1 + ::: + 12et 12 + errort:

Output: Autocorrelation test - Breusch-Godfrey test;


p-value : 0.01017262590121024
24

If you conclude that the errors are serial correlated you have a few options:

(a) you don’t know the form of autocorrelation so you rely on the OLS, but you use the
[ (b) = 1 Q
(HAC) covariance matrix estimator AVar ^ 1S^ HAC Q^ 1 [sections 0.4.2 -
n
0.4.4]

(b) You know (at least approximately) the form of autocorrelation and so you use a feasible
GLS estimator [section 0.4.6]

(c) You are concerned only with the dynamic speci…cation of the model and with forecast.
You may try to convert your model into a dynamically complete model [section 0.4.7]

(d) Your model may be misspeci…ed: you respecify the model and the autocorrelation dis-
appears [section 0.4.8]
25

0.4.2 OLS I - Properties

Previous results in section 0.2 apply. However, by assuming just the autocorrelation we
can be more precise in terms of the conditions that lead to consistency and asymptotic
distribution.

When the regressors include a constant (true in virtually all known applications), Assumption
LS4 implies that the error term is a scalar martingale di¤erence sequence, so if the error
is found to be serially correlated (or autocorrelated), that is an indication of a failure of
Assumption LS4.

We have Cov xt"t; xt j "t j 6= 0: In fact,

Cov xt"t; xt j "t j = E xt"tx0t j "t j


= E E xt"tx0t j "t j xt j ; xt
= E xtx0t j E "t"t j xt j ; xt 6= 0:
26

Assumpt. LS1-LS3 may hold under serial correlation, so the OLS estimator may be consistent
even if the error is autocorrelated. However, usual inference is not valid. To see why, consider
! 1
p X0X 1
n (b ) = p X0"
n n
0 1 10 1
n
X n
@
1 0 A @
1 X
= xtxt p xt"tA
n t=1 n t=1
We have
p
AVar n (b ) = Q 1SQ 1
where

Q := E xix0i
! 0 1
n
X
1 1
S := AVar p X0" = n!1
lim Var @ xi"iA
n n i=1
(see section 0.2).
27

Summary of what we know:

If errors are homocedastic and not autocorrelated then

S = Var (xi"i) = 2 0
E xixi :
n
2 X
s
^ =
S xtx0t
n t=1

If errors are heteroscedastic and not autocorrelated then :

S = Var (xi"i) = E "2i xix0i :


Xn
1
^ =
S e2t xtx0t
n t=1
28

If the errors are autocorrelated:


! 0 1
Xn
1 0 1
S = AVar p X " = ::: = lim Var @ xi"iA
n n i=1
1X n
1 nX1 X n
0 0
= lim Var (xt"t) + lim E xt"txt j "t j + E xt j "t j xt"t
n i=1 n j=1 t=j+1
1 nX1 X n
0 0
= Var (xt"t) + lim E "t"t j xtxt j + E "t j "txt j xt
n j=1 t=j+1
^ = S
S ^ HAC (See next section)
2 P 0 or 1 Pn 2
Hence, if the errors are autocorrelated we cannot use n n t=1 x t xt n
0
t=1 et xtxt (robust
to conditional heteroscedasticity) as a consistent estimator of S.
29

0.4.3 OLS II - Estimating S Consistently

For sake of generality, assume that we have also a problem of heteroscedasticity.

Given
1 nX1 X n
S=E "2t xtx0t + lim 0 0
E "t"t j xtxt j + E "t j "txt j xt ;
n j=1 t=j+1
a possible estimator of S based on the analogy principle would be
n 0 1
nX n
1 X 1 X
2 0
et xtxt + etet j xtx0t j + et j etxt j x0t ; n0 < n:
n t=1 n j=1 t=j+1
A major problem with this estimator is that it is not positive semi-de…nite and hence cannot
be a well-de…ned variance-covariance matrix.
30

Newey and West show that with a suitable weighting function ! (j ), the estimator below is
consistent and positive semi-de…nite:
Xn XL Xn
1 1
^ HAC =
S e2t xtx0t + ! (j ) etet j xtx0t j + et j etxt j x0t
n t=1 n j=1 t=j+1
where the weighting function ! (j ) is
j
! (j ) = 1 :
L+1
The maximum lag L must be determined in advance. Autocorrelations at lags longer than
L are ignored. For a moving-average process, this value is in general a small number.

This estimator is known as (HAC) covariance matrix estimator and is valid when both
conditional heteroscedasticity and serial correlations are present but of an unknown form.
p ^ 1SHAC Q ^ 1.
[
The term HAC estimador also applies to AVar ( n (b )) = Q
31

Example 0.4.5. AP IFor xt = 1; n = 9; L = 3 we have


L
X n
X
! (j ) etet j xtx0t j + et j etxt j x0t
j=1 t=j+1
XL Xn
= ! (j ) 2etet j
j=1 t=j+1
= ! (1) (2e1e2 + 2e2e3 + 2e3e4 + 2e4e5 + 2e5e6 + 2e6e7 + 2e7e8 + 2e8e9) +
! (2) (2e1e3 + 2e2e4 + 2e3e5 + 2e4e6 + 2e5e7 + 2e6e8 + 2e7e9) +
! (3) (2e1e4 + 2e2e5 + 2e3e6 + 2e4e7 + 2e5e8 + 2e6e9) :

1
! (1) = 1 = 0:75
4
2
! (2) = 1 = 0:50
4
3
! (3) = 1 = 0:25
4
32

Selecting L - this is an empirical question. Some authors recommend


n 2=9
L = int(4 ); (int (x) : integer part of x)
100

10
L
9

0
0 200 400 600 800 1000 1200 1400 1600 1800 2000 2200 2400 2600 2800 3000 3200 3400 3600 3800 4000 4200 4400 4600 4800 5000
n
33

0.4.4 OLS III - Inference

p
Consistent estimator for AVar ( n (b )) = Q 1SQ 1:
p
[
AVar n (b ^ 1S
) =Q ^ 1:
^ HAC Q

[ (pn (b
Suppose LS1-LS3 hold and AVar
p p
)) ! AVar ( n (b )). We have
a [ (b) = N [ (b) :
b N ; AVar ; AVar
Under H0 : k = 0k we have
bk 0 h i
d
t0k = k ! N (0; 1) ; where ^ 2bk [ (bk ) = AVar
= AVar [ (b) :
^ bk kk

Under H0 : R = r with rank (R) = p, we have (Wald test)


0 1 d 2
W = (Rb [ b) R0
r) RAVar( (Rb r) ! (p)
This result is extremely important and useful. It implies that without actually specifying
the type of autocorrelation and heteroscedasticity, we can still make appropriate inferences
based on the results of least squares. This implication is especially useful if we are unsure of
the precise nature of the autocorrelation and heteroscedasticity (which is probably most of
the time).
34

Example 0.4.6 (continuation of the previous example). AP IOLS estimation using


p
[
AVar n (b ) =Q ^ 1S^ HAC Q^ 1 (HAC estimator)
35
36

0.4.5 E¢ cient Estimation by Generalized Least Squares (GLS)

There are many forms of autocorrelation and each one leads to a di¤erent structure for the
error covariance matrix . The most popular form is known as the …rst-order autoregressive
process. In this case the error term in

yt = x0t + "t
is assumed to follow the AR(1) model

"t = "t 1 + ut; j j < 1;


where futg is a white noise process.

We assume in this section that is known. For this reason we may develop the relevant
theory under the assumptions FS1-FS3.
37

Derivation of GLS

As in the heteroscedastic case, to obtain the GLS estimator we need to …nd a full rank n n
matrix P such that

Py = PX + P"
y = X +"
and
0 0 0 0 0 2 0 2
E " " X = E P"" P X = P E "" X P = P P = I:
Thus, P is such that
P P0 = I , 1= P0P
We use this matrix P to obtain y = Py and X = PX:
38

The GLS estimator is the OLS estimator applied to the transformed model y = X +" ;
i.e.
1
^ GLS = X0 X X0 y :
It follows that
1
Var ^ GLS X = 2 X0 X

We may expressed ^ GLS and Var ^ GLS X as


1
^ GLS = X0 X X0 y
1
= X0P0PX X0P0Py;
1X 1 1 y; 1=
= X0 X0 Note: P0P:
and
1 1
Var ^ GLS X = 2 X0 X = 2 X0 1X :
39

Question: how to obtain 1?

In the case where the error term "t follows an AR(1) the matrix is given in example 0.4.1.
It can be proved (this is not straightforward) that
2 3
1 0 0 0
6 7
6 1+ 2 0 0 7
6 7
1=6
6 0 1+ 2 0 0 7
7:
6 ... ... ... ... ... 7
6 7
6 7
4 0 0 0 1+ 2 5
0 0 0 1+ 2
40

To obtain the transformed model assuming that "t follows an AR(1)


2 q 32 3 2 q 3 2 3
2 2 y~1
6 1 0 0 0 0 7 6 y1 7 6 y1 1 7 6 7
6 76 y 6 7 6 y ~2
6 1 0 0 0 76 2 7 7 6 y2 y1 7 6
7
7
6 76 y 7 6 7 6 y ~3 7
6 0 1 0 0 76 3 7=6 y3 y2 7
Py = 6 ... ... ... ... ... 76 7 6 ... 7=6
6 ... 7
7
6 76 7 6 7 6 7
6 76 7 6 7 6 7
6 0 0 0 1 0 74 y 5 6 y yn 2 7 ~n 1
4 y 5
4 5 n 1 4 n 1 5
0 0 0 1 yn yn yn 1 y~n
2 q 32 3
1 2 0 0 0 0 1 x12 x1K
6 76 7
6 76 1 x22 x2K 7
6 1 0 0 0 76 7
6 76 1 x x 7
6 0 1 0 0 76 32 3K 7
PX = 6 ... ... ... ... ... 7 6 .. .
. .
. 7
6 76 . . . 7
6 76 7
6 0 0 0 1 0 7 4 1 xn 1;2 x 5
4 5 n 1;K
0 0 0 1 1 xn2 xnK
2 q q q 3 2 3
6 1 2 x12 1 2 x1K 1 2
7
~01
x
6 7
6
6 1 x22 x12 x2K x1K 7
7 6 ~02
x 7
6 7 6 7
6 1 x32 x22 x3K x2K 7 6 ~03
x 7
= 6 ... ... ... 7=6 6 ... 7
7
6 7 6 7
6 7 6 7
6
4 1 xn 1;2 xn 2;2 xn 1;K xn 2;K 7 5 4 ~0n
x 1 5
1 xn2 xn 1;2 xnK xn 1;K ~0n
x
41

Let us write the transformed model in a scalar form:

~0t + ut
y~t = x
where
( q ( q
1 2y t=1 ; 1 2 x0 t= 1 ;
y~t = 1 ~0t =
x 1
yt yt 1 t > 1 (xt xt 1)0 t > 1
Without the …rst observation, the transformed model is
0
yt yt 1 = (xt xt 1) + ut ; t > 1:
42

Derivation of GLS: Another way

Here is another way to obtain the transformed model assuming that "t follows an AR(1),
"t = "t 1 + ut

yt = x0t + "t
= x0t + "t 1 + ut
= x0t + yt 1 x0t 1 + ut
yt y = x0t x0t + ut
| {z t 1} | {z
1
} |{z}
y~t white noise process.
~0t
x
The GLS estimator is the OLS estimator applied to the transformed model. So the GLS can
also be expressed as
0 1 1
n
X Xn
^ GLS = @ x
~t x 0
~t A x
~ty~t
t=1 t=1
1
which is the same as ^ GLS = X0 1X X0 1y
43

Example 0.4.7. AP IThe original model is

yt = 1 + 2xt2 + "t
"t = "t 1 + ut
We have

yt = 1 + 2xt2 + "t 1 + ut
= 1 + 2 xt2 + (yt 1 1 2 xt2 ) + ut

y y = 1 (1 )+ 2 xt2 xt 1;2 + ut
|t {z t 1} | {z } | {z }
y~t ~t1
x ~t2
x
that is, the transformed model is
" #
h i
yt yt 1 = 1 xt2 xt 1;2 1 +u
t
| {z } 2
0 | {z }
~0t=(xt
x xt 1)

or
y~t = 1x
~t1 + 2x
~t2 + ut:
44

0.4.6 Feasible GLS

If is unknown (which is always the case in empirical applications) we may replace it by a


consistent estimator ^: Let y~t = yt ^yt 1; x
~t = (xt ^xt 1) : The FGLS estimator is
0 1 1
n
X Xn
^ F GLS = @ x
~t x 0
~t A x
~ty~t
t=1 t=1
We may also use the Maximum Likelihood (ML) method. We’ll cover this method in Chap-
ter 3. Since the ML results are approximately the same as the FGLS, and since we’ll be
using Python’s ARMA command (based on the ML method) later on, we chose to use this
command in the following example.
45

Example 0.4.8 (continuation of the previous example). AP IEstimation using the Maxi-
mum Likelihood method FGLS (see 00_auto_ar1.py). We assume that "t = "t 1 + ut
(although other models may be more suitable in view of the example 0.4.4).
46

ARMA Model Results


==============================================================================
Dep. Variable: lchnimp No. Observations: 131
Model: ARMA(1, 0) Log Likelihood -110.953
Method: css-mle S.D. of innovations 0.564

=================================================================================
coef std err z P>|z| [0.025 0.975]
---------------------------------------------------------------------------------
const -38.9788 23.380 -1.667 0.095 -84.802 6.845
lchempi 2.8735 0.635 4.529 0.000 1.630 4.117
lgas 1.2002 1.004 1.195 0.232 -0.768 3.168
lrtwex 0.8469 0.453 1.871 0.061 -0.040 1.734
ar.L1.lchnimp 0.3066 0.086 3.555 0.000 0.138 0.476
Roots
=============================================================================
Real Imaginary Modulus Frequency
-----------------------------------------------------------------------------
AR.1 3.2619 +0.0000j 3.2619 0.0000
-----------------------------------------------------------------------------

Note: ^ = 0:3066
47

0.4.7 Dynamically Complete Models

If we are concerned only with the dynamic speci…cation of the model and with forecast we
may try to convert a model with autocorrelation into a Dynamically Complete Model.

Consider
~0t + ut
yt = x
such that E ( utj x
~t) = 0: This condition although guarantees consistency of b (if other
conditions are also met), does not preclude autocorrelation. You may try to increase the
number of regressors to xt and get a new regression model

yt = x0t + "t such that

E ( "tj xt; yt 1; xt 1; yt 2; :::) = 0:


Written in terms of yt

E ( ytj xt; yt 1; xt 1; yt 2; :::) = E ( ytj xt) :


48

De…nition 0.4.1. The model yt = x0t + "t is dynamically complete (DC) if

E ( "tj xt; yt 1; xt 1; yt 2; :::) = 0 or


E ( ytj xt; yt 1; xt 1; yt 2; :::) = E ( ytj xt)
holds.

If a model is DC then once xt has been controlled for, no lags of either y or x help to explain
current yt. This is a strong requirement and is implausible when the lagged dependent
variable has predictive power, which is often the case.
Theorem 0.4.1. If a model is DC then the errors are not correlated. Moreover fxt"tg is a
MDS.

Notice that E ( "tj xt; yt 1; xt 1; yt 2; :::) = 0 can be rewritten as

E ( "tj Ft) = 0 where


Ft = f"t 1; "t 2; :::; "1; xt; xt 1; :::; x1g :
49

Example 0.4.9. AP IConsider

yt = 1 + 2xt2 + ut; ut = ut 1 + "t


~0t =
where f"tg is a white noise process and E "tj xt2; yt 1; xt 1;2; yt 2; ::: = 0. Set x
1 xt2 : The above model is not DC since the errors are autocorrelated. Notice that

E ytj xt2; yt 1; xt 1;2; yt 2; ::: = 1 + 2xt2 + ut 1


does not coincide with

E ( yt j x
~t) = E ( ytj xt2) = 1 + 2xt2:

However, it is easy to obtain a DC model. Since

ut = yt ( 1 + 2xt2) )
ut 1 = yt 1 ( 1 + 2xt 1;2)
we have

yt = 1 + 2xt2 + ut
= 1 + 2 xt2 + ut 1 + "t
= 1 + 2 xt2 + yt 1 1 + 2 xt 1;2 + "t:
50

This equation can be written in the form

yt = 1 + 2xt2 + 3yt 1 + 4xt 1;2 + "t:


Let xt = xt2; yt 1; xt 1;2 : The previous equation is a DC model as

E ( ytj xt; yt 1; xt 1; :::) = E ( ytj xt) = 1 + 2xt2 + 3yt 1 + 4xt 1;2:


51

Example 0.4.10 (continuation ...). AP IDynamically Complete Model (see 00_auto_dynamic

OLS Regression Results


==============================================================================
Dep. Variable: lchnimp R-squared: 0.394
Model: OLS Adj. R-squared: 0.360
Method: Least Squares F-statistic: 11.35
Date: nan Prob (F-statistic): 5.04e-11
Time: nan Log-Likelihood: -104.82
No. Observations: 130 AIC: 225.6
Df Residuals: 122 BIC: 248.6
Df Model: 7
Covariance Type: nonrobust
===============================================================================
coef std err t P>|t| [0.025 0.975]
-------------------------------------------------------------------------------
const -11.3060 23.249 -0.486 0.628 -57.329 34.717
lchempi -7.1939 3.540 -2.032 0.044 -14.202 -0.186
lgas 1.3195 1.004 1.315 0.191 -0.668 3.307
lrtwex -0.5015 2.109 -0.238 0.812 -4.676 3.673
lchnimp(-1) 0.2707 0.084 3.219 0.002 0.104 0.437
lchempi(-1) 9.6187 3.603 2.670 0.009 2.486 16.751
lgas(-1) -1.2237 1.002 -1.221 0.224 -3.208 0.760
lrtwex(-1) 0.9357 2.089 0.448 0.655 -3.200 5.071
==============================================================================

Autocorrelation test - Breusch-Godfrey test (Question: Explain how the test was imple-
mented).

p-value : 0.6389
52

0.4.8 Misspeci…cation

In many cases the …nding of autocorrelation is an indication that the model is misspeci…ed.
If this is the case, the most natural route is not to change your estimator (from OLS to GLS)
but to change your model. Types of misspeci…cation may lead to a …nding of autocorrelation
in your OLS residuals:

dynamic misspeci…cation;

omitted variables (that are autocorrelated);

yt and/or xtk are integrated processes, e.g. yt I (1) :

functional form misspeci…cation.


53

Functional form misspeci…cation. Suppose that the true linear relationship is

yt = 1 + 2 log t + "t:
In the following …gure we estimate a misspeci…ed functional form: yt = 1 + 2t + "t : The
residuals are clearly autocorrelated

You might also like