Lecture-2 Least Squares Regression
Lecture-2 Least Squares Regression
Lecture-2 Least Squares Regression
• Ordinary least squares regression is a way to find the line of best fit
for a set of data. It does this by creating a model that minimizes the
sum of the squared vertical distances (residuals).
• The distances are squared to avoid the problem of distances with a
negative sign. Then the problem just becomes figuring out where you
should place the line so that the distances from the points to the line
are minimized. In the following image, the best fit line A has smaller
distances from the points to the line than the randomly placed line B.
The Residuals
• The difference between the observed and predicted values of y is the
error, or residual.