Fitting a Line to Data The method of least squares is a standard approach to the approximate solution of overdeter- mined systems, i.e., sets of equations in which there are more equations than u...
Fitting a Line to Data The method of least squares is a standard approach to the approximate solution of overdeter- mined 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 for- mula for the slope and y-intercept of a least squares line. Assume that you have n data points (xi, vi), (r2, 2),., (nn). Let the equation for the least squares line be y b+mz (a) (1 Point) For each data point (zi,), show that the square of the vertical distance from it to the point found on the line y- b+ ma is (vi - (b+ mz)) (b) (1 Point) Form the function f(b, m) which is the sum of all of the n squared distances found in (b). Find af/ob and af/om 0 lead to a pair of simultaneous (c) (1 Point) Show that the critical points ОЬ-0 and Orn linear equations in b and m n. i-1 ー1 -1 (d) (1 Point) Solve the equations in part (d) for b and m (e) (1 Point) Use the formulas you found in part (d) to calculate the least squares line for the se of data below, 2.87 9 5.84 5.16 4.81 y 8.26 7.62 6.03 9.53 4.87 then graph the data points and the least squares line on the same coordinate grid.
Fitting a Line to Data The method of least squares is a standard approach to the approximate solution of overdeter- mined 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 for- mula for the slope and y-intercept of a least squares line. Assume that you have n data points (xi, vi), (r2, 2),., (nn). Let the equation for the least squares line be y b+mz (a) (1 Point) For each data point (zi,), show that the square of the vertical distance from it to the point found on the line y- b+ ma is (vi - (b+ mz)) (b) (1 Point) Form the function f(b, m) which is the sum of all of the n squared distances found in (b). Find af/ob and af/om 0 lead to a pair of simultaneous (c) (1 Point) Show that the critical points ОЬ-0 and Orn linear equations in b and m n. i-1 ー1 -1 (d) (1 Point) Solve the equations in part (d) for b and m (e) (1 Point) Use the formulas you found in part (d) to calculate the least squares line for the se of data below, 2.87 9 5.84 5.16 4.81 y 8.26 7.62 6.03 9.53 4.87 then graph the data points and the least squares line on the same coordinate grid.