We ask you to perform the following calculations to determine the LINE OF BEST FIT (yfit=mx+b ) for this data: 1. Please use the least squares appraoch from class to construct the following matrices/vectors: - ATA=AA: The square matrix - ATY=Ay: The RHS 1. Now, solve the least squares equation to find the slope, intercept, SSE, and coefficient of DETERMINATION: - SLope_LLSQ = - Intercept_LLSQ = - SSE= - R2= 1. Use the relationships provided in the class slides on linear regression to calculate the following terms: - SSxx = Sum of squares x - SSyy = Sum of squares y - SSxy = Sum of the products - r= Coefficient of correlation - Slope_regression =- Slope_regression = - Intercept_regression = 1. Finally, take the difference in slope and intercept to see how similar they are: - DiffSlope = abs(SLope_LLSQ - Slope_regression) - DiffIntercept = abs(Intercept_LLSQ - Intercept_regression) What do you notice? MATLAB Documentation 24% Assign data to the x and y variable% Assign data x=data(:,1) y=data(:,1) % Assign data to the x and y variable % Calcualate the various terms reques % ATA =AA : The square matrix ATA = % ATY =Ay : The RHS ATY = % Now, solve the least squares equati Slope_LLSQ = Intercept_LLSQ = SSE = R2 = % Use the relationships provided in t SS xx= SSyy = SSxy = r= Slope_regression = Intercept_regression = Finally, take the absolute value of % LLSQ and regression formula/approac( begin{array}{ll}7 & text { % } 89 & text { Slope_LLSQ }= 0 & text { Intercept_LLSQ }= 1 & text { SSE }= 2 & text { R2 }= 3 & 4 & % text { Use the relationships provided in t } 5 & text { SSxx }= 6 & text { SSyy }= 7 & text { SSxy }= 8 & text { r }= 9 & text { Slope_regression }= 0 & text { Intercept_regression }= 1 & 2 & % text { Finally, take the absolute value of } 3 & % text { LLSQ and regression formula/approac } 4 & text { DiffSlope }= 5 & text { Diffintercept }= 6 & 7 & 8 & % text { Plot the results } 9 & text { plot (x,y, 'bo') } 0 & text { hold on } 1 & end{array} ).
We ask you to perform the following calculations to determine the LINE OF BEST FIT (yfit=mx+b ) for this data: 1. Please use the least squares appraoch from class to construct the following matrices/vectors: - ATA=AA: The square matrix - ATY=Ay: The RHS 1. Now, solve the least squares equation to find the slope, intercept, SSE, and coefficient of DETERMINATION: - SLope_LLSQ = - Intercept_LLSQ = - SSE= - R2= 1. Use the relationships provided in the class slides on linear regression to calculate the following terms: - SSxx = Sum of squares x - SSyy = Sum of squares y - SSxy = Sum of the products - r= Coefficient of correlation - Slope_regression =- Slope_regression = - Intercept_regression = 1. Finally, take the difference in slope and intercept to see how similar they are: - DiffSlope = abs(SLope_LLSQ - Slope_regression) - DiffIntercept = abs(Intercept_LLSQ - Intercept_regression) What do you notice? MATLAB Documentation 24% Assign data to the x and y variable% Assign data x=data(:,1) y=data(:,1) % Assign data to the x and y variable % Calcualate the various terms reques % ATA =AA : The square matrix ATA = % ATY =Ay : The RHS ATY = % Now, solve the least squares equati Slope_LLSQ = Intercept_LLSQ = SSE = R2 = % Use the relationships provided in t SS xx= SSyy = SSxy = r= Slope_regression = Intercept_regression = Finally, take the absolute value of % LLSQ and regression formula/approac( begin{array}{ll}7 & text { % } 89 & text { Slope_LLSQ }= 0 & text { Intercept_LLSQ }= 1 & text { SSE }= 2 & text { R2 }= 3 & 4 & % text { Use the relationships provided in t } 5 & text { SSxx }= 6 & text { SSyy }= 7 & text { SSxy }= 8 & text { r }= 9 & text { Slope_regression }= 0 & text { Intercept_regression }= 1 & 2 & % text { Finally, take the absolute value of } 3 & % text { LLSQ and regression formula/approac } 4 & text { DiffSlope }= 5 & text { Diffintercept }= 6 & 7 & 8 & % text { Plot the results } 9 & text { plot (x,y, 'bo') } 0 & text { hold on } 1 & end{array} ).