Prerequisites
Vectors, dot products, matrix transposes, and derivatives of quadratics.
Minimize the squared residual norm ||Ax - b||^2. Differentiating gives A^T(Ax - b) = 0: the residual is orthogonal to the column space. Full column rank gives a unique coefficient vector; a fitted vector can remain unique without unique coefficients.
Worked example
For b = (1, 5) and A = (1, 1)^T, the best constant is 3. The residual b - Ax = (-2, 2) sums to zero, so it is perpendicular to A.
Model and Assumptions
Fit one constant x to invented observations b = (1, 2, 6). A is a three-by-one column of ones. Give all observations equal weight and define the residual as r = b - Ax.
Further inquiry
Derive the normal equations for a general real matrix. Then replace A with two identical columns of ones: describe all minimizing coefficient pairs and prove that their fitted vectors agree.
Review criteria
- Differentiate or complete the square explicitly.
- Give the coefficient family and identify its null direction.
- Distinguish uniqueness of the projection from uniqueness of coefficients.