Question: 5. It is common practice to try to fit a line y=mx+b to a set of data points (1, 1), (1, 2),..., (In, Yn).
5. It is common practice to try to fit a line y=mx+b to a set of data points (1, 1), (1, 2),..., (In, Yn). The question is, "How can one pick the best line?" In this exercise, you will find a way to do that. First, let w=(mx+b-y) + + (man +b-Vn) (a) Find the gradient of w. Here, you should realize that the only variables for ware m and b. Therefore, your partial derivatives should be with respect to these variables. (b) Show that the values of m and b that minimize the value of w are 1 - (-) m= 11 - - 21 () - 1 The line with these values for m and b is called the least squares line. (c) Use the equations for m and b to find the equation of the line best fit for the data (-1,-1), (0, 1), (2,-3), (4,2), (6,2) and use your line to predict the value of y that would correspond to z = 5. Use a graphing tool to plot the provided data
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
