QR factorization
- Let \(A\) be a square full rank matrix. \(A=QR\)
- \(Q\) is an orthonormal basis for the column-space of \(A\). \(R\) is upper triangular.
- This tells us that the columns of \(Q\) are such that the first \(k\) columns of \(Q\) are all that is needed to make the \(k\) -th column of \(A\).
- You can make \(Q\) using Gram-Schmidt. Take the first column of \(A\) and make it the first basis vector. Take the second column, subtract off the projection onto the first one, and so on.
- You can make \(R\) column by column. The first column only needs to scale the first basis vector. The second column needs to use the first two basis vectors to make the second column of \(A\). But from above, the second column of \(A\) is just composed of a component parallel to the first, and a component that is not. So we just need to combine the first two basis vectors which are these components exactly.