1regression Sol
1regression Sol
Regression
Solution:
∑( )2
Actual Weight − Estimated Weight
𝑅𝑅 2 = 1 −
∑(Actual Weight − Mean Weight)2
Observe that the denominator is the same for both models A and B.
Since MSE of model A is less than model B, the numerator will be smaller under model A than model B.
Therefore, R2 of model A is larger than that of model B.
Solution:
𝑅𝑅𝑅𝑅𝑅𝑅 = 57.48 − 𝛽𝛽0 − 1.52𝛽𝛽1 2 + 56.57 − 𝛽𝛽0 − 1.60𝛽𝛽1 2 + ⋯ + 70.19 − 𝛽𝛽0 − 1.80𝛽𝛽1 2
𝑑𝑑 𝑅𝑅𝑅𝑅𝑅𝑅
= 10𝛽𝛽0 + 16.7𝛽𝛽1 − 630.9 = 0 ⇒ 𝛽𝛽0 = 63.09 − 1.67𝛽𝛽1
𝑑𝑑𝛽𝛽0
𝑑𝑑 𝑅𝑅𝑅𝑅𝑅𝑅
= 27.9906𝛽𝛽1 + 16.7𝛽𝛽0 − 1058.4268 = 27.9906𝛽𝛽1 + 16.7 63.09 − 1.67𝛽𝛽1 − 1058.4268 = 0
𝑑𝑑𝛽𝛽1
1058.4268 − 16.7 × 63.09
⇒ 𝛽𝛽1 = = 47.4783
27.9906 − 16.7 × 1.67
𝑑𝑑 2 𝑅𝑅𝑅𝑅𝑅𝑅 𝑑𝑑 𝑑𝑑 𝑑𝑑 𝑅𝑅𝑅𝑅𝑅𝑅 𝑑𝑑
= 10𝛽𝛽0 + 16.7𝛽𝛽1 − 630.9 = 10 = 10𝛽𝛽0 + 16.7𝛽𝛽1 − 630.9 = 16.7
𝑑𝑑𝛽𝛽02 𝑑𝑑𝛽𝛽0 𝑑𝑑𝛽𝛽1 𝑑𝑑𝛽𝛽0 𝑑𝑑𝛽𝛽1
𝑑𝑑 2 𝑅𝑅𝑅𝑅𝑅𝑅 𝑑𝑑
2 = 27.9906𝛽𝛽1 + 16.7𝛽𝛽0 − 1058.4268 = 27.9906
𝑑𝑑𝛽𝛽1 𝑑𝑑𝛽𝛽 1
Because 10*27.9906 – 16.7*16.7 > 0, the Hessian matrix is positive definite, and thus (-16.1988, 47.4783)
is a minimum point.
Solution:
Loss = (57.48 − 𝛽𝛽0 − 1.52𝛽𝛽1 )2 + (56.57 − 𝛽𝛽0 − 1.60𝛽𝛽1 )2 + ⋯ + (70.19 − 𝛽𝛽0 − 1.80𝛽𝛽1 )2 + 𝛽𝛽12
= 5𝛽𝛽02 + 14.9953𝛽𝛽12 + 16.7𝛽𝛽0 𝛽𝛽1 − 630.9𝛽𝛽0 − 1058.4268𝛽𝛽1 + 20039.2935
𝑑𝑑 𝐿𝐿𝐿𝐿𝐿𝐿𝐿𝐿
= 10𝛽𝛽0 + 16.7𝛽𝛽1 − 630.9 = 0 ⇒ 𝛽𝛽0 = 63.09 − 1.67𝛽𝛽1
𝑑𝑑𝛽𝛽0
𝑑𝑑 𝐿𝐿𝐿𝐿𝐿𝐿𝐿𝐿
= 29.9906𝛽𝛽1 + 16.7𝛽𝛽0 − 1058.4268 = 29.9906𝛽𝛽1 + 16.7 63.09 − 1.67𝛽𝛽1 − 1058.4268 = 0
𝑑𝑑𝛽𝛽1
1058.4268 − 16.7 × 63.09
⇒ 𝛽𝛽1 = = 2.2953
29.9906 − 16.7 × 1.67
⇒ 𝛽𝛽0 = 63.09 − 1.67 × 2.2953 = 59.2569
Solution: Loss = (57.48 − 𝛽𝛽0 − 1.52𝛽𝛽1 )2 + (56.57 − 𝛽𝛽0 − 1.60𝛽𝛽1 )2 + ⋯ + (70.19 − 𝛽𝛽0 − 1.80𝛽𝛽1 )2 + 𝛼𝛼𝛽𝛽12
= 5𝛽𝛽02 + (14.9953 + 𝛼𝛼)𝛽𝛽12 + 16.7𝛽𝛽0 𝛽𝛽1 − 630.9𝛽𝛽0 − 1058.4268𝛽𝛽1 + 20039.2935
𝑑𝑑 𝐿𝐿𝐿𝐿𝐿𝐿𝐿𝐿
= 10𝛽𝛽0 + 16.7𝛽𝛽1 − 630.9 = 0 ⇒ 𝛽𝛽0 = 63.09 − 1.67𝛽𝛽1
𝑑𝑑𝛽𝛽0
𝑑𝑑 𝐿𝐿𝐿𝐿𝐿𝐿𝐿𝐿
= 29.9906 + 2𝛼𝛼 𝛽𝛽1 + 16.7𝛽𝛽0 − 1058.4268 = (29.9906 + 2𝛼𝛼)𝛽𝛽1 + 16.7 63.09 − 1.67𝛽𝛽1 − 1058.4268 = 0
𝑑𝑑𝛽𝛽1
𝑅𝑅𝑅𝑅𝑅𝑅 = 57.48 − 𝛽𝛽0 − 1.52𝛽𝛽1 2 + 56.57 − 𝛽𝛽0 − 1.60𝛽𝛽1 2 + ⋯ + 70.19 − 𝛽𝛽0 − 1.80𝛽𝛽1 2
= 5𝛽𝛽02 + 13.9953𝛽𝛽12 + 16.7𝛽𝛽0 𝛽𝛽1 − 630.9𝛽𝛽0 − 1058.4268𝛽𝛽1 + 20039.2935
= 5 63.09 − 1.67𝛽𝛽1 2 + 13.9953𝛽𝛽12 + 16.7 63.09 − 1.67𝛽𝛽1 𝛽𝛽1 − 630.9 63.09 − 1.67𝛽𝛽1 − 1058.4268𝛽𝛽1
= 0.0508𝛽𝛽12 − 4.8238𝛽𝛽1 + 137.553
𝑑𝑑 𝑅𝑅𝑅𝑅𝑅𝑅
Taking the first derivative: 𝑑𝑑𝛽𝛽1
< 0 ⇒ 0.1016𝛽𝛽1 − 4.8238 < 0 ⇒ 𝛽𝛽1 < 47.478
It follows that RSS decrease with 𝛽𝛽1 for all 𝛽𝛽1 < 47.478.
4.8238 4.8238
Recall that 𝛽𝛽1 = is decreasing with 𝛼𝛼 and that 𝛽𝛽1 < = 47.478 for all 𝛼𝛼 > 0.
0.1016+2𝛼𝛼 0.1016
Hence: Decreasing 𝛼𝛼 -> Increasing 𝛽𝛽1 -> Decreasing RSS -> Increasing 𝑅𝑅2
Solution: