Orthogonality and Projection
An inner product gives a vector space lengths and angles. Orthonormal bases make coordinates into inner products, Gram–Schmidt produces one from any basis, and projecting a vector onto a subspace finds the closest point in it, which is what least squares computes.
Definition
An inner product on a real vector space
| Axiom | |
|---|---|
| symmetry | |
| linearity | |
| positive definiteness |
The norm is
Orthogonal and orthonormal sets. A set is orthogonal when its vectors are pairwise orthogonal, orthonormal when in addition each has norm 1. An orthogonal set of nonzero vectors is automatically independent, so an orthogonal spanning set is a basis.
What an orthonormal basis supplies. For an orthonormal basis
so finding coordinates needs no linear system. For a merely orthogonal basis the same holds with
Projection onto a subspace. For a subspace
The residual
Gram–Schmidt. Given a basis
subtracting from each vector its projection onto the span of those already produced. The result is an orthogonal basis of the same subspace; dividing each by its norm makes it orthonormal.
Least squares. When
which say exactly that the residual
Assumptions and scope
Orthogonality depends on the inner product. Two functions orthogonal under
need not be under , and the word carries no meaning until the inner product is named. An orthogonal set of nonzero vectors is independent, but an independent set is not generally orthogonal. Gram–Schmidt is what converts one to the other.
The projection formula requires an orthogonal basis of the subspace. Applying it with a non-orthogonal spanning set gives a vector that is not the projection, and the error is silent.
The normal equations have a unique solution exactly when the columns of
are independent. With dependent columns the least-squares problem still has a minimiser, but not a unique one. Gram–Schmidt is numerically unstable in its classical form; implementations use the modified variant or a Householder QR factorisation. The mathematics is unaffected.
Least squares here is a geometric construction. Whether the fitted coefficients support an inferential claim is a separate question, governed by the modelling assumptions rather than by the projection.
Worked material
Example
Orthogonal sets in four different spaces
The same definition, applied wherever an inner product exists.
The standard basis of
A rotated pair in
which pair to zero and have norm 1. This is the distinction that decides whether the denominators in the projection formula may be dropped.
Polynomials on
One Gram–Schmidt step replaces
Two functions can look entirely unalike and still fail to be orthogonal; the integral decides, not the appearance.
Trigonometric functions on
while
Symmetric matrices, with
is pairwise orthogonal, with squared norms
Nothing about the objects, lists of numbers, polynomials, functions, matrices. What they share is an inner product satisfying the three axioms, and every construction in this unit is written in those terms alone. What differs is which sets count as orthogonal, and that depends entirely on the inner product chosen.
Non-example
Projecting without an orthogonal basis, and three other errors
Using the formula on a non-orthogonal basis. Take
The correct projection is
The formula presumes the cross terms vanish. When they do not, each term double-counts the overlap between the basis vectors, and the result is a vector in
Dropping the denominator. For an orthogonal but not orthonormal basis, writing
Calling vectors orthogonal without naming the inner product.
Reading uniqueness of the fit as uniqueness of the coefficients. When the columns of
Each drops a condition that the construction depends on, orthogonality of the basis, the normalisation, the choice of inner product, independence of the columns, and each produces an answer that looks well-formed. Only the residual check catches the first two, and only attention to the hypotheses catches the last two.
Common errors
Common misconception
The projection formula
Related units
Requires
Connected
- Vectors and Linear Combinations (related)
- Linear Regression for Experimental Research (related)