Understanding Matrix Factorization
Matrix factorization expresses a single matrix as a product of two or more matrices, analogous to factoring numbers. Just as 12 = 3 × 4, we can decompose matrix A into L × LT. This technique transforms hard problems into simpler ones by exploiting the structure of the resulting factors.
Different matrix types demand different decompositions. The Cholesky method applies exclusively to symmetric positive definite matrices—a restricted but highly practical class. Matrices meeting these criteria guarantee a unique lower triangular factor, making the decomposition numerically stable and computationally efficient.
Real-world applications include:
- Solving systems of linear equations via forward substitution
- Computing matrix inverses without dense pivoting
- Generating correlated random variables in Monte Carlo methods
- Optimisation algorithms requiring Hessian factorization
The Cholesky Decomposition Formula
For a symmetric positive definite matrix A, the Cholesky decomposition finds a lower triangular matrix L such that:
A = L · LT
The elements of L are computed row by row using:
Li,j = (Ai,j − Σk=1j−1 Li,k · Lj,k) ÷ Lj,j for i > j
Lj,j = √(Aj,j − Σk=1j−1 Lj,k2)
Calculations proceed from top-left to bottom-right, with each diagonal element determined before the entries below it.
A— The input symmetric positive definite matrixL— The lower triangular matrix such that A = L · L<sup>T</sup>L<sub>i,j</sub>— Element at row i, column j of matrix LA<sub>i,j</sub>— Element at row i, column j of matrix A
Requirements for Cholesky Decomposition
Not every matrix admits a Cholesky factorization. Two strict conditions must be met:
Symmetry: The matrix must equal its own transpose, so Ai,j = Aj,i for all entries. This automatically implies the matrix is square. Asymmetric or rectangular matrices cannot be Cholesky-decomposed.
Positive Definiteness: All eigenvalues must be strictly positive. Equivalently, zT · A · z > 0 for every non-zero vector z. Matrices with zero or negative eigenvalues will cause the algorithm to fail—typically when attempting to take the square root of a non-positive number.
If either condition fails, no lower triangular matrix L exists satisfying A = L · LT. The calculator will flag this and refuse to proceed.
Common Pitfalls and Practical Notes
Avoid these frequent mistakes when working with Cholesky decomposition:
- Ignoring symmetry checks — Floating-point rounding can introduce tiny asymmetries in matrices that should be symmetric. Always verify off-diagonal elements match to at least 10 significant figures before decomposing. Even 1e−14 discrepancies may cause failure in larger matrices.
- Confusing positive definiteness with non-negativity — A matrix with all non-negative entries is not necessarily positive definite. Only eigenvalue analysis confirms positive definiteness. A diagonal matrix with a zero on the diagonal, for example, fails despite having non-negative entries.
- Attempting decomposition on non-square matrices — Cholesky strictly requires square input. Rectangular matrices demand other factorizations like QR or SVD. Similarly, matrices derived from least-squares problems should use QR decomposition, not Cholesky.
- Numerical instability with poorly conditioned matrices — When eigenvalues span many orders of magnitude (high condition number), small input perturbations amplify dramatically in the result. Consider iterative refinement or regularisation if your application is sensitive to accuracy.
Using the Calculator
Select your matrix dimension—2×2, 3×3, or 4×4—from the dropdown menu. Enter the matrix elements row by row into the input grid. The calculator will automatically check for symmetry and positive definiteness.
If both conditions are satisfied, the lower triangular matrix L appears below. The diagonal and sub-diagonal elements fully determine L; all other entries are zero.
For verification, multiply L by its transpose to recover your original matrix A (within floating-point tolerance). This self-check confirms the computation.
If an error message appears, review your matrix for asymmetry or verify that all eigenvalues are positive using eigenvalue software. Adjust the input and retry.