Least squares
Gist
The method for finding the best fit line in Linear regression (LM)
Calculus-derived
Imagine the simplest case:
and let us define the residuals (
The sum of squared errors is then:
If we want to minimize the SSE, we should then find the derivative in respect to
And if you set it to 0 and solve for
Linear algebra- derived
If we look at Multiple regression regression in matrix form
Notes
In Maximum likelihood, if one assumes the observation is drawn from a Distribution - Normal, then it is ultimately Least Squares.