Rank-deficient ordinary least squares (source code)

= Rank-deficient ordinary least squares

If a <design matrix> $X$ has deficient <rank>, every <ordinary least squares> minimizer has the form $X^+Y+z$ with $z\in\ker X$, where $X^+$ is the <Moore-Penrose inverse>. Hence the fitted values are unique but the coefficients are not: the minimizers form an <affine subspace> of dimension $p-\operatorname{rank}X$.