Day 24 Supervised Learning - REgression Analysis - 2
Day 24 Supervised Learning - REgression Analysis - 2
1 O C TO B E R 2024
Least Squares Estimators of 𝛽0 , 𝛽1
◦ Let 𝑌𝑖 , 𝑥𝑖 ∶ 𝑖 = 1, 2, … , 𝑛 be the data.
◦ Want to find 𝛽0 , 𝛽1 by minimizing the squared error between values of 𝑌𝑖 and its
estimator 𝛽0 + 𝛽1 𝑥𝑖
0 and 𝛽
◦ Let us denote estimated value of 𝛽0 , 𝛽1 as 𝛽 1 respectively
◦ Want find 𝛽0 and 𝛽1 that would minimize sum of squares of deviations from the
observations from the regression line:
𝜕𝑆𝑆
= −2 σ𝑛𝑖=1 𝑥𝑖 𝑦𝑖 − 𝛽0 − 𝛽1 𝑥𝑖 = 0
𝜕𝛽1
𝑛𝛽0 + 𝛽1 𝑥𝑖 = 𝑦𝑖
𝑛
𝑖=1
𝑛
𝑖=1
𝑛 Least Squares Normal
𝛽0 𝑥𝑖 + 𝛽1 𝑥𝑖2 = 𝑦𝑖 𝑥𝑖 Equations
𝑖=1 𝑖=1 𝑖=1
Further simplification we will get
0 = 𝑦ഥ − 𝛽
𝛽 1 𝑥ҧ
σ𝑛𝑖=1 𝑥𝑖 𝑦𝑖 − 𝑛𝑥ҧ 𝑦ത σ 𝑥𝑖 − 𝑥ҧ 𝑦𝑖
𝛽1 = 𝑛 = 𝑛
2
σ𝑖=1 𝑥𝑖 − 𝑛𝑥ҧ 2 σ𝑖=1 𝑥𝑖2 − 𝑛𝑥ҧ 2
2
Sum of Squares of residuals = 𝑆𝑆𝐸 = σ𝑛𝑖=1 𝑒𝑖2 = σ𝑛𝑖=1 𝑌𝑖 − 𝑌𝑖
2
σ𝑛
𝑖=1 𝑥𝑖
𝑆𝑥𝑥 = σ𝑛𝑖=1 𝑥𝑖 − 𝑥ҧ 2
= σ𝑛𝑖=1 𝑥𝑖2 −
𝑛
𝑛 𝑛
σ𝑛𝑖=1 𝑥𝑖 σ𝑛𝑖=1 𝑌𝑖
𝑆𝑥𝑦 = 𝑥𝑖 − 𝑥ҧ 𝑌𝑖 − 𝑌ത = 𝑥𝑖 𝑌𝑖 −
𝑛
𝑖=1 𝑖=1
𝑛 2
σ 𝑖=1 𝑌𝑖 − 𝑖
𝑌
𝜎ො 2 =
𝑛−2
σ 𝑥𝑖 − 𝑥ҧ 𝐸(𝑌𝑖 ) 𝜎2
1 =
𝐸 𝛽 1 =
= 𝛽1 𝑎𝑛𝑑 𝑉𝑎𝑟 𝛽
2
σ 𝑥𝑖 − 𝑛𝑥ҧ 2 𝑆𝑥𝑥
𝑛
2
𝐸(𝑌𝑖 ) 1 𝑥ҧ
0 =
𝐸 𝛽 − 𝑥𝐸 0 = 𝜎 2 +
ҧ 𝐵 = 𝛽0 𝑎𝑛𝑑 𝑉𝑎𝑟 𝛽
𝑛 𝑛 𝑆𝑥𝑥
𝑖=1
1 October 2024 MM 225 : AI AND DATA SCIENCE 6
Properties of LS Estimators
A is an unbiased estimator of β0
B is an unbiased estimator of β1
𝜎2 𝑥ҧ
It can be shown that Cov(A, B) = −
𝑆𝑥𝑥
1 𝑥ҧ 2
0 =
𝑆𝐸 𝛽 𝜎2 +
𝑛 𝑆𝑥𝑥
𝜎2
1 =
𝑆𝐸 𝛽
𝑆𝑥𝑥
0 and 𝛽
Estimated std error for 𝛽 1 can be obtained by replacing 𝜎 2 by its unbiased estimate 𝜎ො 2
1 ~𝑁 𝜎2
Hence 𝛽 𝛽1 ,
𝑆𝑥𝑥
0 ~𝑁 1 𝑥ҧ 2
Similarly 𝛽 𝛽0 , 𝜎 2 +
𝑛 𝑆𝑥𝑥
𝜎2
(𝑛−2)ෝ
And ~𝜒 2
𝑛−2
𝜎2
1 − 𝛽1,0
𝛽
𝑇=
𝜎ො 2
𝑆𝑥𝑥
Hence when 𝐻0 is true: T~𝑡(𝑛 − 2)
0 − 𝛽0,0
𝛽
𝑇=
1 𝑥ҧ 2
𝜎ො 2 +
𝑛 𝑆𝑥𝑥
Hence when 𝐻0 is true: T~𝑡(𝑛 − 2)
1 𝑥𝑛+1 − 𝑥ҧ 2
𝑉𝑎𝑟 𝑌𝑛+1 = 𝛽መ0 + 𝛽መ1 𝑥𝑛+1 = 𝜎 2
+
𝑛 𝑆𝑥𝑥
𝑉𝑎𝑟 𝑌𝑛+1 = 𝜎 2
Also note that 𝑌𝑛+1 refers to the future observation while 𝑌𝑛+1 is estimated from the model
developed. Hence, 𝑌𝑛+1 and 𝑌𝑛+1 are independent.
1 𝑥𝑛+1 −𝑥ҧ 2
Therefore: 𝑉𝑎𝑟 𝑒𝑝 = 𝜎2 1+ +
𝑛 𝑆𝑥𝑥
1 𝑥ҧ − 𝑥𝑛+1 2
𝑦ො𝑛+1 − 𝑡𝑛−2,𝛼ൗ 𝜎ො 2 1+ + ≤ 𝑌𝑛+1
2 𝑛 𝑆𝑥𝑥
1 𝑥ҧ − 𝑥𝑛+1 2
≤ 𝑦ො𝑛+1 + 𝑡𝑛−2,𝛼ൗ 𝜎ො 2 1+ +
2 𝑛 𝑆𝑥𝑥
value of 𝛽0 +𝛽1 𝑥0
◦ However, if only one experiment is carried out Y will be only one response….Present case
relates to this possibility