Back to AI Math Mind Map
中文·English
📐 AI MathID: projection-least-squares

Projection & Least Squares

投影与最小二乘
🎯Core Definition
The least-squares problem minwXwy2\min_w \Vert Xw - y \Vert^2 is, geometrically, an orthogonal projection: when yC(X)y \notin C(X) no exact solution exists, and the optimum requires XwXw to equal the orthogonal projection y^=Py\hat{y} = Py of yy onto the column space C(X)C(X), with residual r=yXwr = y - Xw orthogonal to C(X)C(X), i.e. XT(yXw)=0X^T(y - Xw) = 0, giving the normal equations XTXw=XTyX^TXw = X^Ty; with full column rank, w=(XTX)1XTyw = (X^TX)^{-1}X^Ty. The projection matrix P=X(XTX)1XTP = X(X^TX)^{-1}X^T is idempotent (P2=PP^2 = P) and symmetric (PT=PP^T = P), and IPI - P projects onto N(XT)N(X^T). When XX is rank-deficient or XTXX^TX ill-conditioned, use the pseudoinverse X+=VΣ+UTX^+ = V\Sigma^+U^T (from the SVD; Σ+\Sigma^+ inverts nonzero singular values), giving the minimum-norm solution w=X+yw = X^+y.
💡Use Cases
closed-form solution of linear regression; line/polynomial fitting; recommenders, signal estimation, and solving overdetermined systems; the fallback when XTXX^TX fails due to collinearity or high dimensionality; also the starting point of Ridge regularization (XTX+λIX^TX + \lambda I).
Key Problems Solved
with more equations than unknowns, yy typically lies outside C(X)C(X) and the system has no solution; the projection theorem guarantees that y^\hat{y}, with residual orthogonal to the column space, is the unique best approximation in the Euclidean norm; when XX is rank-deficient, (XTX)1(X^TX)^{-1} does not exist and the pseudoinverse degenerates to the minimum-norm solution; moreover the normal equations square the condition number (κ(XTX)=κ(X)2\kappa(X^TX) = \kappa(X)^2), so the pseudoinverse/QR/SVD route is numerically far more stable.
🎯5 High-Frequency Exam Points
1
Derivation: from the residual orthogonality XT(yXw)=0X^T(y - Xw) = 0, derive the normal equations w=(XTX)1XTyw = (X^TX)^{-1}X^Ty and sketch the projection geometry.
2
Prove P=X(XTX)1XTP = X(X^TX)^{-1}X^T is an orthogonal projection (P2=PP^2 = P, PT=PP^T = P); onto which subspace does IPI - P project?
3
By hand: fit a line y=w0+w1xy = w_0 + w_1x to 3 data points by constructing XX and yy and solving the normal equations.
4
When is XTXX^TX singular? How does the pseudoinverse X+=VΣ+UTX^+ = V\Sigma^+U^T yield the minimum-norm solution, and how does it differ from (XTX)1XT(X^TX)^{-1}X^T?
5
Why are the normal equations numerically unstable (κ(XTX)=κ(X)2\kappa(X^TX) = \kappa(X)^2)? How do pseudoinverse, regularization, or QR mitigate collinearity?
📖 In-depth Guide:📄 linear-algebra-for-ai
Updated 2026-08-12
🎯
Test Your Knowledge: Practice Questions for "Projection & Least Squares"
Single choice pitfall questions with instant feedback and mistake tracking.
🚀 Start Card Practice
Previous CardSVD & Eigen-DecompositionNext CardMatrix Decomposition Applications

🔗 More AI Math Knowledge Cards

Adam/AdamW MathBayesian InferenceBias-Variance DecompositionBootstrap