The QR Factorization and Orthonormal Bases

Any real matrix A with linearly independent columns can be factored as a product QR, where the columns of Q are orthonormal (the inner product of any two different columns is 0, and the inner product of any column with itself is 1) and R is invertible and upper-right triangular. If the original matrix A is square, then so is Q. In this case, Q is an orthogonal matrix.

$\blacktriangleright$ To obtain the QR factorization

1.
Leave the insertion point in a matrix.

2.
From the Matrices submenu, choose QR.

$\blacktriangleright$ Matrices + QR

$\left(\vphantom{
\begin{array}{cc}
3 & 0 \\
4 & 5
\end{array}
}\right.$$\begin{array}{cc}
3 & 0 \\
4 & 5
\end{array}$$\left.\vphantom{
\begin{array}{cc}
3 & 0 \\
4 & 5
\end{array}
}\right)$ = $\left(\vphantom{
\begin{array}{cc}
-.6 & .8 \\
-.8 & -.6
\end{array}
}\right.$$\begin{array}{cc}
-.6 & .8 \\
-.8 & -.6
\end{array}$$\left.\vphantom{
\begin{array}{cc}
-.6 & .8 \\
-.8 & -.6
\end{array}
}\right)$$\left(\vphantom{
\begin{array}{cc}
-5.0 & -4.0 \\
0 & -3.0
\end{array}
}\right.$$\begin{array}{cc}
-5.0 & -4.0 \\
0 & -3.0
\end{array}$$\left.\vphantom{
\begin{array}{cc}
-5.0 & -4.0 \\
0 & -3.0
\end{array}
}\right)$ 

The two matrices Q and A = QR have the same column spaces. Observe, in the following example, that the columns of A are linear combinations of the columns of Q. Then, since both column spaces have dimension 2 and one contains the other, it follows that they must be the same space.


\begin{example}
The
preceding product comes from the
following linear combinat...
...{array}{c}
.8 \\
-.6
\end{array}
\right)
\end{displaymath}
\end{example}

This conversion of the columns of A into the orthonormal columns of Q is referred to as the Gram–Schmidt orthogonalization process. In general, since R is upper-right triangular, the subspace spanned by the first k columns of the matrix A = QR is the same as the subspace spanned by the first k columns of the matrix Q.