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 v⊤Σv≥0 for every vector v. For a covariance matrix, v⊤Σv=Var⁡(v⊤x)≥0, because a variance cannot be negative. Σ is singular exactly when some combination v⊤x (with v≠0) is constant.

Steps

  1. Start from the definition Σ=E[(x−μ)(x−μ)⊤]. It is symmetric because every matrix of the form aa⊤ is symmetric.
  2. Compute the quadratic form: v⊤Σv=E[(v⊤(x−μ))2]=Var⁡(v⊤x)≥0.
  3. Say what this means for eigenvalues. If v is an eigenvector with eigenvalue λ, then v⊤Σv=λ∥v∥2≥0, so every eigenvalue is at least 0.
  4. Singular case. Σ has a zero eigenvalue when Var⁡(v⊤x)=0 for some v≠0, 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 n≤d, whose rank is at most n−1.
  5. 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, Σ+ϵI.

Common mistakes

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 f(x,y)=4x2+2y2+5 by gradient descent with a fixed learning rate η, starting from (x0,y0)=(−1,2). (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?