Mathematics · University
Orthogonality and least-squares fitting
The closest point in a subspace is found by an orthogonal residual.
Prerequisites
Dot products, matrices and Euclidean norms.
Study notes
Projection
The closest point in a subspace is found by an orthogonal residual.
Normal equations
AᵀAx=Aᵀb characterizes least-squares solutions.
Uniqueness
Full column rank makes AᵀA invertible; without it, fitted values may be unique while coefficients are not.
Computation
QR factorization avoids explicitly forming AᵀA and often offers better numerical stability.
Worked examples
Project v=(3,4) onto the x-axis. Enter the x-coordinate.
The closest point is (3,0), leaving residual (0,4) perpendicular to the axis.
3
Fit a constant c by minimizing (1−c)²+(3−c)²+(8−c)². Find c.
The minimizer is the sample mean (1+3+8)/3=4.
4
Check your understanding
At a least-squares solution, the residual b−Ax is orthogonal to what?
- Only the zero vector
- The row space in all dimensions
- Every possible b
- The column space of A
Find the scalar k such that the projection of (2,1) onto span(1,1) equals k(1,1).
Derive the normal equations by differentiating the squared residual norm.
Which condition guarantees a unique least-squares coefficient vector?
- A has a zero column
- b has only positive entries
- A has full column rank
- There are more columns than rows
Answers and marking guidance
Answers and marking notes
- The column space of A
Aᵀ(b−Ax)=0 means the residual is orthogonal to every column.
- 1.5
k=((2,1)·(1,1))/2=3/2.
- The gradient of (Ax−b)ᵀ(Ax−b) is 2Aᵀ(Ax−b). Setting it to zero gives AᵀAx=Aᵀb.
Credit expansion or a correct vector derivative and stationary condition.
- A has full column rank
Full column rank makes the quadratic strictly convex in x.
Further reading and review references
These are reference links, not copied exercises, institutional endorsement or proof of independent review.
AI-assisted preview; independent educational review required. Level labels describe prerequisites, not accreditation or official curriculum alignment.