Level 0: Foundation
★☆☆☆☆ Introductory⏱ 5 minGeneral audience. No mathematics required.Break a hard job into easy steps
The number 15 is . Breaking things into simpler pieces that multiply back together is called factoring. Matrices can be factored too, into pieces that are much easier to work with:
- Staircase (triangular) matrices, which you can solve one step at a time, like walking down stairs. That’s LU.
- Pure rotations times a staircase. That’s QR.
- A “square root” of a matrix, like . That’s Cholesky.
The beauty is that you do the hard work of factoring once, then answer many questions quickly. It’s like sorting your toolbox once so every later job is fast.
- 1. 15 = 3 × ?
- 2. The square root of 16 is…
- 3. Why factor once?
Level 1: Beginner
★★☆☆☆ Basic⏱ 15 minSecondary-school mathematics: arithmetic and elementary algebra.LU: elimination, written down
Gaussian elimination (A2.2-4) records its multipliers in and leaves an upper-triangular :
The multiplier was , and . Watch elimination build :
| 1 | 1 | 1 | 6 |
| 0 | 2 | 5 | -4 |
| 2 | 5 | -1 | 27 |
Cholesky: a matrix square root
A positive definite matrix splits as , with lower triangular:
Here , , and .
QR: orthonormal columns times a staircase
holds an orthonormal version of ’s columns, made by Gram–Schmidt (A2.4), and records how to rebuild the original columns.
- 1. LU of [[2, 1], [4, 5]]: u₂₂ = ?
- 2. Cholesky of [[4, 2], [2, 5]]: l₂₂ = ?
- 3. The columns of Q in QR have length…
Level 2: Intermediate
★★★☆☆ Intermediate⏱ 40 minUndergraduate students and practising engineers.Which factorization when?
| Factorization | Needs | Cost () | Main uses |
|---|---|---|---|
| square, invertible | general linear systems, determinants | ||
| symmetric PD | (half of LU) | covariances, Gaussian processes, Kalman filters, normal equations, sampling | |
| any () | (Householder, square) | least squares, orthonormal bases, eigenvalues (QR algorithm) |
After factoring, each new right-hand side costs only (two triangular solves).
Least squares with QR
To minimize , write . Then the solution solves . The tempting alternative, the normal equations , squares the condition number: . On a badly conditioned fit, QR keeps about 9 correct digits where the normal equations keep about 1 (Practice Code 3).
Navigation filters on spacecraft and drones often store the Cholesky factor of the covariance instead of the covariance itself. These are “square-root” filters. The factor can never lose positive definiteness through rounding, and it keeps about twice the precision. Apollo-era engineers adopted square-root forms for exactly this reason (Bierman, 1977).
- 1. Which factorization requires a positive definite matrix?
- 2. Cholesky costs roughly ___ of LU.
- 3. Why prefer QR over the normal equations?
Level 3: Advanced
★★★★☆ Advanced⏱ 45 minGraduate level, with full derivations and proofs.Existence and uniqueness
(1) Every invertible has , with unit lower triangular. (2) Every symmetric PD has a unique with . (3) Every with independent columns has a unique with .
Proof sketch of (2). Match entries of in order. Column 1 gives and . The remaining block must equal the Schur complement , which is again PD (A2.3-3), so induction finishes. Every square root taken is of a positive number. If isn’t PD, some step needs . That’s why trying Cholesky is the fastest practical PD test.
Householder reflections
A Householder reflector is symmetric, orthogonal, and its own inverse. With , it maps to , zeroing a whole column at once. Applying of them gives , so . Because each step is an exact orthogonal map, the computed is orthogonal to machine precision. Classical Gram–Schmidt doesn’t have this property.
Stability matters
Mathematically, classical Gram–Schmidt, modified Gram–Schmidt and Householder all give the same . Numerically, on a Vandermonde matrix with :
| Method | |
|---|---|
| classical Gram–Schmidt | about 2 (orthogonality completely lost) |
| modified Gram–Schmidt | about |
| Householder (LAPACK) | about |
You’ll reproduce this in Exercise 2.
Exercise 3.1: Show that a Householder reflector has determinant −1
fixes the -dimensional hyperplane perpendicular to (eigenvalue 1, times) and sends (eigenvalue −1). So .
- 1. Cholesky fails on a symmetric matrix exactly when it is…
- 2. A Householder reflector H satisfies H² = …
- 3. κ(AᵀA) = ?
Level 4: Expert
★★★★★ Expert⏱ 35 minResearchers: original papers and open problems.Factorizations at the heart of applications
- Gaussian processes. Prediction needs and . Both come from one Cholesky factor: . That’s , which is why GPs on large data need sparse or approximate methods (I2). Practice Code 5 builds a tiny GP.
- SLAM and bundle adjustment. Each Gauss–Newton step solves a sparse least-squares problem by sparse Cholesky or QR. iSAM2 updates the factorization incrementally as new measurements arrive, instead of refactoring from scratch (T3).
- Recursive least squares and adaptive control. QR updates (Givens rotations) let estimates be refreshed one measurement at a time with guaranteed stability.
- Eigenvalues. The QR algorithm repeatedly factors and sets . These are similar matrices that converge to triangular form, revealing the eigenvalues (A2.3-1).
Research directions
- Communication-avoiding and randomized factorizations. On modern hardware, moving data costs more than arithmetic. Tall-skinny QR (TSQR) and randomized QR/LU with sketching (Martinsson and Tropp, 2020) minimize data movement and scale to huge matrices.
- Mixed precision. Factor in fast low precision on tensor cores, then refine (A2.2-4). The same idea is now used to accelerate scientific simulations and GP training.
References
- A.-L. Cholesky (c. 1910, published by Benoît 1924). “Note sur une méthode de résolution des équations normales…” Bulletin Géodésique, 2.
- A. S. Householder (1958). “Unitary triangularization of a nonsymmetric matrix.” Journal of the ACM, 5(4).
- G. Golub (1965). “Numerical methods for solving linear least squares problems.” Numerische Mathematik, 7.
- G. Bierman (1977). Factorization Methods for Discrete Sequential Estimation. Academic Press.
- M. Kaess et al. (2012). “iSAM2: Incremental smoothing and mapping using the Bayes tree.” IJRR, 31(2).
- P.-G. Martinsson and J. Tropp (2020). “Randomized numerical linear algebra: Foundations and algorithms.” Acta Numerica, 29.
- L. Trefethen and D. Bau (1997). Numerical Linear Algebra. SIAM. Lectures 7–11, 20–23.