A projection matrix is a matrix used in linear algebra to map vectors onto a subspace, typically in the context of vector spaces or 3D computer graphics. It has the following main applications:
A matrix P is a projection matrix if:
- P2 = P (idempotent property).
- P is square (n × n).
This means applying the projection matrix twice is the same as applying it once. Essentially, the projection does not change after the first application.
Examples of Projection Matrices
Some common examples of projection matrices are:
Projection onto a Subspace
Given a vector v ∈ Rn and a subspace U ⊂ Rn, the projection of v onto U can be computed using the projection matrix P. If A is a matrix whose columns form an orthonormal basis for U, the projection matrix P is:
P = AAT
- For example, if A = \begin{bmatrix} 1 & 0 \\ 0 & 1 \end{bmatrix}, then P = \begin{bmatrix} 1 & 0 \\ 0 & 1 \end{bmatrix}, which projects every vector onto itself (identity matrix).
Orthogonal Projection in Linear Regression
In Ordinary Least Squares (OLS) regression, the projection matrix P projects the vector of observed values y onto the column space of the design matrix X:
P = X(XTX)−1XT
Here:
- X is the n × p matrix of predictors (independent variables).
- y is the n × 1 vector of responses (dependent variable).
The projected vector \hat{y} = P y is the vector of predicted values.
Projection in Principal Component Analysis (PCA)
In PCA, high-dimensional data is projected onto a subspace spanned by the top k eigenvectors (principal components) of the covariance matrix:
P = UkUkT
Where:
- Uk is a matrix containing the top k eigenvectors as its columns.
This projection reduces the dimensionality of the data while retaining maximum variance.
Types of Projection Matrices
Some of the common types of projection matrices are:
- Orthogonal Projection Matrix
- Perspective Projection Matrix
- Oblique Projection Matrix
Let's discuss them in detail.
Orthogonal Projection Matrix
Projects a vector onto a subspace along directions orthogonal to the subspace.
If A is a matrix whose columns form a basis for a subspace, the orthogonal projection matrix onto the column space of A is:
P = A(ATA)−1AT
Perspective Projection Matrix
Perspective projection matrix is used in computer graphics to project 3D points onto a 2D plane while preserving the perspective view.
A common example for a perspective projection matrix in 3D is:
P = \begin{bmatrix} f & 0 & 0 & 0 \\ 0 & f & 0 & 0 \\ 0 & 0 & (z_{\text{far}} + z_{\text{near}}) / (z_{\text{near}} - z_{\text{far}}) & 2 \cdot z_{\text{far}} \cdot z_{\text{near}} / (z_{\text{near}} - z_{\text{far}}) \\ 0 & 0 & -1 & 0 \end{bmatrix}
where f is the focal length.
Oblique Projection Matrix
Oblique projection matrix projects vectors onto a subspace along a direction that is not orthogonal to the subspace.
Properties of Projection Matrices
Some of the common properties of projection matrices are:
- Idempotence: P2 = P
- Symmetry (for orthogonal projections): P = PT
- Eigenvalues: The eigenvalues are 0 and 1, where 1 corresponds to the subspace being projected onto.
- Trace: The trace of a projection matrix equals the dimension of the subspace onto which it projects.
- Rank: The rank of P equals the dimension of the subspace it projects onto.
Applications of Projection Matrices
Projection matrices have various application in many fields, some of the common application are:
- Linear regression: Projecting data onto the column space of predictor variables.
- Computer graphics: Transforming 3D scenes onto a 2D plane.
- Signal processing: Isolating components of signals in subspaces.
- Principal Component Analysis (PCA): Projecting data onto the principal components.
Read More,
Similar Reads
Projections in Computer Graphics Representing an n-dimensional object into an n-1 dimension is known as projection. It is process of converting a 3D object into 2D object, we represent a 3D object on a 2D plane {(x,y,z)->(x,y)}. It is also defined as mapping or transforming of the object in projection plane or view plane. When g
5 min read
Projection Pursuit Using Python Projection pursuit is a dimensionality reduction technique that is used to find non-linear projections of high-dimensional data onto a lower-dimensional space. Projection pursuit is based on the idea of searching for interesting, non-linear patterns in the data, and aims to find projections that hig
11 min read
Projection Pursuit Using Python Projection pursuit is a dimensionality reduction technique that is used to find non-linear projections of high-dimensional data onto a lower-dimensional space. Projection pursuit is based on the idea of searching for interesting, non-linear patterns in the data, and aims to find projections that hig
11 min read
What is a Projection Layer in the Context of Neural Networks? A projection layer in neural networks refers to a layer that transforms input data into a different space, typically either higher or lower-dimensional, depending on the design and goals of the neural network. This transformation is generally linear and is often achieved using a fully connected laye
5 min read
Perspective Projection and its Types In Perspective Projection the center of projection is at finite distance from projection plane. This projection produces realistic views but does not preserve relative proportions of an object dimensions. Projections of distant object are smaller than projections of objects of same size that are clo
3 min read
Difference between Parallel and Perspective Projection in Computer Graphics Projection are defined as mapping of three-dimensional points to a two-dimensional plane. There are two type of projection parallel and perspective. 1. Parallel Projection : Parallel projections are used by architects and engineers for creating working drawing of the object, for complete representat
3 min read