COS424SML 302 Linear Regression 18 46 Example predicting

Cos424sml 302 linear regression 18 46 example

• Notes
• 46

This preview shows page 18 - 28 out of 46 pages.

COS424/SML 302 Linear Regression February 25, 2019 18 / 46 Subscribe to view the full document.

Example: predicting height using shoe size We fit a linear model to D , removing the one outlier point, and find that ˆ β 0 = 24 . 1 and ˆ β = 1 . 7 versus ˆ β 0 = 25 . 39, ˆ β = 1 . 65 60 65 70 75 80 85 22.5 25.0 27.5 Foot size (cm) Height (inches) How can one point have such a big impact on the fitted regression line? COS424/SML 302 Linear Regression February 25, 2019 19 / 46 Example: predicting height using shoe size Now, say I am a forensics expert, and I find a suspect’s shoe print at a crime scene; the shoe is 26 cm long. What do I know about the suspect? 60 65 70 75 80 85 22.5 25.0 27.5 Foot size (cm) Height (inches) y * = ˆ β 0 + ˆ β x * 68 . 3 = 24 . 1 + 1 . 7 × 26 . COS424/SML 302 Linear Regression February 25, 2019 20 / 46 Subscribe to view the full document.

Definition: residuals We define the residual as follows (dropping β 0 ): r i = y i - ˆ β x i = y i - ˆ y i ˆ β = our estimated β ˆ y i = our predicted value These r i are called the residuals . For each sample, the error is the same as the residual: i = y i - ˆ β x i = r i . From our definition of the error term E [ r i ] = E [ i ] = E [ y i - ˆ β x i ] = 0 I.e., the expected residual is zero for the Gaussian model. COS424/SML 302 Linear Regression February 25, 2019 21 / 46 Linear regression: residuals For a fitted linear regression model and a data set D = { ( x 1 , y 1 ) , . . . , ( x n , y n ) } , I can compute the residuals: r i = y i - ˆ β x i = y i - ˆ y i X Y COS424/SML 302 Linear Regression February 25, 2019 22 / 46 Subscribe to view the full document.

Example: predicting height using shoe size We can plot the residuals of the fitted model: -5 0 5 10 15 20 60 65 70 Height (inches) Residual error Are these Gaussian like the model assumes they are? COS424/SML 302 Linear Regression February 25, 2019 23 / 46 Example: predicting height using shoe size We can examine the residuals of the fitted model: 0.00 0.05 0.10 0.15 0.20 0 10 20 Residual error density These look approximately Gaussian with zero mean, with one outlier. COS424/SML 302 Linear Regression February 25, 2019 24 / 46 Subscribe to view the full document.

Evaluating the fit of the regression model to data I How do we quantify the quality of the predicted response values? There are a number of metrics, all of which are a function of the residuals: Residual Sum of Squares (RSS): RSS( ˆ β, D ) = n X i =1 ( y i - ˆ β T x i ) 2 RSS: total squared difference between predicted and true response values; lower values indicate better fit. COS424/SML 302 Linear Regression February 25, 2019 25 / 46 Evaluating the fit of the regression model to data II How do we quantify the quality of the predicted response values? There are a number of metrics, all of which are a function of the residuals: Mean Squared Error (MSE): MSE = 1 n RSS( ˆ β, D ) Root Mean Squared Error (RMSE): RMSE = MSE MSE, RMSE: (root) average squared difference between predicted and true response values; lower values indicate better fit. COS424/SML 302 Linear Regression February 25, 2019 26 / 46 Subscribe to view the full document.

Evaluating the fit of the regression model to data III How do we quantify the quality of the predicted response values? There are a number of metrics, all of which are a function of the residuals: Coefficient of determination ( r 2 ) : r 2 = 1 - RSS ( ˆ β, D ) n i =1 ( y i - 1 n n i =1 y i ) 2 r 2 : correlation between predicted and true response values; higher values indicate better predictions.  • Spring '09

What students are saying

• As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

Kiran Temple University Fox School of Business ‘17, Course Hero Intern

• I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

Dana University of Pennsylvania ‘17, Course Hero Intern

• The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

Jill Tulane University ‘16, Course Hero Intern

Ask Expert Tutors You can ask 0 bonus questions You can ask 0 questions (0 expire soon) You can ask 0 questions (will expire )
Answers in as fast as 15 minutes