ORTHOGONALITY AND LEAST SQUARES
 

Orthogonal Vectors
Norm
Unit Vector
Orthonormal Vectors
Orthogonal Complement
Orthogonal Projection
Cauchy-Schwarz Inequality
Angle Between Two Vectors
Gram-Schmidt Process
QR Factorialization
Transpose
Symmetric and Skew-symmetric Matrices
Orthogonal Matrices
Least Squares Solutions
Matrix of an Orthogonal Projection
Matrix of an Orthogonal Projection
How to Examples Exercise
How to:
To find a matrix of an orthogonal projection, we of course start with a subspace V that we want to project onto, and also a
basis, v1, v2, ... , vM for that subspace.

We first start by creating a matrix A that has V's basis as column vectors:
     A = [v1 v2 ... vM]

Now, the matrix of an orthogonal projection, which we'll call B, is simply:
     B = A*inv(A'*A)*A'

If we happen to have an orthonormal basis, then A'*A reduces to the identity matrix, and our matrix of an orthogonal projection is reduced to:
     B = A*A'
An important thing to note here is the order of these terms. A'*A is not the same as A*A'.
    

Examples:



Exercise: