Lecture 3
Lecture 3
go to board
30
Response/Output
25
20
15
10
1 2 3 4 5 6 7 8 9 10 11
Predictor/Input
30
Response/Output
25
20
15
10
1 2 3 4 5 6 7 8 9 10 11
Predictor/Input
30
Response/Output
25
20
15
10
1 2 3 4 5 6 7 8 9 10 11
Predictor/Input
β1
.. = ..
. . β0
Yn Xn 1
35
30
Response/Output
25
20
15
10
1 2 3 4 5 6 7 8 9 10 11
Predictor/Input
ei = Yi − Ŷi
• The sum of the residuals is zero:
ei = (Yi − b0 − b1 Xi )
i
= Yi − nb0 − b1 Xi
= 0 By first normal equation.
1
n
Ȳ = n i=1 Yi
θ̂ = f ({Y1 , . . . , Yn })
• Unknown quantity / parameter
θ
• Definition: Bias of estimator
B(θ̂) = E(θ̂) − θ
0.4
0.3
0.2
0.1
0
0 1 2 3 4 5 6 7 8 9 10
run bias_example_plot.m
Frank Wood, [email protected] Linear Regression Models Lecture 3, Slide 20
Distribution of Estimator
• If the estimator is a function of the samples
and the distribution of the samples is known
then the distribution of the estimator can
(often) be determined
– Methods
• Distribution (CDF) functions
• Transformations
• Moment generating functions
• Jacobians (change of variable)
Yi ∼ Normal(µ, σ 2 )
1
n
θ = µ, θ̂ = Ȳ = n i=1 Yi
B(θ̂) = E(θ̂) − θ = 0
• Remember:
V (cY ) = c2 V (Y )
n n
V ( i=1 Yi ) = i=1 V (Yi )
Only if the Yi are independent with finite variance
• Note assumptions
0.8
0.7
0.6
0.5
0.4
0.3
0.2
0.1
0
2.5 3 3.5 4 4.5 5 5.5 6 6.5 7 7.5
1000 samples
Frank Wood, [email protected] Linear Regression Models Lecture 3, Slide 26
Bias Variance Trade-off
• The mean squared error of an estimator
• Can be re-expressed
E(M SE) = σ 2
• Examples
– θ ~ Poisson(λ)
– z ~ G(θ)
n
L({Xi }ni=1 , Θ) = i=1 F (Xi ; Θ)
0.1
0.08
0.06
0.04
0.02
0
0 2 4 6 8 10 12 14 16 18 20
0.1
0.08
0.06
0.04
0.02
0
0 2 4 6 8 10 12 14 16 18 20
0.1
0.08
0.06
0.04
0.02
0
0 5 10 15 20 25
i=1
(2πσ
1 n
− 21
(Yi −β0 −β1 Xi )2
= e 2σ i=1
(2πσ 2 )n/2