Positive Semidefinite Matrices
The matrices that make quadratic forms non-negative, equivalent tests via eigenvalues, pivots and principal minors, the Cholesky factorization that generates correlated risk, and why every valid covariance matrix must be PSD.
Prerequisites: Linear Algebra for Quants, Eigenvalues & Eigenvectors
Positive semidefinite matrices are the ones for which the quadratic form is never negative, and that innocuous property is the linchpin of quantitative finance. It is exactly the condition a covariance matrix must satisfy (no portfolio can have negative variance), the condition that makes an optimization problem Convex Optimization and hence solvable, and the condition that lets you factor a matrix to simulate correlated returns. When a risk system throws "matrix not positive definite", it is this property that broke, and knowing the equivalent characterizations is what lets you diagnose and fix it.
Definition and the hierarchy
A symmetric matrix is:
- Positive semidefinite (PSD), written , if for all ;
- Positive definite (PD), , if for all (strict).
The distinction is exactly invertibility: PD matrices have all-positive eigenvalues and are invertible; PSD matrices allow zero eigenvalues, hence can be singular. Symmetry is part of the definition here (the quadratic form only sees the symmetric part anyway). The quadratic form is the object being constrained, and it is the same quadratic form that appears as portfolio variance in Linear Algebra for Quants, which is the whole reason this matters.
Equivalent tests
For a symmetric , the following are equivalent to , and each is a practical test:
- Eigenvalue test. All eigenvalues (strictly for PD). Via the spectral theorem , the form becomes , a non-negative-weighted sum of squares iff all . This is the definitional test and connects directly to Eigenvalues & Eigenvectors.
- Gram / factorization test. for some matrix . Then automatically. Every PSD matrix is a Gram matrix of inner products, which is precisely why covariance matrices are PSD (below).
- Principal minors (Sylvester's criterion). iff all leading principal minors are positive. For PSD, all principal minors (not just leading) must be , a subtle but important difference; checking only leading minors misses PSD-but-not-PD cases.
- Pivots. In symmetric Gaussian elimination (LDL), all pivots are .
For a quick sanity check: a necessary condition is that all diagonal entries are non-negative (variances can't be negative) and the largest entry in absolute value sits on the diagonal. These catch obvious violations but are not sufficient.
Why covariance matrices are PSD
This is the result every quant must be able to prove on demand. Let be a random vector with covariance . For any weight vector , the portfolio has variance because it is the expectation of a square. Variance cannot be negative, so necessarily, it is not an assumption but a theorem. Equivalently, the sample covariance is (with the demeaned data matrix), manifestly of Gram form . A zero eigenvalue means a portfolio with : a riskless linear combination, i.e. a redundant asset or a perfect hedge, exactly what happens when you have more assets than observations (), making the sample covariance singular and un-invertible. This is the concrete reason large-universe mean–variance optimisation fails and needs Shrinkage.
Cholesky: the factorization that generates correlation
For a PD matrix there is a unique lower-triangular with positive diagonal such that the Cholesky decomposition, a specialized, twice-as-fast, numerically stable factorization. Its killer application is simulating correlated Gaussians: draw independent standard normals and set . Then One triangular multiply turns independent noise into a sample with your target covariance, the backbone of Monte Carlo risk and multi-asset pricing. Cholesky is also the standard way to solve (two triangular solves, no explicit inverse) and, as a bonus, its very existence is a PSD test: the algorithm fails (tries to square-root a negative pivot) exactly when the matrix is not PSD. That failure is the "matrix not positive definite" error every risk quant has seen, usually caused by a covariance estimated from mismatched or insufficient data.
Worked example, repairing a broken correlation matrix
You are handed a correlation matrix stitched from three pairwise estimates: Each entry looks plausible, but the trio is inconsistent: A and B are highly positive, both are highly negative with C, yet A–C and B–C can't both be while A–B is . Testing PSD-ness, the smallest eigenvalue is negative, so : there exists a portfolio with negative implied variance, a pure arbitrage artifact of inconsistent inputs. Cholesky would fail on it. The standard repair is eigenvalue clipping: compute , floor the negative eigenvalues at (or a small ), and reconstruct , then rescale the diagonal back to 1. This projects the invalid matrix onto the nearest PSD one, precisely the kind of fix production risk systems apply automatically, and a direct application of the eigenvalue characterization.
Failure modes and subtleties
- PSD vs. PD is invertibility. A singular (PSD, not PD) covariance cannot be inverted, so optimal weights and Mahalanobis distances blow up. The regime guarantees this; shrinkage or factor models restore full rank.
- Estimation destroys PSD-ness sneakily. Pairwise-estimated correlations, different sample windows per pair, or missing-data patchwork routinely produce non-PSD matrices even though the true matrix is PSD. The fix is projection to the nearest correlation matrix (Higham's algorithm), not ignoring it.
- Near-PSD is nearly-singular. A matrix with tiny positive eigenvalues is technically PD but has a huge condition number, so its inverse is noise-amplifying, the same instability as Singular Value Decomposition with small singular values. Regularize (shrinkage, ridge) rather than trusting the raw inverse.
- Sylvester's criterion pitfall. Positive leading minors test PD, not PSD; a matrix can have positive leading minors yet fail PSD if a non-leading minor is negative. For PSD you must check all principal minors (or just the eigenvalues).
- Adding PSD matrices preserves PSD; general sums do not preserve PD invertibility gracefully. (useful: shrinkage stays PSD and becomes PD), but subtracting can break it.
In interviews
"Prove that a covariance matrix is positive semidefinite" is a rite-of-passage question, the one-line answer is . Expect the equivalence drill: list the tests (eigenvalues , Gram form , non-negative principal minors, successful Cholesky) and know the PD-vs-PSD strictness. Cholesky-for-correlated-simulation is a classic applied question ("how do you simulate two correlated normals?", ). A strong follow-up: "your risk system says the covariance matrix isn't positive definite, what happened and what do you do?", inconsistent/insufficient estimation, and eigenvalue clipping or shrinkage to repair. PSD-ness is the hinge between linear algebra and optimisation, so it sets up why convex problems (Convex Optimization) with PSD Hessians are globally solvable.
Practice in interviews
Further reading
- Horn & Johnson, Matrix Analysis
- Boyd & Vandenberghe, Convex Optimization (Appendix A)
- Golub & Van Loan, Matrix Computations