Lec 3 Regression.
Lec 3 Regression.
X
Simple Linear Regression
Simple Linear Regression Equation
y is a dependent variable.
𝑦 is the predicted value of y
X is an independent variable.
b0 and b1 are the regression coefficients.
b0 is the intercept or the bias that fixes the offset to a line.
b1 is the slope or weight that specifies the factor by which X
has an impact on Y.
Error for Simple Linear Regression model
Y= 𝛽0 + 𝛽1 X + 𝜀 ed the regressiondel.
𝜀: reflects how individuals deviate from others with the same
value of x
Ŷ82=b0 + b182 e82=Y82-Ŷ82
X=82
Estimated Simple Linear Regression Equation
Recall: The estimated simple linear regression equation is:
𝑌 = 𝑏0 + 𝑏1 X
b0 is the estimate for β0
ŷ
Least Squares method
• Of all possible lines pick the one that minimizes the sum of the
distances squared of each point from that line
Least Squares Solution
b1
(X X )(Y Y )
i i
(X X )
slope:
2
i
Intercept: b 0 Y b1 X
Estimating the Variance s 2
• An Estimate of s 2
The mean square error (MSE) provides the estimate
of s 2, and the notation s2 is also used.
s2 = MSE = SSE/(n-2)
where:
If points are close to the regression line then SSE will be small
If points are far from the regression line then SSE will be large
Variance
Bias
Regression predictions should be unbiased. That is:
"average of predictions" should ≈ "average of observations"
Bias measures how far the mean of predictions is from the mean of actual
values
𝐵𝑖𝑎𝑠 = 𝑚𝑒𝑎𝑛 𝑜𝑓 𝑝𝑟𝑒𝑑𝑖𝑐𝑡𝑖𝑜𝑛𝑠 – 𝑚𝑒𝑎𝑛 𝑜𝑓 𝑎𝑐𝑡𝑢𝑎𝑙 𝑣𝑎𝑙𝑢𝑒𝑠 (𝑔𝑟𝑜𝑢𝑛𝑑 𝑡𝑟𝑢𝑡ℎ 𝑙𝑎𝑏𝑒𝑙𝑠)
Model
error Without regularizer
With regularizer
Number of iterations
Under fitting