Canadian flagMath101 · Independent Ontario learning libraryCreated and edited by Kamran
Math101
Printable cheat sheet
Linear AlgebraUniversity

Least Squares

A rigorous guide to inconsistent systems, orthogonal residuals, normal equations, QR, and interpretation.

Open the full lesson →

Precise definition

For an overdetermined system $Ax\approx b$, a least-squares solution minimizes $\|Ax-b\|_2^2$. At a minimizer, the residual $r=b-A\hat x$ is orthogonal to every column of $A$, giving the normal equations $A^TA\hat x=A^Tb$.

Notation and mathematical language

If $A$ has independent columns, $A^TA$ is invertible and the unique minimizer is $(A^TA)^{-1}A^Tb$. Geometrically, $A\hat x$ is the orthogonal projection of $b$ onto $\operatorname{Col}A$. QR solves $R\hat x=Q^Tb$ without forming $A^TA$.

Conceptual picture

Least squares does not make inconsistent equations true; it chooses the attainable vector closest to the data in Euclidean distance. The residual contains the unexplained component perpendicular to the model subspace.

Fully worked example

Interpretation and application

Least squares underlies regression, calibration, imaging, and data fitting. A small residual measures in-sample geometric fit; it does not prove correct functional form, reliable extrapolation, independent errors, or a causal relationship.

Common mistakes

Search 464 published lessons, 123 answer guides, courses, and learning tools.
Your experience

Settings

Ontario math tutoringWork with KamranBook ↗