Normal equations for linear least squares

ID: normal-equations-for-linear-least-squares

Minimizing gives the displayed equations by differentiation. Equivalently, the regression residual satisfies : it is orthogonal to every column of the design matrix. If has full column rank, the minimizer is unique and the fitted values are the orthogonal projection of onto its column space. A rank-deficient design matrix can give multiple coefficient vectors, while the projected fitted vector is still unique.
For an intercept and one predictor, put and . The equations give and , provided . In the five-point example in linear regression, , , and , giving and .
The normal equations describe the mathematical optimum, but explicitly forming and inverting can amplify numerical problems. A QR decomposition computes the same least-squares solution through orthogonal coordinates; a singular value decomposition also exposes nearly dependent columns. This connects statistical fitting to numerical linear algebra and the choice of a stable algorithm. [ref]

New to topics? Read the docs here!