Professional Documents
Culture Documents
wk02 - GLS - Hand Written Notes 100822
wk02 - GLS - Hand Written Notes 100822
Yiran Xie
Yiran Xie (School of Economics, University of Sydney) Linear Models: OLS August 10, 2022 1 / 22
Table of contents
1. Review
Yiran Xie (School of Economics, University of Sydney) Linear Models: OLS August 10, 2022 2 / 22
Review
Review
Linear Model:
y = Xβ + u
! $ ! ′$ ! $
y1 x1 u1
" % " % " %
where y = # ... &, X = # ... &, and u = # ... &.
(N×1) (N×K ) (N×1)
yN xN′ uN
The OLS estimator:
β̂OLS = (X ′ X )−1 X ′ y .
which minimizes the sum of squared errors
N
' N
'
Q(β) = ui2 = (yi − xi′ β)2
i=1 i=1
Yiran Xie (School of Economics, University of Sydney) Linear Models: OLS August 10, 2022 3 / 22
Review
Proof.
Need to show X ′ X is invertible
⇔ if (X ′ X )y = 0 then y = 0
We can show Xy = 0 because (Xy )′ (Xy ) = y ′ (X ′ X )y = 0.
Given that X is full rank, y must be 0.
Yiran Xie (School of Economics, University of Sydney) Linear Models: OLS August 10, 2022 4 / 22
Review
Essential result:
Finite sample properties: If u ∼ N [0, Ω] then
OLS Consistency:
plim β̂ = β
Yiran Xie (School of Economics, University of Sydney) Linear Models: OLS August 10, 2022 5 / 22
Review
Topics Today
Yiran Xie (School of Economics, University of Sydney) Linear Models: OLS August 10, 2022 7 / 22
Distribution of OLS Estimator
p
β̂ has limit distribution with all mass at β (since β̂ → β)
√
To get a nondegenerate distribution, inflate β̂ by N.
leads to a random variable that has nonzero yet finite variance asymptotically
Yiran Xie (School of Economics, University of Sydney) Linear Models: OLS August 10, 2022 8 / 22
Distribution of OLS Estimator
p
β̂ has limit distribution with all mass at β (since β̂ → β)
√
To get a nondegenerate distribution, inflate β̂ by N.
leads to a random variable that has nonzero yet finite variance asymptotically
Then instead of
β̂OLS − β = (X ′ X )−1 X ′ u,
we focus on √
N(β̂OLS − β) = (N −1 X ′ X )−1 N −1/2 X ′ u,
Yiran Xie (School of Economics, University of Sydney) Linear Models: OLS August 10, 2022 8 / 22
Distribution of OLS Estimator
Yiran Xie (School of Economics, University of Sydney) Linear Models: OLS August 10, 2022 9 / 22
Distribution of OLS Estimator
2
By LLN: plim N1 xi xi′ exists and we assume it is finite and invertible
2 d
By CLT: √1N xi ui → N [0, B] for some B.
Yiran Xie (School of Economics, University of Sydney) Linear Models: OLS August 10, 2022 9 / 22
Distribution of OLS Estimator
2
By LLN: plim N1 xi xi′ exists and we assume it is finite and invertible
2 d
By CLT: √1N xi ui → N [0, B] for some B.
/ 0−1
√ d 1 '
⇒ N(β̂ − β) → plim xi xi′ × N [0, B]
N
3 / ' 0−1 / ' 0−1 4
d 1 ′ 1 ′
→ N 0, plim xi xi × B × plim xi xi
N N
p d p
(If HN → H and bN → N [µ, Ω] then HN bN → N [Hµ, HΩH ′ ])
Yiran Xie (School of Economics, University of Sydney) Linear Models: OLS August 10, 2022 9 / 22
Distribution of OLS Estimator
Question: What is B?
2 d
(Recall that √1N xi ui → N [0, B] for some B)
Yiran Xie (School of Economics, University of Sydney) Linear Models: OLS August 10, 2022 10 / 22
Distribution of OLS Estimator
Question: What is B?
2 d
(Recall that √1N xi ui → N [0, B] for some B)
2
B is the variance-covariance matrix of √1N xi ui in the limit
5 2 6 5 2 6 ′ 2 2
B = plim √1N i xi ui √1
N i x i ui = plim N1 i j ui uj xi xj′
Yiran Xie (School of Economics, University of Sydney) Linear Models: OLS August 10, 2022 10 / 22
Distribution of OLS Estimator
Yiran Xie (School of Economics, University of Sydney) Linear Models: OLS August 10, 2022 11 / 22
Distribution of OLS Estimator
Yiran Xie (School of Economics, University of Sydney) Linear Models: OLS August 10, 2022 11 / 22
Distribution of OLS Estimator
Yiran Xie (School of Economics, University of Sydney) Linear Models: OLS August 10, 2022 11 / 22
Distribution of OLS Estimator
Yiran Xie (School of Economics, University of Sydney) Linear Models: OLS August 10, 2022 12 / 22
Distribution of OLS Estimator
We can use
, -
1 ' 1 ' 2
B̂ = s 2 xi xi′ , where s 2 = ûi .
N N −K
i i
Then
, -−1
5' 6−1 5' 6−1 '
V̂Default [β̂] = xi xi′ × N B̂ × xi xi′ =s 2
xi xi′ .
i
Yiran Xie (School of Economics, University of Sydney) Linear Models: OLS August 10, 2022 12 / 22
Distribution of OLS Estimator
Yiran Xie (School of Economics, University of Sydney) Linear Models: OLS August 10, 2022 13 / 22
Distribution of OLS Estimator
1 ' 2 ′
B̂ = ûi xi xi , where ûi = yi − xi′ β̂
N
i
.
Yields the heteroskedastic-consistent estimate of the
variance-covariance matrix of the OLS estimator (VCE)
5' 6−1 ' 5' 6−1
V̂robust [β̂] = xi xi′ ûi2 xi xi′ xi xi′
Yiran Xie (School of Economics, University of Sydney) Linear Models: OLS August 10, 2022 13 / 22
Distribution of OLS Estimator
Yiran Xie (School of Economics, University of Sydney) Linear Models: OLS August 10, 2022 14 / 22
Distribution of OLS Estimator
Yiran Xie (School of Economics, University of Sydney) Linear Models: OLS August 10, 2022 14 / 22
Distribution of OLS Estimator
' 7 8 7 8 7 8 7 8 7 8
1 1 2 1 2 2 1 3 2 1 4 1 6 17
ûi2 xi xi′ = 0.5 2
+0 +1 + 0.5 =
1 1 2 4 3 9 4 16 4 17 53
7 8
1 57 −31
⇒ V̂robust [β̂] =
32 −31 22
Yiran Xie (School of Economics, University of Sydney) Linear Models: OLS August 10, 2022 15 / 22
GLS: Generalized Least Squares
OLS is efficient (best linear unbiased estimator) if errors are i.i.d. so that
V [u|X ] = σ 2 I .
In practice errors are rarely i.i.d.
So we usually do OLS and obtain robust VCE that permits V [u|X ] ∕= σ 2 I
Yiran Xie (School of Economics, University of Sydney) Linear Models: OLS August 10, 2022 16 / 22
GLS: Generalized Least Squares
OLS is efficient (best linear unbiased estimator) if errors are i.i.d. so that
V [u|X ] = σ 2 I .
In practice errors are rarely i.i.d.
So we usually do OLS and obtain robust VCE that permits V [u|X ] ∕= σ 2 I
More efficient feasible GLS (FGLS) assumes a model for V [u|X ]
yields more precise estimates (smaller standard errors and bigger t-statistics)
but then obtain robust VCE that allows for misspecified model for V [u|X ]
Yiran Xie (School of Economics, University of Sydney) Linear Models: OLS August 10, 2022 16 / 22
GLS: Generalized Least Squares
Main idea: transform the original linear model with heteroskedastic errors to
a standard linear model with homoskedastic errors
Yiran Xie (School of Economics, University of Sydney) Linear Models: OLS August 10, 2022 17 / 22
GLS: Generalized Least Squares
Derivation:
Premultiply y = X β + u by Ω−1/2 so
Yiran Xie (School of Economics, University of Sydney) Linear Models: OLS August 10, 2022 18 / 22
GLS: Generalized Least Squares
Derivation:
Premultiply y = X β + u by Ω−1/2 so
Yiran Xie (School of Economics, University of Sydney) Linear Models: OLS August 10, 2022 19 / 22
GLS: Generalized Least Squares
Yiran Xie (School of Economics, University of Sydney) Linear Models: OLS August 10, 2022 20 / 22
GLS: Generalized Least Squares
and then
a
β̂GLS ∼ N [β, (X Ω̂−1 X )−1 ]
Example: V [ui2 |xi ] = exp(zi′ γ)
We will discuss this in detail in Week 4.
Yiran Xie (School of Economics, University of Sydney) Linear Models: OLS August 10, 2022 21 / 22
Simulations: OLS Consistency and Asymptotic Normality
Stata Simulation:
D.g.p.: yi = b1 + b2 xi + ui where xi ∼ χ2 (1) and β1 = 1, β2 = 2.
Error: ui ∼ χ2 (1) − 1 is skewed with mean 0 and variance 2.
Yiran Xie (School of Economics, University of Sydney) Linear Models: OLS August 10, 2022 22 / 22