Linear Algebra / Structure and decomposition
Projections and Least Squares
When a system has no solution, find the closest one. This is how lines are fitted to data.
Contents 3 sections
By the end you can
- Project a vector onto a subspace
- Derive and solve the normal equations
- Fit a line to data
Helps to know: Inner Products and Orthogonality, Subspaces, Rank and Nullity
§1The normal equations
If is inconsistent, choose so that the error is perpendicular to every column of :
Then is the projection of onto the column space: the nearest reachable point.
§2Fitting a line
Example 1Best line through , ,
- Model : rows , right side .
Check yourself
- Q1In least squares, the residual is orthogonal to…