Projection Matrix — Definition, Formula & Examples
A projection matrix is a square matrix that, when multiplied by a vector, gives the orthogonal projection of that vector onto a subspace. Applying twice has the same effect as applying it once, meaning .
A matrix is a projection matrix if (idempotent). It is an orthogonal projection matrix if, additionally, (symmetric). Given a matrix whose columns span the target subspace, the orthogonal projection matrix onto the column space of is .
Key Formula
Where:
- = The orthogonal projection matrix onto the column space of A
- = Matrix whose columns form a basis for the target subspace
- = Transpose of A
- = Inverse of the Gram matrix, which exists when A has linearly independent columns
How It Works
To project a vector onto the column space of a matrix , you compute where . The result is the closest point in the column space to . The residual is orthogonal to every column of . This is the geometric heart of least squares regression: when has no exact solution, the projection gives the best approximation.
Worked Example
Problem: Find the projection matrix that projects vectors in R² onto the line spanned by a = [1, 2]ᵀ.
Compute AᵀA: Here A is just the column vector a. Compute the dot product.
Compute (AᵀA)⁻¹: Since AᵀA is a scalar, its inverse is simply 1/5.
Compute P = A(AᵀA)⁻¹Aᵀ: Multiply the column vector by 1/5 by the row vector.
Answer: The projection matrix is . You can verify: and .
Why It Matters
Projection matrices are the foundation of least squares solutions. In statistics and data science, every ordinary least squares regression computes a projection of observed data onto the column space of the design matrix. Understanding projections also clarifies concepts like residuals and the hat matrix in regression diagnostics.
Common Mistakes
Mistake: Forgetting to check that the columns of A are linearly independent before computing (AᵀA)⁻¹.
Correction: The formula P = A(AᵀA)⁻¹Aᵀ requires AᵀA to be invertible, which happens only when A has linearly independent columns. If columns are dependent, remove redundant columns first or use the pseudoinverse.
