Upload
others
View
2
Download
0
Embed Size (px)
Citation preview
Simply Linear Regression ModelThe least squares (LS) estimator
Applied Econometrics (QEM)The Simple Linear Regression Modelbased on Prinicples of Econometrics
Jakub Mućk
Department of Quantitative Economics
Jakub Mućk Applied Econometrics (QEM) Meeting #2 The Simple Linear Regression Model 1 / 25
Simply Linear Regression ModelThe least squares (LS) estimator Intuition
Outline
1 Simply Linear Regression ModelIntuition
2 The least squares (LS) estimatorAssumptions of the least squares estimatorsThe least squares estimatorsGauss-Markov TheoremAssessing the least squares fit
Jakub Mućk Applied Econometrics (QEM) Meeting #2 The Simple Linear Regression Model 2 / 25
Simply Linear Regression ModelThe least squares (LS) estimator Intuition
The starting point – conditional distribution of Y given X .
y
f(y|
x)
µy|a
f(y|x=a)
Jakub Mućk Applied Econometrics (QEM) Meeting #2 The Simple Linear Regression Model 3 / 25
Simply Linear Regression ModelThe least squares (LS) estimator Intuition
The starting point – conditional distribution of Y given X .
y
f(y|
x)
µy|a µy|b
f(y|x=a) f(y|x=b)
Jakub Mućk Applied Econometrics (QEM) Meeting #2 The Simple Linear Regression Model 3 / 25
Simply Linear Regression ModelThe least squares (LS) estimator Intuition
x
E(y
|x)
∆x
∆E(y|x)
β1=∆E(y|x)
∆x
Simply Regression:
E (y|x) = β0 +β1x
Jakub Mućk Applied Econometrics (QEM) Meeting #2 The Simple Linear Regression Model 4 / 25
Simply Linear Regression ModelThe least squares (LS) estimator Intuition
x
E(y
|x)
∆x
∆E(y|x)
β1=∆E(y|x)
∆xβ1
Simply Regression:
E (y|x) = β0 +β1x
Jakub Mućk Applied Econometrics (QEM) Meeting #2 The Simple Linear Regression Model 4 / 25
Simply Linear Regression ModelThe least squares (LS) estimator Intuition
Simply Linear Regression Model
Simply Linear Regression Model :
y = β0 + β1x + ε (1)
wherey is the (outcome) dependent variable;x is independent variable;ε is the error term.
The dependent variable is explained with the components that varywith the the dependent variable and the error term.β0 is the intercept.β1 is the coefficient (slope) on x.
β1 measures the effect of change in x upon the expected value of y(ceteris paribus).
Jakub Mućk Applied Econometrics (QEM) Meeting #2 The Simple Linear Regression Model 5 / 25
Simply Linear Regression ModelThe least squares (LS) estimator Intuition
Simply Linear Regression Model
Simply Linear Regression Model :
y = β0 + β1x + ε (1)
wherey is the (outcome) dependent variable;x is independent variable;ε is the error term.
The dependent variable is explained with the components that varywith the the dependent variable and the error term.β0 is the intercept.β1 is the coefficient (slope) on x.
β1 measures the effect of change in x upon the expected value of y(ceteris paribus).
Jakub Mućk Applied Econometrics (QEM) Meeting #2 The Simple Linear Regression Model 5 / 25
Simply Linear Regression ModelThe least squares (LS) estimator
Assumptions of the least squares estimatorsThe least squares estimatorsGauss-Markov TheoremAssessing the least squares fit
Outline
1 Simply Linear Regression ModelIntuition
2 The least squares (LS) estimatorAssumptions of the least squares estimatorsThe least squares estimatorsGauss-Markov TheoremAssessing the least squares fit
Jakub Mućk Applied Econometrics (QEM) Meeting #2 The Simple Linear Regression Model 6 / 25
Simply Linear Regression ModelThe least squares (LS) estimator
Assumptions of the least squares estimatorsThe least squares estimatorsGauss-Markov TheoremAssessing the least squares fit
How to estimate the slope and intercept?
1.0 1.5 2.0 2.5 3.0 3.5
2.0
2.5
3.0
3.5
4.0
4.5
5.0
x (independent variable)
y (d
epen
dent
var
iabl
e)
Jakub Mućk Applied Econometrics (QEM) Meeting #2 The Simple Linear Regression Model 7 / 25
Simply Linear Regression ModelThe least squares (LS) estimator
Assumptions of the least squares estimatorsThe least squares estimatorsGauss-Markov TheoremAssessing the least squares fit
How to estimate the slope and intercept?
1.0 1.5 2.0 2.5 3.0 3.5
2.0
2.5
3.0
3.5
4.0
4.5
5.0
x (independent variable)
y (d
epen
dent
var
iabl
e)
Jakub Mućk Applied Econometrics (QEM) Meeting #2 The Simple Linear Regression Model 7 / 25
Simply Linear Regression ModelThe least squares (LS) estimator
Assumptions of the least squares estimatorsThe least squares estimatorsGauss-Markov TheoremAssessing the least squares fit
Assumptions of the least squares estimators I
Assumption #1: true DGP (data generating process):
y = β0 + β1x + ε. (2)
Assumption #2: the expected value of the error term is zero:
E (ε) = 0, (3)
and this implies that E (y) = β0 + β1x.Assumption #3 the variance of the error term equals σ:
var (ε) = σ2 = var (y) . (4)
Assumption #4: the covariance between any pair of εi and εj is zero
cov (εi , εj) = 0, (5)
and this implies that cov (yi , yj).Jakub Mućk Applied Econometrics (QEM) Meeting #2 The Simple Linear Regression Model 8 / 25
Simply Linear Regression ModelThe least squares (LS) estimator
Assumptions of the least squares estimatorsThe least squares estimatorsGauss-Markov TheoremAssessing the least squares fit
Assumptions of the least squares estimators II
Assumption #5: Exogeneity. The independent variable is not ran-dom and it takes at least two values.Assumption #6 (optional): the normally distributed error term:
ε ∼ N(0, σ2) . (6)
Jakub Mućk Applied Econometrics (QEM) Meeting #2 The Simple Linear Regression Model 9 / 25
Simply Linear Regression ModelThe least squares (LS) estimator
Assumptions of the least squares estimatorsThe least squares estimatorsGauss-Markov TheoremAssessing the least squares fit
Fitted values and residuals
The fitted values of dependent variable (yi):
yi = β0 + β1xi (7)
where β0 and β1 are estimates of intercept and slope, respectively.The residuals (ei) :
ei = yi − yi = yi − β0 − β1xi , (8)
are residuals between observed (empirical) and fitted values of depen-dent variable.
Jakub Mućk Applied Econometrics (QEM) Meeting #2 The Simple Linear Regression Model 10 / 25
Simply Linear Regression ModelThe least squares (LS) estimator
Assumptions of the least squares estimatorsThe least squares estimatorsGauss-Markov TheoremAssessing the least squares fit
Assumptions of the least squares estimators
The sum of squared residuals (SSE):
SSE =N∑i
e2i =
N∑i
(yi − yi)2. (9)
The SSE can be expressed as function of the parameters β0 and β1:
SSE (β0, β1) =N∑i
e2i =
N∑i
(yi − β0 − β1xi
)2. (10)
The least squares principle is a method of the parameter selectionthat provides the lowest SSE :
minβ0,β1
N∑i
(yi − β0 − β1xi
)2. (11)
In other words, the least squares principle minimizes the SSE.Jakub Mućk Applied Econometrics (QEM) Meeting #2 The Simple Linear Regression Model 11 / 25
Simply Linear Regression ModelThe least squares (LS) estimator
Assumptions of the least squares estimatorsThe least squares estimatorsGauss-Markov TheoremAssessing the least squares fit
The least squares estimator
1.0 1.5 2.0 2.5 3.0 3.5
2.0
2.5
3.0
3.5
4.0
4.5
5.0
x (independent variable)
y (d
epen
dent
var
iabl
e)
Jakub Mućk Applied Econometrics (QEM) Meeting #2 The Simple Linear Regression Model 12 / 25
Simply Linear Regression ModelThe least squares (LS) estimator
Assumptions of the least squares estimatorsThe least squares estimatorsGauss-Markov TheoremAssessing the least squares fit
The least squares estimator
1.0 1.5 2.0 2.5 3.0 3.5
2.0
2.5
3.0
3.5
4.0
4.5
5.0
x (independent variable)
y (d
epen
dent
var
iabl
e)
The LS estimators minimizes the sum of squared residuals (SSE).Jakub Mućk Applied Econometrics (QEM) Meeting #2 The Simple Linear Regression Model 12 / 25
Simply Linear Regression ModelThe least squares (LS) estimator
Assumptions of the least squares estimatorsThe least squares estimatorsGauss-Markov TheoremAssessing the least squares fit
The least squares estimators
The least squares estimator for the simple regression model:
βLS0 = y − βLS
1 x, (12)
βLS1 =
∑Ni (xi − x) (yi − y)∑N
i (xi − x)2 . (13)
where y and x are the sample averages of dependent and independentvariables, respectively.
Jakub Mućk Applied Econometrics (QEM) Meeting #2 The Simple Linear Regression Model 13 / 25
Simply Linear Regression ModelThe least squares (LS) estimator
Assumptions of the least squares estimatorsThe least squares estimatorsGauss-Markov TheoremAssessing the least squares fit
Gauss-Markov Theorem
Gauss-Markov TheoremUnder the assumptions A#1-A#5 of the simple linear regressionmodel, the least squares estimators βLS
0 and βLS1 have the smallest
variance of all linear and unbiased estimators of β0 and β1.
βLS0 and βLS
1 are the Best Linear Unbiased Estimators (BLUE) of β0and β1.
Jakub Mućk Applied Econometrics (QEM) Meeting #2 The Simple Linear Regression Model 14 / 25
Simply Linear Regression ModelThe least squares (LS) estimator
Assumptions of the least squares estimatorsThe least squares estimatorsGauss-Markov TheoremAssessing the least squares fit
Remarks on the Gauss-Markov Theorem I
1 The estimators βLS0 and βLS
1 are best when compared to linear andunbiased estimators.Based on the Gauss-Markov theorem we cannot claim that the estima-tors βLS
0 and βLS1 are the best of all possible estimators.
2 Why the estimators βLS0 and βLS
1 are best?Because they have the minimum variance.
3 The Gauss-Markov theorem holds if assumptions A#1-A#5 are satis-fied.If not, then βLS
0 and βLS1 are not BLUE.
4 The Gauss-Markov theorem does not require the assumption of nor-mality (A#6)
Jakub Mućk Applied Econometrics (QEM) Meeting #2 The Simple Linear Regression Model 15 / 25
Simply Linear Regression ModelThe least squares (LS) estimator
Assumptions of the least squares estimatorsThe least squares estimatorsGauss-Markov TheoremAssessing the least squares fit
Linearity of estimator
The least squares estimator of β1:
βLS2 =
∑Ni (xi − x) (yi − y)∑N
i (xi − x)2 (14)
can be rewritten as:
βLS2 =
N∑i=1
wiyi , (15)
where wi = (xi − x) /∑
(xi − x)2 .After manipulation we get:
βLS2 = β2 +
N∑i=1
wiεi . (16)
Since the wi are known this is linear function of random variable (ε).
Jakub Mućk Applied Econometrics (QEM) Meeting #2 The Simple Linear Regression Model 16 / 25
Simply Linear Regression ModelThe least squares (LS) estimator
Assumptions of the least squares estimatorsThe least squares estimatorsGauss-Markov TheoremAssessing the least squares fit
Unbiasedness
The estimator is unbiased if its expected value equals the true value,i.e.,
E(β)
= β. (17)
For the least squares estimator:
E(βLS
2
)= E
(β2 +
N∑i=1
wiεi
)= E (β2) + E
( N∑i=1
wiεi
)
= β2 +N∑
i=1wiE (εi) = β2.
In the above manipulation, we take the advantage of two assumption:(i) E(εi) = 0, and (ii) E(wiεi) = wiE(εi). The latter assumption isequivalent the exogeneity of the independent variable.The unbiasedness is mostly about the average of our estimates frommany samples (drawn form the same population).
Jakub Mućk Applied Econometrics (QEM) Meeting #2 The Simple Linear Regression Model 17 / 25
Simply Linear Regression ModelThe least squares (LS) estimator
Assumptions of the least squares estimatorsThe least squares estimatorsGauss-Markov TheoremAssessing the least squares fit
Example: unbiased estimator
0 1 2 3 4
0.05
0.10
0.15
0.20
0.25
0.30
0.35
0.40
θ
f(θ)
θ = θ
Jakub Mućk Applied Econometrics (QEM) Meeting #2 The Simple Linear Regression Model 18 / 25
Simply Linear Regression ModelThe least squares (LS) estimator
Assumptions of the least squares estimatorsThe least squares estimatorsGauss-Markov TheoremAssessing the least squares fit
Example: biased estimator
−1 0 1 2 3
0.05
0.10
0.15
0.20
0.25
0.30
0.35
0.40
θ
f(θ)
θ
θ
Jakub Mućk Applied Econometrics (QEM) Meeting #2 The Simple Linear Regression Model 19 / 25
Simply Linear Regression ModelThe least squares (LS) estimator
Assumptions of the least squares estimatorsThe least squares estimatorsGauss-Markov TheoremAssessing the least squares fit
The variance and covariance of the LS estimators I
In general, variance measures efficiency.If the assumption A#1-A#5 are satisfied then:
var(βLS
0
)= σ2
[ ∑Ni=1 x2
i
N∑N
i=1 (xi − x)2
]
var(βLS
1
)= σ2∑N
i=1 (xi − x)2
cov(βLS
0 , βLS1
)= σ2
[−x
(xi − x)2
]
The greater the variance of the error term (σ2), i.e., the larger role ofthe error term, the larger variance and covariance of estimates.The larger variability of the dependent variable
∑Ni=1 (xi − x)2, the
smaller variance of the least squares estimators.
Jakub Mućk Applied Econometrics (QEM) Meeting #2 The Simple Linear Regression Model 20 / 25
Simply Linear Regression ModelThe least squares (LS) estimator
Assumptions of the least squares estimatorsThe least squares estimatorsGauss-Markov TheoremAssessing the least squares fit
The variance and covariance of the LS estimators II
The larger sample size (N ) the smaller variance of the least squaresestimators.The larger
∑Ni=1 the greater variance of the intercept estimator
The covariance of estimator has a sign opposite to that of x and if x islarger then the covriance is greater.
Jakub Mućk Applied Econometrics (QEM) Meeting #2 The Simple Linear Regression Model 21 / 25
Simply Linear Regression ModelThe least squares (LS) estimator
Assumptions of the least squares estimatorsThe least squares estimatorsGauss-Markov TheoremAssessing the least squares fit
Example: efficiency
0 1 2 3 4
0.05
0.10
0.15
0.20
0.25
0.30
0.35
0.40
θ
f(θ)
θA
= θ
θB
= θ
Jakub Mućk Applied Econometrics (QEM) Meeting #2 The Simple Linear Regression Model 22 / 25
Simply Linear Regression ModelThe least squares (LS) estimator
Assumptions of the least squares estimatorsThe least squares estimatorsGauss-Markov TheoremAssessing the least squares fit
The probability distribution of the least squares estimators
If the assumption of normality is satisfied then:
βLS0 ∼ N
(βLS
0 , var(βLS0 ))
(18)
βLS1 ∼ N
(βLS
1 , var(βLS1 ))
(19)
What if the assumption of normality does not hold?If assumptions A#1-A#5 are satisfied and if the sample (N ) is suffi-ciently large, the least squares estimators, i.e., βLS
0 and βLS1 , have dis-
tribution that approximates the normal distributions described above.
Jakub Mućk Applied Econometrics (QEM) Meeting #2 The Simple Linear Regression Model 23 / 25
Simply Linear Regression ModelThe least squares (LS) estimator
Assumptions of the least squares estimatorsThe least squares estimatorsGauss-Markov TheoremAssessing the least squares fit
Estimating the variance of the error term
The variance of the error term:
var(εi) = σ2 = E [εi − E(εi)]2 = E(εi)2 (20)
since we have assumed that E(εi) = 0.The estimates of the error term variance based on the residuals:
σ2 = 1N − 2
N∑i=1
e2i . (21)
where ei = y − yi .The σ2 can be directly used to estimates the variance/covariance of theleast squares estimator.
Jakub Mućk Applied Econometrics (QEM) Meeting #2 The Simple Linear Regression Model 24 / 25
Simply Linear Regression ModelThe least squares (LS) estimator
Assumptions of the least squares estimatorsThe least squares estimatorsGauss-Markov TheoremAssessing the least squares fit
Estimating the variance of the least squares estimators
To obtain estimates of the var(βLS0 ) and var(βLS
1 ) the estimated vari-ance of the error term is used (σ2):
ˆvar(βLS
0
)= σ2
[ ∑Ni=1 x2
i
N∑N
i=1 (xi − x)2
]
ˆvar(βLS
1
)= σ2∑N
i=1 (xi − x)2
ˆcov(βLS
0 , βLS1
)= σ2
[−x
(xi − x)2
]
Based on the variance we can calculate the standard errors are simplythe standard deviation of the estimators:
se(βLS
0
)=√
ˆvar(βLS
0
)and se
(βLS
1
)=√
ˆvar(βLS
1
). (22)
Jakub Mućk Applied Econometrics (QEM) Meeting #2 The Simple Linear Regression Model 25 / 25