Skip to content
nonconvexcard

Sample Covariance and the Marchenko–Pastur Law

What the spectrum of an empirical covariance matrix looks like when the dimension is comparable to the sample size, and why that breaks classical statistics.

Random MatricesGraduate⏱ 3 hours6 min readmarchenko-pastursample covariancespectrumaspect ratioconditioning
5 problems →

The law

TheoremMarchenko–Pastur law

Let X∈Rn×pX \in \R^{n\times p} have i.i.d. entries with mean 00 and variance σ2\sigma^2, and set Σ^=1nX⊤X\hat\Sigma = \frac1n X^\top X. Suppose n,p→∞n,p\to\infty with p/n→λ∈(0,∞)p/n \to \lambda \in (0,\infty). Then the empirical spectral distribution of Σ^\hat\Sigma converges weakly, almost surely, to the Marchenko–Pastur law μMP\mu_{MP}, which has

  • density ρλ(x)=(b−x)(x−a)2πσ2λx\displaystyle \rho_\lambda(x) = \frac{\sqrt{(b-x)(x-a)}}{2\pi\sigma^2\lambda x} on [a,b][a,b], where a=σ2(1−λ)2a = \sigma^2(1-\sqrt\lambda)^2 and b=σ2(1+λ)2b = \sigma^2(1+\sqrt\lambda)^2;
  • plus an atom of mass 1−1/λ1 - 1/\lambda at 00 when λ>1\lambda > 1.

The proof (via the Stieltjes transform s(z)=∫(x−z)−1dμ(x)s(z) = \int (x-z)^{-1}d\mu(x), which satisfies a quadratic self-consistent equation in the limit) is in the references and is not reproduced here.

PropositionThe density integrates to one

For λ∈(0,1]\lambda \in (0,1] and σ=1\sigma = 1, ∫abρλ(x) dx=1\int_a^b \rho_\lambda(x)\,dx = 1.

PropositionBulk edges and conditioning

With σ=1\sigma = 1 and λ=p/n≤1\lambda = p/n \le 1, the extreme eigenvalues of Σ^\hat\Sigma satisfy, almost surely in the limit,

λmax⁡(Σ^)→(1+λ)2,λmin⁡(Σ^)→(1−λ)2,\lambda_{\max}(\hat\Sigma) \to (1+\sqrt\lambda)^2, \qquad \lambda_{\min}(\hat\Sigma) \to (1-\sqrt\lambda)^2,

so the condition number satisfies

κ(Σ^)→(1+λ1−λ)2.\kappa(\hat\Sigma) \to \left(\frac{1+\sqrt\lambda}{1-\sqrt\lambda}\right)^2 .

Key idea

Put numbers in. At λ=0.01\lambda = 0.01 (n=100pn = 100p), κ≈1.5\kappa \approx 1.5 — the sample covariance is essentially as well conditioned as the truth. At λ=0.5\lambda = 0.5, κ≈34\kappa \approx 34. At λ=0.9\lambda = 0.9, κ≈1500\kappa \approx 1500. At λ=1\lambda = 1 the smallest eigenvalue reaches 00 and Σ^\hat\Sigma is singular. Every method that inverts a sample covariance — ordinary least squares, linear discriminant analysis, Gaussian maximum likelihood, Newton's method on a quadratic — degrades along exactly this curve, and the degradation is not a numerical artefact but the true geometry of the estimate.

Run it: Marchenko–Pastur lawEigenvalues of a sample covariance matrix against the Marchenko–Pastur density for aspect ratio λ = p/n.
CorollaryRecovering the classical limit

As λ↓0\lambda \downarrow 0 the support [(1−λ)2,(1+λ)2][(1-\sqrt\lambda)^2,(1+\sqrt\lambda)^2] shrinks to {1}\{1\}, so μMP⇒δ1\mu_{MP} \Rightarrow \delta_1. This is the classical statement: for pp fixed and n→∞n\to\infty, Σ^→Ip\hat\Sigma\to I_p and all eigenvalues converge to 11.

What the law does not describe

Empirical observationReal covariance spectra are not Marchenko–Pastur

Empirical observation — a regularity seen in experiments. No theorem on this page establishes it in general.

Plot the eigenvalue histogram of the covariance of a real dataset — word embeddings, gene expression, daily asset returns — and it will typically show a Marchenko–Pastur-like bulk plus a small number of large outlying eigenvalues. The bulk is well described by the law; the outliers are not, and they are usually the interesting part.

What this does not say

The theorem above assumes the population covariance is σ2Ip\sigma^2 I_p — no signal at all. Real data has signal, and the relevant model is the spiked covariance model: Σ=Ip+∑k=1rhkvkvk⊤\Sigma = I_p + \sum_{k=1}^r h_k v_kv_k^\top with rr small. There, the correct statement is the Baik–Ben Arous–Péché phase transition: a spike of strength hh is detectable in the sample spectrum if and only if h>λh > \sqrt\lambda, and below that threshold the corresponding sample eigenvalue is absorbed into the bulk and the sample eigenvector is asymptotically uncorrelated with vkv_k.

That is a sharp and somewhat brutal statement: there is a signal strength below which no amount of eigen-analysis recovers the direction, not because the estimator is bad but because the information is not in the sample. It is quoted here from the reference and is a separate theorem, not a corollary of the Marchenko–Pastur law.

Problems

Marchenko–Pastur edges and conditioningNumerical · Beginner · 15 min The Marchenko–Pastur density integrates to oneProof · Advanced · 1 hour Simulate the Marchenko–Pastur lawCoding · Intermediate · 1 hour Why ordinary least squares degrades as p approaches nProof · Advanced · 30 min

References

These works are cited as sources to read, not reproduced. All exposition, examples and problems on this site are written independently; where an argument is standard, the citation points to a canonical treatment.

Results stated on this page

Experiments

Problems (5)

All problems