Why is every covariance matrix symmetric positive semidefinite, and when is it singular?
Linear algebra and optimisation, Matrices
Level L2 Elementary. Length Short. Nature Th+Mat Both.
What's being asked
Whether you can prove positive semidefiniteness with a quadratic form instead of by looking at the entries.
Key idea
A symmetric matrix is positive semidefinite (PSD) if for every vector . For a covariance matrix, , because a variance cannot be negative. is singular exactly when some combination (with ) is constant.
Steps
- Start from the definition . It is symmetric because every matrix of the form is symmetric.
- Compute the quadratic form: .
- Say what this means for eigenvalues. If is an eigenvector with eigenvalue , then , so every eigenvalue is at least 0.
- Singular case. has a zero eigenvalue when for some , i.e. the data lie on a flat lower-dimensional surface. Examples: one feature is the sum of two others, or a sample covariance with , whose rank is at most .
- Give the consequence. A singular cannot be inverted, so the Gaussian density and the Mahalanobis distance break. The usual fix is to add a small multiple of the identity, .
Common mistakes
- Arguing “the entries are variances, so it is positive”. Off-diagonal covariances can be negative, and positive entries do not imply PSD.
- Forgetting that a sample covariance with is always singular.
How long your answer should be
3–5 sentences with the one-line proof.
Last checked on 4 December 2026.
Read this
Previous in Linear algebra and optimisation: Why do training pipelines often start with a learning-rate warmup and then decay the learning rate over time?
Next in Linear algebra and optimisation: You minimise by gradient descent with a fixed learning rate , starting from . (a) What is the largest learning rate for which gradient descent converges? (b) What do the iterates do at that learning rate, and above it?