Numbers & Math

Matrix Decomposition Methods

LU, QR, SVD, eigendecomposition, Cholesky — what each does and when to use it.

Decompositions

NameFormApplies toUsed for
LUA = L · U (or P · L · U)Square, usually invertibleSolving Ax = b; determinant
CholeskyA = L · LᵀSymmetric positive-definiteFast Ax = b for SPD
QRA = Q · RAny (even rectangular)Least squares, numerical stability
EigendecompA = P · D · P⁻¹Diagonalizable squarePCA (via covariance), dynamics
SVDA = U · Σ · VᵀAny matrixPCA, pseudo-inverse, low-rank approx
SchurA = Q · T · Qᵀ (T triangular)SquareStable eigenvalue computation
HessenbergA = Q · H · QᵀSquareFirst step of QR eigenvalue algorithm
JordanA = P · J · P⁻¹Any square (defective okay)Theoretical; numerically unstable

Picking one

  • Solve Ax = b once: LU.
  • Solve Ax = b many times: factor once, forward/back-substitute per b.
  • Symmetric positive-definite (covariance, Gram matrices): Cholesky — ~2× faster than LU.
  • Least squares: QR (normal equations are less numerically stable).
  • Rank, null space, low-rank approx: SVD.
  • PCA: SVD of centered data, or eigendecomposition of covariance.
Was this article helpful?