Least Squares and the Geometry of Residuals
Derive the orthogonality condition for the best linear fit and explain how rank affects which coefficients are identifiable.
- Source
- Anbloq
- Language
- English
- Created
- Updated
- Chapters
- 2
- Reading time
- 1 min
In this article2 chapters
A least-squares fit projects observations onto column space
Choose coefficients \(\beta\) to minimize \(\|X\beta-y\|_2^2\). Differentiating gives \(X^\top(X\beta-y)=0\). The residual is perpendicular to every feature column. With only an intercept column of ones, this condition says residuals sum to zero, so the fitted constant is the sample mean. With multiple columns, the fitted vector lies in their span.
Several coefficient vectors can predict the same observations
If two columns are identical, shifting a coefficient from one to the other leaves \(X\beta\) unchanged. The fitted vector is still the unique Euclidean projection, while coefficients may not be unique. Use a numerical method suited to rank and conditioning. QR least squares avoids forming normal equations explicitly. Ridge regression adds a penalty that can determine a stable coefficient vector.[1][2]