Start with the task: solving a square system, fitting an overdetermined one, or understanding what the matrix does. Then let the shape and symmetry of the matrix choose among LU, Cholesky, QR, the spectral decomposition and the SVD.
When to use this
A matrix problem that a factorization would make easier, and a choice among the five decompositions. Look at two things: what you must compute, and whether the matrix is square, symmetric or positive definite.
Decision tree
The same tree, written out
1You must solve a square system Ax=b, often for many right-hand sides, and A is symmetric positive definite.Use the Cholesky decompositionA=LLT: about half the work of LU and no pivoting needed.
2You must solve a square system and A is not symmetric positive definite.Use the LU decomposition, with row swaps PA=LU when a pivot is zero.
3You have more equations than unknowns and want the least-squares solution.Use the QR decomposition and solve Rx^=QTb; by hand, the normal equations work too.
4The matrix is symmetric and you need its eigenvalues, its principal axes, a quadratic form or a function of the matrix.Use the spectral decompositionA=QDQT. For a square matrix that is not symmetric, use diagonalization instead.
5The matrix has any shape and you need its rank, its 2-norm, a pseudoinverse or the best low-rank approximation.Use the SVDA=UΣVT; it exists for every matrix.