Interactive Cholesky Decomposition Calculator
Enter a square, symmetric, positive-definite matrix A. The calculator computes a lower-triangular matrix L such that A = L LT.
4 12 -16 on the first line, and so on.What Is Cholesky Decomposition?
Cholesky decomposition is a matrix factorization technique used for special matrices: those that are symmetric and positive definite. If matrix A satisfies these conditions, it can be factorized as:
A = L LT
Here, L is a lower triangular matrix, and LT is its transpose. This decomposition is computationally efficient and numerically stable for many practical applications in scientific computing, statistics, machine learning, and engineering.
How to Use This Calculator
- Enter your matrix in the input area.
- Use one row per line.
- Separate values with spaces or commas.
- Click Compute Decomposition.
The result section displays:
- The lower-triangular matrix L
- A reconstructed matrix L LT for validation
- Maximum reconstruction error
- Determinant of A computed from L
Why Cholesky Is Useful
1) Faster Linear Solves
For systems of equations of the form Ax = b where A is symmetric positive definite, using Cholesky is usually faster than generic LU decomposition. You solve two triangular systems instead of one full system.
2) Numerical Methods and Optimization
In optimization routines, covariance estimation, and least-squares formulations, Cholesky appears constantly. It is often used in interior-point methods, Kalman filters, and Gaussian process regression.
3) Statistical Computing
Covariance matrices are usually symmetric positive definite (or semidefinite). Cholesky factorization helps with simulation, density evaluation, and transformation of correlated normal variables.
Input Requirements and Common Errors
Matrix must be square
If your matrix has different numbers of rows and columns, factorization is not possible in this form.
Matrix must be symmetric
Entries must satisfy aij = aji. Even small formatting mistakes can break symmetry.
Matrix must be positive definite
All leading principal minors should be positive, and all pivots in Cholesky must remain positive. If any diagonal update becomes zero or negative, decomposition fails.
Quick Worked Example
For:
A = [ [4, 12, -16],
[12, 37, -43],
[-16, -43, 98] ]
The decomposition is:
L = [ [2, 0, 0],
[6, 1, 0],
[-8, 5, 3] ]
And indeed L LT reconstructs the original matrix exactly.
Practical Tips
- Roundoff error is normal for floating-point arithmetic.
- Use reasonable scaling if entries vary wildly in magnitude.
- If decomposition fails, test whether your matrix is truly positive definite.
- For near-singular matrices, consider regularization (e.g., adding a small value to the diagonal).
Conclusion
This Cholesky decomposition calculator gives you a fast way to factor symmetric positive-definite matrices and verify your result immediately. Whether you are studying numerical linear algebra, building machine learning pipelines, or debugging optimization code, this tool helps you move from theory to practical computation quickly.