Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

The method of least squares is a standard approach to the approximate solution o

ID: 2880017 • Letter: T

Question

The method of least squares is a standard approach to the approximate solution of overdetermined systems, i.e., sets of equations in which there are more equations than unknowns. The term "least squares" means that the overall solution minimizes the sum of the squares of the errors made in the results of every single equation. In this worksheet you will derive the general formula for the slope and y-intercept of a least squares line. Assume that you have n data points (x_, y_1), x_2 y_2), ..., (x_n, y_n), Let the equation for the least squares line be y = b + mx For each data point (x_i, y_i), show that the corresponding point directly above or below it on the least squares line has y-coordinate b + mx_i For each data point (x_i, y_i), show that the square of the vertical distance from it to the point found in (a) is (y_i - (b + mx_i))^2 Form the function f(b, m) which is the sum of all of the n squared distances found in (b). Find partial differential partial differential b and partial differential f/partial differential m Show that the critical points partial differential f/partial differential b = 0 and partial differential f/partial differential b = 0 lead to a pair of simultaneous nb + (Sigma x_i) m = sigma = sigma y_i linear equations in b and m Solve the equations in part (d) for b and m

Explanation / Answer

1. The points above or below of (xi,yi) have the x coordinate xi.

So to find the y coordinate we have to plug this value for x in y=mx+b

y=mxi+b

And as we see that the y value is mxi+b

2. distance formula is d=sqrt((x1-x2)2+(y1-y2)2)

On plugging the values of (x1,y1) and (x2,y2) we get

d=sqrt((xi-xi)2+(yi- (mxi+b))2)

d= sqrt(y-(xim+b))2

d2=y-(mxi+b)2