Question: In this problem we use techniques from matrix algebra to calculate the least squares regression line described way back in Chapter 2 (please see
In this problem we use techniques from matrix algebra to calculate the least squares regression line described way back in Chapter 2 (please see pp. 89-91 and class notes). We explore this in a relatively simple case, since the method becomes increasingly time-consuming to calculate by hand the more data points there are. You are then asked to implement the method in several different situations. Given data points (1.1). (22,92). (23.33), we wish to find the real numbers a and b which make y = ar + b the equation of the (unique) least squares regression line for the given points. Let's temporarily assume that all three of the points are collinear (i.e., all lie on a single line). Then the system I1 Ho would have as solution the coefficients of whatever line contained all three of our points. However, if no single line contains all three points, then the above linear system cannot have a solution (in the language of linear systems, it would be "overdetermined", with too many different equations to be satisfied for any one point to satisfy them all). If our "temporary assumption" is not correct, and no single line contains all three points, how can we calculate the least squares regression line?! 21 22 23 1 11 In fact, we do so by adjusting the linear system above in a specific way that will result in a linear system that has a solution. By a technical mathematical argument (that would not be suitable for us here) the solution of the revised system will be the coefficients of theactual least squares regression line. The "adjustment" is to multiply both the left and right-hand sides of the original matrix equation above by a matrix [2 1 1 1 77 Note how this new matrix is related is related to the original coefficient matrix: the first row of the new matrix is the first column of the old one, and the second row of the new matrix is the second column of the old one (in matrix algebra, we say that the new matrix is the transpose of the old one). After this multiplication, our system is given by 1800-6 x+x+xx + x + x3 3 2+2 +23 9/1 9/2 9/3 **][8] - [* This is a system that we can solve by our methods from Chapter 6. Carrying out the matrix multiplications, we get the revised system in a more manageable form (remembering, of course, that the expressions involving all the 's and y's will be single numbers): 12 +22+32 1+2+3 a 1+2+3 ][8] 3 b which, after the arithmetic is performed, gives us 14 6 a 6 3 11 = To see this once in action, let's calculate the linear regression line for the points (1.1), (2,2) and (3,2). This means x=1, 2, 233. 311, 32= 2, and y3 = 2. The revised linear system then becomes [ 1 2 Y *+ 2 3 9/1 $][8]-[8] b 11+122 +239/3 91 +92 +93 1.1+22+3-2 1+2+2 Applying our Chapter 6 row-reduction methods to this system results in the unique solution (a,b) = (1/2,2/3). This means that the least squares linear regression line is Now it's your turn. (a) Use the above method to calculate the least squares regression line for the data (1,4), (2,6). (4,8). (b) Explore the case where the three data points do in fact lie on a single line by calculating the least squares regression line for the data (2,3), (4.5), (6, 7). Does our method find the line on which the points lie? (c) This method actually works for any number of data points. For n points, where we have 1,2,3, extend this by adding 24 through, and do the same with the y's. Note that even though the dimensions of the matrices that go into the system are larger (2 x n and nx 2), the final system is still 2 x 21 So the systems get more time consuming to set up. but involve about the same number of steps to solve. Try to expand your horizons by using our method to calculate the least squares regression line for the data points (1,4), (2,3), (3,5) and (4.8).
Step by Step Solution
3.50 Rating (160 Votes )
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
