Introduction to QR Decomposition
What you'll learn: How to factor any matrix into a product of an orthogonal matrix and an upper triangular matrix.
The Core Idea
QR decomposition is a way of breaking down a matrix A into two special pieces:
- Q: an orthogonal matrix (whose columns form an orthonormal basis)
- R: an upper triangular matrix (all entries below the diagonal are zero)
In symbols: A = QR
Think of it like decomposing a complex transformation into two simpler steps. First, Q rotates or reflects vectors without changing their lengths (because it's orthogonal). Then R scales and combines components in a very organized, "triangular" way.
Why This Matters
You've already seen Gram-Schmidt orthogonalization and orthogonal projections. QR decomposition packages these ideas into a powerful matrix factorization. The Q matrix contains the orthonormal basis vectors you'd get from applying Gram-Schmidt to the columns of A, and R captures the coefficients needed to express the original columns in terms of this new basis.
The Connection to What You Know
When you apply Gram-Schmidt to the columns of matrix A, you create orthonormal vectors. These become the columns of Q. The upper triangular matrix R stores all the inner products and scaling factors from the Gram-Schmidt process—essentially recording how the original columns relate to the new orthonormal ones.
This factorization is incredibly useful for solving least squares problems efficiently (as you previewed), computing determinants, finding eigenvalues, and more.
Key Takeaway: QR decomposition factors any matrix A into A = QR, where Q has orthonormal columns and R is upper triangular, directly encoding the Gram-Schmidt orthogonalization process in matrix form.