Least Squares
When has no solution, we find the best approximate solution by minimizing the error:
The Normal Equations
The solution satisfies:
This always has a solution (if is invertible, itβs unique).
Why It Works
We project onto . The projection is the closest point in the column space to .
Applications
- Line fitting β find the best line through data points
- Curve fitting β find the best polynomial
- Overdetermined systems β more equations than unknowns
Example
Fitting to points :
Solve for best .