MHB Least squares regression line (I'm very lost)

AI Thread Summary
The discussion revolves around calculating the least squares regression line to estimate the value of x when y equals 15, given specific covariance and variance values. The least squares method aims to minimize the total squared error between observed and predicted values, represented by the equation y = ax + b. Participants explain how to derive the total squared error from the provided data points and emphasize the importance of minimizing this error through partial derivatives. The conversation highlights the mathematical process involved in finding the optimal values for a and b. Understanding these concepts is crucial for successfully applying the least squares regression method.
Melody55
Messages
1
Reaction score
0
Hi! Basically this is the exercise:

Given the covariance of x and y is -12 and the variance of x is 6,5, using the least squares line of best fit connecting x and y yo estimate the value of x when y=15

x25979107
y251711108713
any help would mean everything, I'm desperate :(
 
Physics news on Phys.org
Do you know what "least squares best fit" means?
It is the line y= ax+ b that "best fits" in very specific way. When x= 2, that equation gives y= 2a+ b while the correct value is 25. The "error", if any, is 2a+ b- 25. If we want to find a "total error" by adding those, some might be negative and cancel positive errors giving too small a total error. We could fix that by taking the absolute value but the absolute value function is not differentiable at 0. So instead we fix the sign problem by squaring. The "square error" at x= 2 is $(2a+ b- 25)^2$.

Using all of the given data,

$(2a+ b- 25)^2$

$(5a+ b- 17)^2$

$(9a+ b- 11)^2$

$(7a+ b- 10)^2$

$(9a+ b- 8)^2$

$(10a+ b- 7)^2$

$(7a+ b- 13)^2$
The total square error is

$(2a+ b- 25)^2+(5a+ b- 17)^2+ (9a+ b- 11)^2+ (7a+ b- 10)^2+ (9a+ b- 8)^2+ (10a+ b- 7)^2+ (7a+ b- 13)^2$.
That's a function of the two variables, a and b. Find the minimum by taking the partial derivatives with respect to a and b and setting them equal to 0,
 
Back
Top