Rank-deficient ordinary least squares Created 2026-09-29 Updated 2026-10-06
If a design matrix has deficient rank, every ordinary least squares minimizer has the form with , where is the Moore-Penrose inverse. Hence the fitted values are unique but the coefficients are not: the minimizers form an affine subspace of dimension .
For row reduction with a parameterized right-hand side at , the nonzero reduced equations areColumn 3 has no pivot element, so is a free variable in a linear system. Taking gives every solution:There is no further restriction on . Independent substitution into the original linear system givesConversely, the two reduced equations force exactly these coordinate formulas, so no solutions have been omitted. The same computation with zero right-hand side gives the kernel . Its dimension is one. The rank-nullity theorem appears here as : two pivot columns and one freely chosen coordinate account for the three unknowns.[ref]
The Rank Theorem. Interactive Linear Algebra by Dan Margalit and others; §2.9, Rank Theorem and preceding pivot-column/free-variable count
One free variable in a linear system traces an affine solution space of a linear equation parallel to its kernel
. Details. In general a consistent linear system has solution set . Subtracting from proves this description in both directions. The particular solution places the affine subspace, and the kernel supplies its directions.[ref]
Solution Sets. Interactive Linear Algebra by Dan Margalit and others; §2.4.2, Key Observation and its proof: translate homogeneous solutions by any particular solution
Over the real numbers this example is an entire line; over the rational numbers the same formula uses rational . A free variable in a linear system over a finite field instead has only finitely many choices.The pivot columns identify a different object: the original column space. Here they selectwhich form its basis, while . The corresponding reduced columns are and ; their linear span is a different plane. For example, every original output satisfies , but does not. Since is an invertible matrix, column linear relations survive even though the output vectors move. This is why choosing original columns at the reduced pivot positions works.
Consider the linear map represented by the rectangular matrixTo compute its kernel, solve the homogeneous linear system , . Taking gives , , soThus represents a null direction of a linear map: decreasing the first input by two, increasing the second by one, and decreasing the third by one changes neither output. Solving the homogeneous linear system is the concrete computation behind a kernel; the column space instead decides which outputs are attainable.[ref]
Lecture 6: Column space and nullspace. Gilbert Strang, Lecture 6: Column space and nullspace, opening lecture description: the distinct roles of Ax=0 and Ax=b
Now prescribe the nonzero output . The linear system becomes , . Again take :Direct substitution gives , and . Conversely, the two linear equations force exactly this form, so no solutions have been omitted. This fiber is an affine subspace of dimension one in the three-dimensional input vector space. It is parallel to the kernel, but does not pass through the origin. For instance, and both give , while their difference gives zero. Adding and gives output , which is another way to see that this nonzero-output fiber is not a vector subspace.
Three-dimensional inputs along one null direction give the same two-dimensional output
. The blue straight line is the kernel in the actual three-dimensional input vector space. The orange solution straight line is its translation by . Three marked inputs map to the single orange output in the two-dimensional output vector space; the blue kernel maps to zero. Finite plotted segments represent infinite straight lines. Details.The first and third columns of are and , a basis of the output vector space. Hence has matrix rank two and reaches every output. The rank-nullity theorem predicts nullity before we solve any linear system. It provides a useful completeness check: one nonzero kernel vector already forms a basis here, so a second independent null direction of a linear map would signal a calculation error. In general, matrix rank for an matrix leaves independent kernel directions, rather than .[ref]
The Rank Theorem. Margalit and Rabinoff, Interactive Linear Algebra, §2.9, Rank Theorem: column count equals rank plus nullity
Vector subspace Created 2026-09-24 Updated 2026-10-14
A vector subspace is a nonempty subset of a vector space closed under vector addition and scalar multiplication, and is therefore itself a vector space. Equivalently, whenever belong to the subset, so does for all allowed scalars . In particular it contains the zero vector.
For example, the plane is a vector subspace, with basis . Indeed every element is . The parallel plane misses the zero vector and is an affine subspace instead. Homogeneous constraints produce vector subspaces: is the kernel of the linear map . This lets us describe all solutions of a homogeneous linear equation through a basis of its kernel.

