Cholesky and Positive-Definiteness

The square root of a matrix, when one exists. Push the correlation too far and the factorisation fails — which is the test.

Cholesky and Positive-Definiteness

This module needs JavaScript: the numbers are computed in the page rather than recorded.

Worth knowing

C = L L' with L lower triangular. It is the closest thing a matrix has to a square root.
It exists exactly when the matrix is positive definite — every eigenvalue strictly greater than zero.
Multiply independent standard normals by L and they come out with covariance exactly C. That is how correlated noise is generated.
Push the correlation past ±1 and the factorisation fails. The failure is the diagnosis, and it is cheap.

Overview

Positive definiteness

A real symmetric matrix A is positive-definite when xᵀAx > 0 for every nonzero x. Geometrically, its quadratic form is an upward bowl in every direction. Positive-definiteness implies positive eigenvalues and makes many optimisation and probability calculations well behaved.

The Cholesky factorisation writes A = LLᵀ, where L is lower triangular with positive diagonal entries. For a 2 × 2 example, A = [[4, 2], [2, 3]] factors as L = [[2, 0], [1, √2]], since LLᵀ = A. Solving Ax = b then becomes two triangular solves rather than a general matrix solve.

In this guide
  1. Where it is used—and where it fails
  2. Check a quadratic form and factorisation
  3. Try this above
  4. Sources and next steps

Cholesky Factorisation and Positive Definiteness

A symmetric positive-definite matrix factors as LLᵀ, enabling efficient solves and correlated sampling.

Where it is used—and where it fails

Cholesky is used to sample multivariate normal data and to solve symmetric positive-definite systems. A covariance matrix is positive semidefinite in exact arithmetic; it may be singular when variables are redundant, so ordinary Cholesky can fail. Round-off or noisy estimates can also make a theoretically valid matrix appear slightly indefinite. Diagnose the matrix and the model before adding a small diagonal term; regularisation changes the problem.

See covariance and correlation, matrix transformations, and QR decomposition for related tools.

Check a quadratic form and factorisation

For A=[[4,2],[2,3]], the quadratic form is xᵀAx=4x₁²+4x₁x₂+3x₂². Its Cholesky factor is L=[[2,0],[1,√2]], since multiplying LLᵀ recovers A. To solve Ax=b, first solve Ly=b, then Lᵀx=y; triangular solves are cheaper than a general solve and avoid explicitly computing A⁻¹.

Positive-definite is stronger than having positive diagonal entries. A real symmetric A is positive-definite when xᵀAx>0 for every nonzero x; equivalently, all eigenvalues are positive. A positive-semidefinite covariance matrix allows zero in some directions and can be singular, so standard Cholesky may fail even though no direction has negative variance. Small rounding errors can also produce tiny negative eigenvalues in an estimated covariance. Before adding a diagonal “jitter” term, check the data and units: this changes the matrix and therefore the model. Cholesky is efficient when its assumptions hold; QR handles a broader class of least-squares problems.

Try this above

Adjust the matrix entries until the quadratic form stops being positive in every direction. Compare the positive-definite case with a singular or indefinite example.

For a symmetric 2×2 matrix [[a,b],[b,c]], positive definiteness requires a>0 and ac−b²>0. In the example, a=4 and determinant=12−4=8, so both conditions hold. A matrix can have positive diagonal entries and still be indefinite if its off-diagonal entries are too large. In higher dimensions, checking all leading principal minors is possible in exact arithmetic, while Cholesky failure is a practical diagnostic. Always check symmetry as well: the standard factorisation assumes it.

In multivariate normal sampling, if z has independent standard-normal entries and A=LLᵀ, then x=μ+Lz has covariance A. This is one reason the factorisation is useful: it transforms independent noise into variables with the desired covariance. If A is only semidefinite, a lower-rank factor may still generate a distribution confined to a subspace, but ordinary Cholesky may reject it. The covariance and the intended support should be checked before selecting a factorisation.

Sources and next steps

Check yourself

0 of 3

Answer without scrolling back up.

  1. When does a Cholesky factorisation exist?

  2. How do you generate samples with a given covariance C?

  3. Why is attempting a Cholesky the standard positive-definiteness test?

Cheat sheet

Cholesky and Positive-Definiteness

Factor a positive-definite matrix into a lower triangle times its transpose. Watch the decomposition break when definiteness fails.

MATHS · vizlearn.in/maths/cholesky_and_positive_definiteness.html

About the author

Ashish Jangra builds and maintains VizLearn. Every module here is written and the visualisation behind it hand-built, so the numbers in a readout come from the same code that draws the picture. Corrections are genuinely welcome and get priority over everything else — if a page states something wrong, or an animation misrepresents what the algorithm does, get in touch.

Teaching a course with this? Individual teachers can use it freely; for a whole department or programme, see institutional licences.