SStatistics, Built

Stage IV · PhD Core

Part 52 of 65

High-Dimensional Statistics

PhDstarts at this level53 min of film13 chaptersprerequisites: Part 31, Part 32, Part 51

What can be estimated, and how fast, when parameters outnumber observations?

The part opens with principal components on pure noise: a thousand observations of five hundred independent variables have sample eigenvalues from 0.085 to 2.92 where every true eigenvalue is 1. It first proves what Part 32 showed by experiment. The lasso's oracle inequality follows from the basic inequality, the cone and a restricted eigenvalue; the primal-dual witness says when the signed support is recovered; decomposable regularizers give one theorem for sparse, group and low-rank problems, and matrix completion is worked on a rank-3 matrix. The part then turns to covariance. Banding, thresholding and Ledoit-Wolf beat the sample covariance, Davis-Kahan bounds an eigenvector's rotation by the perturbation over the gap, and the Stieltjes transform gives the Marchenko-Pastur and semicircle laws. In the spiked model a signal below the square root of p/n is invisible to PCA and above it the top eigenvalue is biased by a known map (BBP), read on Harman's 24 tests; the edge fluctuates on the Tracy-Widom scale, which calibrates Roy's test. It ends with sparse PCA and its computational barrier, neighbourhood selection, and the debiased lasso on the diabetes data with its caveats stated.

What you need. Part 31's PCA and Part 32's lasso as methods, Part 51's concentration and Gaussian comparison, and complex analysis at the level of a contour and an imaginary part (the Stieltjes transform).

Hook
PCA finds structure in noise
Mathematics
oracle inequalities, the primal–dual witness, decomposable regularizers, low-rank recovery, covariance and Davis–Kahan, random matrices (MP, BBP, TW), sparse PCA
Built
the random-matrix lab

What you will be able to do

Bachelor's

  • Explain why PCA on pure noise shows large and small eigenvalues when p is comparable to n, and what the Marchenko-Pastur edges say about them.

Master's

  • Compute the Marchenko-Pastur edges, the BBP limit of a spiked eigenvalue and the eigenvector overlap, and invert the map to correct a sample eigenvalue.
  • Apply Davis-Kahan to bound an eigenvector's error from an operator-norm error and an eigengap.

PhD

  • Prove the lasso's oracle inequality from the basic inequality, the cone condition and a restricted eigenvalue, and state what it does not give.
  • Construct the primal-dual witness and derive the sample-size threshold for signed support recovery.
  • Derive the Marchenko-Pastur law from the fixed-point equation of its Stieltjes transform, and state the BBP transition and the Tracy-Widom limit.

Practice

  • Report a debiased-lasso interval with its target, its sparsity condition and its unvalidated finite-sample coverage stated.
  • Test for a spike with Roy's largest root on the Tracy-Widom scale rather than a normal test, and correct a spiked eigenvalue before interpreting it.

Contents

Each chapter has a home level. Choose a track to see what to read and watch: Bachelor's 6 min · Master's 15 min · PhD 53 min · Practice 15 min.

  1. 0Noise with structureBachelor's4 min
  2. 1The lasso's oracle inequalityPhD5 min
  3. 2Support recoveryPhD4 min
  4. 3Decomposable regularizersPhD4 min
  5. 4Low-rank recovery and matrix completionPhD4 min
  6. 5Covariance estimationPractice4 min
  7. 6Perturbation theoryPhD4 min
  8. 7Random-matrix lawsPhD4 min
  9. 8Spiked models and the BBP transitionPhD4 min
  10. 9Tracy-Widom fluctuationsPhD4 min
  11. 10Sparse PCA and graphical modelsPhD4 min
  12. 11Inference: the debiased lassoPractice6 min
  13. Recap, problems, and the road aheadAll tracks2 min

Also on this page: Lecture · Key results · Try it · Lab · Problems · Notes and sources · Build the film.

Lecture

The text of each chapter is the film's narration, as it is spoken, so you can read along or revise without the film. The pictures are in the film. A dashed box stands for a number the film computes when it is rendered (hover over it to see what is computed); the README's figures for each chapter, where it lists them, follow the chapter's text.

Noise with structureBachelor's4 min

Take a thousand people and measure five hundred things about each, but make every measurement pure noise. Every variable is independent of every other, with variance one: there is no structure at all. Now run principal components. The top component has a variance of two point nine two, nearly three times what any direction truly has, and the bottom one a variance of point zero nine. A naive reading finds a strong first factor and a set of nearly collinear directions. Both are artefacts of having half as many variables as observations, and the Marchenko–Pastur law of Part fifty-one predicts their limiting scale; the finite-sample extremes fluctuate.

The spectrum, drawn with this part's random-matrix lab, the SpectrumBulk. The truth: all five hundred eigenvalues are exactly one. The sample's five hundred eigenvalues spread from to . The Marchenko–Pastur density, with edges at one minus root a half, squared, and one plus root a half, squared, closely traces this histogram. Its edges are asymptotic limits, not exact finite-sample extrema. Any analysis in high dimension has to begin by knowing what noise alone does to a spectrum.

The scree table a careless analyst would report. The first five components have sample variances from down to , when every true variance is one. The first component appears to explain percent of the variance, against a true share of point two percent, about times too much. And its loadings point in a uniformly random direction: interpret them, and you are interpreting noise.

And the loadings: the top eigenvector's entries for the first forty of the five hundred variables. The white lines mark plus and minus two over root p, the spread of a uniformly random unit vector's coordinates. The loadings scatter inside them, with of the five hundred above point oh nine. A report might say the first factor is driven by variables , and . But this direction is uniformly random: by symmetry, pure noise has no preferred direction, so the unoriented leading eigenvector spans a uniformly random line. Choosing its sign orients it to a hemisphere; it does not create a preferred line.

The questions of this part, for problems in which parameters outnumber observations. How fast can a sparse regression be estimated, and which of its variables can be found? How well can a covariance matrix, or a low-rank matrix with most entries missing, be recovered? When is a real spike in a spectrum visible at all? And how do you put a confidence interval on anything, after all that selection?

Three promises come due. Part thirty-two showed the lasso finding sparse signals, but only by experiment; chapters one to three prove when and how fast it works. Part thirty-one's principal components assumed few variables and many observations; chapters six to ten study spectra when the ratio is fixed, and find a threshold below which ordinary PCA has vanishing directional overlap in the proportional limit. And Part fifty-one built the probability; here it becomes the proofs.

Numbers: n = 1,000, p = 500: eigenvalues 0.085 to 2.92 (MP edges 0.086, 2.914); top share 0.59% vs 0.20%

1The lasso's oracle inequalityPhD5 min

The lasso's oracle inequality: as good as knowing the support, up to a log p.

The setting: a linear model with many more coefficients than observations, of which only s are non-zero. An oracle who knew the support would fit least squares on those s variables, with squared coefficient error of that order when the support covariance is well conditioned. The lasso does not know the support. It minimizes the squared error plus lambda times the l-one norm. The claim, proved by Peter Bickel, Ya'acov Ritov and Alexandre Tsybakov in 2009: under a positive restricted eigenvalue, normalized design columns and a sufficiently large noise-calibrated penalty, its squared error is of order sigma squared s log p over n, with a curvature-dependent constant. Not knowing which s of the p variables matter costs only a factor of log p.

The key step. If lambda is at least twice the largest correlation between the noise and a column, the error vector lies in a cone, where its mass off the true support is at most three times its mass on it. That largest correlation is the maximum of p Gaussians, of size sigma times the root of two log p over n, from Part fifty-one. The restricted eigenvalue, kappa, is the smallest ratio of the prediction error to the coefficient error, over that cone only. With more variables than observations, X transpose X is singular, so some directions are invisible. But the cone can avoid all of them, and then the problem is well-conditioned exactly where the error lives.

The proof fits on one screen. Because the lasso minimizes its objective, comparing it with the truth gives a basic inequality: half the prediction error is at most half lambda times the error's l-one norm, plus lambda times the drop in the penalty. The triangle inequality bounds that drop by the error on the support minus the error off it, which is what forces the cone. On the cone, the restricted eigenvalue turns the prediction error into a coefficient error, and Cauchy–Schwarz turns an l-one norm on s coordinates into root s times an l-two norm. Dividing through: the error is at most three root s lambda over kappa, which with the right lambda is sigma over kappa times the root of s log p over n.

A test: five hundred variables, ten of them non-zero, Gaussian design, and a conditional-Gaussian union-bound penalty with failure probability at most five percent. The purple line is the rate, the root of s log p over n. The lasso's error, in blue, falls from with a hundred observations, fewer than there are variables, to with twelve hundred. Its slope on the log scale is , against the theory's minus a half, and it stays within a constant factor of about of the rate throughout. The number of variables it selects falls from about towards the true ten.

How much does the penalty matter? At four hundred observations, scaling the theory's lambda from an eighth to four times. The smallest error, , comes at times the theory's choice, which selects about variables: the theorem's lambda guarantees the cone on its stated high-probability noise event, but at the price of extra shrinkage. Too small, and noise variables enter by the hundred; too large, and the true coefficients are shrunk towards zero, an error of at four times. In practice lambda is chosen by cross-validation, as in Part thirty-two.

Does a real design satisfy the restricted eigenvalue condition? Garvesh Raskutti, Martin Wainwright and Bin Yu showed in 2010 that for independent Gaussian rows with controlled marginal variances and a positive lower population eigenvalue, the prediction error is at least a quarter of the population quadratic form, minus a term of order log p over n times the squared l-one norm. On the cone, the l-one norm is at most four root s times the l-two norm. So once n is a covariance-dependent constant times s log p, the restricted eigenvalue is at least an eighth of the smallest eigenvalue of the population covariance, with high probability, even for correlated designs. The proof is Gordon's min-max comparison from Part fifty-one.

Numbers: p = 500, s = 10: error 2.91 (n = 100) → 0.89 (n = 1,200), with a conditional-Gaussian 95% noise-event penalty including actual column norms; best tested λ at 0.125 × that conservative penalty

2Support recoveryPhD4 min

Support recovery: finding the right variables, not just a good fit. A small estimation error is not the same as finding the right variables. The stronger goal is exact support recovery: the lasso's non-zero coefficients are exactly the true ones, with the right signs. Peng Zhao and Bin Yu, and independently Hui Zou, found the condition in 2006: the irrepresentable condition. Regress each noise variable on the signal variables, and weight the coefficients by the true signs. The result must be less than one in absolute value: no noise variable may be too well explained by the signals. Strict irrepresentability is central to sign-consistency theorems. A population violation can prevent asymptotic sign consistency under their conditions. It does not rule out recovery for every finite noise realization and every penalty.

Martin Wainwright's primal–dual witness of 2009 is the standard proof. First solve the lasso as if the support were known, and record the signs. Then construct the subgradient on the other coordinates from the optimality conditions. If every one of those is strictly less than one in absolute value, the witness is the lasso solution, and it is unique if the restricted Gram matrix is nonsingular. Recovering the signed support also requires the restricted coefficients to retain the true nonzero signs. Bounding them needs the irrepresentable condition and a union bound over the noise variables. For Gaussian designs the result is sharp: the leading two s log of p minus s threshold arises in specified growing-dimensional isotropic-Gaussian regimes, with beta-min and penalty conditions. It is not a finite-sample sample-size guarantee by itself.

A test of the threshold, with eight true variables. For each problem, we compute the lasso's entire path exactly, by LARS, and ask whether any value of lambda gives exactly the right signed support. Three dimensions, a hundred and twenty-eight, two hundred and fifty-six and five hundred and twelve, plotted against Wainwright's rescaled sample size. At theta one half, success is rare; the observed recovery rates rise near theta two. Thirty successful trials do not establish certainty. At theta one, the three curves are at , and percent. After rescaling, these small experiments illustrate the threshold scale. Searching the full path using the true support is an oracle criterion, not a usable rule for choosing lambda.

And when the condition fails? Three true variables among fifty, four hundred observations. With independent columns, the irrepresentable value is , and the right support appears on the path every time. Now make the fourth, irrelevant column nearly the average of the three true ones: the value becomes , above one, and the right support never appears. Thirty designs of each kind. In this sampled experiment the impostor prevents signed recovery along the path. A population irrepresentability violation is a barrier to asymptotic sign consistency under the relevant conditions. It is not a deterministic statement about every dataset or every lambda. Other penalties require their own assumptions.

Two more requirements stand between the lasso and the right variables. The beta-min condition: every true coefficient must be larger than the noise level, sigma times the root of log p over n, or it is indistinguishable from zero. And whether it holds cannot be checked from the data, because arbitrarily small coefficients can be statistically indistinguishable from zero without an assumed separation. So good prediction and estimation need much less than correct selection. That is why chapter eleven builds confidence intervals that do not depend on selecting the right model.

Numbers: s = 8: P(exact signed support) at θ = 1: 50%, 43%, 40% for p = 128, 256, 512; 0% → 100% from θ = 0.4 to 2; irrepresentable 0.21 (100%) vs 1.51 (0%)

3Decomposable regularizersPhD4 min

Decomposable regularizers: one theorem for sparse, group and low-rank problems. The lasso's proof used two properties, and Sahand Negahban, Pradeep Ravikumar, Martin Wainwright and Bin Yu saw in 2012 that they are all that is needed. Take any loss plus a penalty. Suppose the truth lives in a model subspace: a support for sparse vectors, a pair of row and column spaces for low-rank matrices. The penalty is decomposable if, for a vector in the model subspace and one in the orthogonal complement of a possibly larger tangent subspace, the penalty of the sum is the sum of the penalties. The l-one norm is the example: vectors with disjoint supports have additive l-one norms, which is exactly what forced the lasso's error into its cone.

The theorem uses a pair of nested model and tangent subspaces. For nuclear-norm regularization, the orthogonal component must have both its row and column spaces orthogonal to the model. If lambda is at least twice the dual norm of the loss's gradient at the truth, the error lies in a cone, just as for the lasso. If the loss is strongly convex in the directions of that cone, restricted strong convexity, the general form of the restricted eigenvalue, and if the subspace compatibility constant measures how large the penalty can be relative to the norm on the model subspace, which is root s for the l-one norm on s coordinates, then the error is at most a constant times the compatibility constant times lambda over kappa. The estimation rates covered by these curvature and decomposability conditions follow this pattern.

The theorem's instances, row by row. Sparse regression with the l-one norm: compatibility root s, lambda of order root log p over n, and the lasso's rate. Group sparsity with the group lasso of Part thirty-two: G groups of size m, s g of them active, and a rate with m plus log G in place of log p. Low-rank matrices with the nuclear norm, the sum of singular values: compatibility root two r, and a rate of root r times the dimensions over n. And sparse generalized linear models, where the loss is a log-likelihood and restricted strong convexity replaces the restricted eigenvalue. The same three-line proof, every time.

One instance deserves a closer look, because the loss is not quadratic: l-one-penalized logistic regression, Part twenty-four's model with many predictors. Its curvature is a weighted version of the design's, with weights pi times one minus pi, which vanish when fitted probabilities approach zero or one. So strong convexity can hold only locally, near the truth, and only up to a tolerance term of order log p over n times the squared l-one norm: restricted strong convexity, in the form Negahban and colleagues proved for generalized linear models. Under bounded predictor and parameter conditions giving positive local curvature, and a tolerance small enough to be absorbed on the cone, this yields the root s log p over n rate. Separation or vanishing logistic curvature can invalidate it.

And these are the right rates. s log of p over s, over n, is exactly Part fifty's Fano lower bound for sparse vectors, so the log-p lasso rate is within that logarithmic comparison of the log-p-over-s minimax rate. The distinction matters when sparsity is a large fraction of p. r times the sum of the dimensions, over n, matches the number of free parameters in a rank-r matrix. The price is curvature: if the loss is flat in some direction of the cone, no rate follows. And each estimator is a convex program, so the minimax rates of Part fifty are achieved here by algorithms that run in polynomial time, unlike sparse PCA's, in chapter ten.

Numbers: the instances table: ℓ₁, group, nuclear, sparse GLM

4Low-rank recovery and matrix completionPhD4 min

A matrix of low rank, like a table of ratings that depends on a few tastes, of which we observe a random set of entries. Finding the matrix of smallest rank that agrees with the observed entries is computationally hopeless in general. Maryam Fazel's relaxation replaces the rank by the nuclear norm, the sum of the singular values, which is convex. The analogy is exact: the rank counts the non-zero singular values, as the l-zero norm counts non-zero coefficients, and the nuclear norm adds their sizes, as the l-one norm does. Low rank is sparsity of the spectrum.

Not every low-rank matrix can be completed. A matrix with a single non-zero entry has rank one, but unless that entry is observed, no method can find it. Emmanuel Candès and Benjamin Recht's condition of 2009 rules this out: both row and column singular spaces must be incoherent, spread across the coordinates rather than concentrated on a few. For square matrices under the theorem's incoherence conditions and uniform independent sampling, as later sharpened by Candès and Terence Tao, David Gross and Recht, observing about mu r n log squared n entries at random suffices for the nuclear-norm solution to be exactly the matrix, with high probability. A rank-r matrix has r times n one plus n two minus r free parameters, so this is only a log-squared factor more than counting allows. The proof's key step is matrix Bernstein, from Part fifty-one.

A test: a hundred by hundred matrix of rank three, completed by SoftImpute from Part thirty-two, with a fixed decreasing penalty schedule ending at point oh five and an accelerated proximal solver checked to a normalized fixed-point residual below two times ten to the minus seven. Four trials contribute each plotted median. The gold line marks the degrees of freedom, parameters, percent of the entries: a generic parameter-counting benchmark, not an exact universal finite-matrix recovery threshold. With six percent observed the relative error is ; with fifteen, . At thirty percent the reported finite-penalty relative error is small. It is not exact equality or a convergence certificate. This realization is compatible with substantial recovery above the parameter count; four finite runs do not verify a high-probability recovery theorem.

What it looks like: a sixteen by sixteen table of rank two with percent of its entries seen, the rest grey. The low-rank structure lets the algorithm infer a candidate completion in this realization: SoftImpute fills the table with a relative error of , finite-penalty relative errorly. This was the idea behind the Netflix Prize of 2006 to 2009, where most of a matrix of users' ratings of films was missing.

Real entries are noisy. Then the equality constraint becomes a squared-error loss, and a nuclear-norm penalty yields a SoftImpute-style estimator. The displayed bounded variant also constrains the entry magnitudes, as required for the stated class-wide rate. Vladimir Koltchinskii, Karim Lounici and Alexandre Tsybakov proved in 2011 that under suitable sampling, noise and matrix-class bounds, a nuclear-penalized estimator achieves a per-entry error rate involving the rank, dimensions and a logarithm over the observed sample size. Bounded-entry or spikiness terms and the precise estimator matter; this is not a noise-only guarantee for every low-rank matrix. That is minimax up to the log, and it is the decomposable-regularizer theorem of chapter three again, with the nuclear norm in place of the l-one norm.

Numbers: 100 × 100, rank 3: dof 5.9%; median error 0.779 at 6%, 0.129 at 15%, 0.00478 at 30%; four trials, final λ = 0.05, checked proximal fixed-point residual < 2×10⁻⁷

5Covariance estimationPractice4 min

Covariance estimation: when the sample covariance is the wrong answer. Part fifty-one found that the sample covariance's for bounded-spectrum Gaussian or suitable sub-Gaussian data, the operator error scale includes both root p over n and p over n: useless once the dimension is comparable to the sample size. With more variables than observations it is singular, so everything in Part thirty-one that needs its inverse, the Mahalanobis distance, discriminant analysis, Hotelling's test, breaks. The way out, as for regression, is structure: covariances that are banded, sparse, or close to a simple target. And the price, as always, is that an assumed structure that is wrong gives a confident wrong answer.

Three remedies. For variables with a natural order, like times or positions on a genome, Peter Bickel and Elizaveta Levina's banding of 2008 keeps only the entries near the diagonal. For variables with no order, their thresholding keeps only the entries larger than a constant times the root of log p over n, the size of a pure-noise entry. Over classes of covariances whose entries decay away from the diagonal, both achieve rates that depend on p only through log p. And Olivier Ledoit and Michael Wolf's shrinkage of 2004 pulls the sample covariance towards a multiple of the identity, with the amount estimated in closed form; it imposes a shrinkage target rather than sparsity or ordering. It is positive definite when the shrinkage intensity and target variance are positive; an all-zero dataset is an exception.

A test: two hundred variables with autoregressive correlation , whose covariance has operator norm . The sample covariance's error with fifty observations is , twice the size of the matrix itself. Ledoit–Wolf shrinkage, which assumes nothing about structure, cuts it to . Thresholding, which assumes sparsity, gets , and banding, which assumes the order matters, . The banding and thresholding levels were chosen by an oracle here; in practice, by cross-validation or a risk estimate. Correct structure can improve risk, but neither a finite-sample ordering nor improvement under an incorrect structure is guaranteed.

The numbers. These are finite-run mean errors. Banding and thresholding use unavailable truth to choose their tuning levels, so they are oracle benchmarks. Even with eight hundred observations, four for every variable, the sample covariance errs by in operator norm, while banding errs by , almost three times less.

Why shrinkage works. The sample covariance spreads the eigenvalues out, as the hook showed, the large ones too large and the small ones too small. Shrinkage pulls them back together. Ledoit–Wolf moves them all by the same proportion. Their later nonlinear shrinkage moves each eigenvalue by its own amount, using a general spectral deconvolution or nonlinear-shrinkage formula, not simply the one-spike BBP inverse map, which chapter seven derives, an idea that goes back to Charles Stein in 1975. And when the inverse covariance is the object of interest, sparsity there means conditional independence, the graphical models of chapter ten.

Numbers: AR(1) ρ = 0.7, p = 200, n = 50: sample 11.1, Ledoit–Wolf 4.4, oracle-tuned thresholding 3.5, oracle-tuned banding 2.3 (‖Σ‖ = 5.66)

6Perturbation theoryPhD4 min

Perturbation theory: how far does an eigenvector move? Every spectral method estimates the eigenvectors of a matrix from a noisy version of it: the truth plus a perturbation. Eigenvalues are stable. Hermann Weyl's inequality of 1912 says each moves by at most the operator norm of the perturbation. Eigenvectors are not, when two eigenvalues are close. If the truth is diagonal with entries one plus delta and one, a perturbation of size delta can rotate the leading eigenvector by forty-five degrees.

A two by two example shows why. Take eigenvalues one plus delta and one, and perturb the off-diagonal entries by epsilon. The new leading eigenvector is rotated by an angle theta with tangent of two theta equal to two epsilon over delta. With epsilon half the gap, the rotation is twenty-two and a half degrees; with epsilon five times the gap, about forty-two degrees, nearly the maximal forty-five. The size of the perturbation relative to the gap is all that matters. Davis–Kahan's bound, two epsilon over delta for the sine, has the right order: for small perturbations the true sine is about epsilon over delta, so the bound is off by a factor of two.

The right measure is the eigengap, the distance from the leading eigenvalue to the next. Chandler Davis and William Kahan's sin theta theorem of 1970, in the convenient form of Yu, Wang and Samworth from 2015, says the sine of the angle between the estimated and true eigenvectors is at most twice the perturbation's norm divided by the gap. With a sample covariance, the perturbation has norm of order the root of p over n, from Part fifty-one, so the angle is small once the gap is large compared with that. Almost every analysis of a spectral method follows this two-line recipe: bound the perturbation with a random-matrix inequality, then apply Davis–Kahan.

A test: an identity covariance with one spike of size ell, so the gap is ell. Davis–Kahan's bound, in purple, is valid but crude: it says nothing until the spike reaches four. The simulated sine of the angle, in blue, is at a spike of two and at eight. The white curve is the exact limit from the spiked-model theory of chapter eight, and it runs straight through the simulation. And below a spike of the root of p over n, , the estimated eigenvector becomes asymptotically orthogonal to the truth: its directional overlap tends to zero in the proportional isotropic-spike model. The full sample can retain information, especially with known structure or a known direction. Davis–Kahan cannot see that threshold; the random-matrix theory can.

The same theory covers singular vectors and whole subspaces. Per-Åke Wedin's theorem of 1972 bounds the angle between singular subspaces of a rectangular matrix by a perturbation-to-separation ratio. Wedin's separation involves the relevant sample and population singular values; a population-gap-only bound needs additional small-perturbation conditions. It underlies spectral clustering, where a network's adjacency matrix is its expected value plus noise and the top eigenvectors reveal the communities. It starts matrix completion algorithms, bounds PCA's estimated subspace, and ranks items from pairwise comparisons. Bounds on individual coordinates of eigenvectors, which say which node belongs to which community, were substantially sharpened in work from the late twenty-tens.

Numbers: n = 500, p = 200: sin θ 0.51 at ℓ = 2, 0.24 at ℓ = 8; Davis–Kahan vacuous until ℓ = 4; asymptotic BBP reference

7Random-matrix lawsPhD4 min

Random-matrix laws: the Stieltjes transform, Marchenko–Pastur and the semicircle. How are such laws found? Put a point mass at each eigenvalue: the empirical spectral distribution. Its Stieltjes transform, a function of a complex variable z above the real axis, is the average of one over lambda minus z, which is a normalized trace of the resolvent matrix, S minus z times the identity, inverted. At continuity points of an absolutely continuous limiting density, it comes back as the limit of the transform's imaginary part over pi as z approaches the real axis, a formula of Thomas Stieltjes from 1894. The point is that the resolvent's trace satisfies an equation that can be solved in the limit, where the moments of the spectrum would need endless combinatorics. That was Vladimir Marchenko and Leonid Pastur's method in 1967.

The derivation in outline. Each diagonal entry of the resolvent is, by the Schur complement, one over a diagonal entry of S, minus z, minus a quadratic form in the rest of the matrix. A rigorous derivation uses a leave-one-out or companion-resolvent identity to isolate independent data before applying quadratic-form concentration. The schematic quadratic form then concentrates around its appropriate conditional expectation, which is itself expressed through the Stieltjes transform. So the transform satisfies a quadratic equation: gamma z m squared, plus z plus gamma minus one times m, plus one, equals zero. Solving it and inverting gives the Marchenko–Pastur density, with its edges at one plus or minus root gamma, squared: the law of this part's hook.

The inversion, computed from the quadratic equation's root at ratio one half. At a height of point two above the real axis, the imaginary part is a blurred version of the spectrum: the transform at height eta is the density smoothed by a Cauchy kernel of width eta. At point oh five the shape emerges. In the limit it is exactly the Marchenko–Pastur density, statkit checks to within a thousandth, with edges at and .

The other classical law. A symmetric matrix of independent Gaussians, a thousand by a thousand, scaled by root two n. Its eigenvalues, and Eugene Wigner's semicircle of 1955, found while modelling the energy levels of heavy nuclei. The extreme eigenvalues are and , against edges at plus and minus two. The same method gives it: the Stieltjes transform satisfies m squared plus z m plus one equals zero.

These laws are universal. For sample covariance with i.i.d. standardized entries and Wigner matrices with independent standardized upper-triangle entries under the appropriate Lindeberg conditions, we obtain the same semicircle and the same Marchenko–Pastur law in the limit, like a central limit theorem for spectra. For a general population covariance, Jack Silverstein's equation of 1995 gives the limiting spectrum, solved numerically, which is how nonlinear shrinkage inverts it. Heavy tails change things at the edges: with infinite fourth moments, the largest eigenvalues escape the bulk. The limiting empirical law describes the bulk. Edge convergence and fluctuations require stronger assumptions. The behaviour of the largest eigenvalue, which decides whether a spike can be detected, is chapter nine's question.

Numbers: Stieltjes inversion at η = 0.2, 0.05, 10⁻⁶; Wigner n = 1,000: extremes −1.971, 1.984

8Spiked models and the BBP transitionPhD4 min

Spiked models and the BBP transition: below a threshold, ordinary PCA loses directional overlap below a model-dependent asymptotic threshold.

Iain Johnstone's spiked model: noise, plus one signal direction v with strength ell. Jinho Baik, Gérard Ben Arous and Sandrine Péché proved in 2005 that if the spike exceeds the root of gamma, the top sample eigenvalue separates from the bulk, converging to one plus ell, times one plus gamma over ell: an overestimate of the true one plus ell. But if the spike is below the root of gamma, the top eigenvalue sticks at the bulk's edge, exactly where it would be with no signal at all. Debashis Paul found in 2007 what happens to the eigenvector: in the isotropic finite-rank proportional model, its squared overlap has the displayed limit above the threshold and tends to zero below it. A real signal, weaker than root gamma, leaves no trace in the leading principal component.

A test with a thousand observations of five hundred variables, so gamma is a half and the threshold is . The teal line is the bulk's edge, . The purple line is the true top eigenvalue, one plus ell. The white curve is the BBP limit, flat at the edge until the threshold and then rising; the simulated top eigenvalues, in gold, follow it, with the blur near the threshold that finite samples always have. At a spike of three, the true top eigenvalue is four, the sample's is , and the limit predicts : inverting the limiting map corrects the leading asymptotic bias, with finite-sample error remaining.

The eigenvector, on the same problems. Paul's limit in white, the simulation in blue. Below the threshold, at a spike of a half, the squared overlap is : its overlap is small but need not equal the finite-sample random-direction value one over p, though the signal is real and one and a half times the noise in its direction. At a spike of one it is , and at three, . Even a strong spike's direction is estimated only partly: the angle between them stays well away from zero.

Real data: the twenty-four psychological tests of Holzinger and Swineford, from Harman's factor analysis of 1967, on schoolchildren, last seen in Part thirty-one. An isotropic independent-noise MP reference, which is not a calibrated band for these tests, has limiting edges to . Two stand above it: , a dominant covariance component often interpreted as general ability, and . Kaiser's popular rule, keep every eigenvalue above one, keeps . The third eigenvalue, one point six nine, is inside the band: the edge comparison alone neither proves noise nor establishes a factor count, though the classical four-factor solution keeps it, on substantive grounds.

What the theory adds. Inverting the BBP map turns each sample eigenvalue into an estimate of the population spike: becomes , and becomes . And Paul's formula predicts how well each estimated direction matches the truth: a squared overlap of for the general factor, but only for the second. These are model-based illustrations, not validated spike or overlap estimates for Harman's matrix. Its varying noise eigenvalues and sample standardization do not match identity noise plus a few positive spikes. A squared overlap is not a percentage of angle alignment, and the assumed-model prediction cannot certify these real loadings. A fitted noise model and further checks are needed.

Numbers: γ = 1/2: threshold 0.707; ℓ = 3: top 4.73 (limit 4.67), overlap 0.82 (0.81); Harman: 2 eigenvalues above 1.98, spikes 7.95 and 1.69, assumed-model squared overlaps 0.97 and 0.52 (not validated for this correlation matrix); Kaiser keeps 5

9Tracy-Widom fluctuationsPhD4 min

Under the null of no spike, where does the largest eigenvalue fall, beyond its limit? Craig Tracy and Harold Widom found in 1994 and 1996, for physicists' random matrices, that the centred and scaled largest eigenvalue converges to a new law, not a normal one, and on a scale of n to the one third rather than the root of n. Iain Johnstone proved in 2001 that the same law governs the largest eigenvalue of a sample covariance, with these explicit centring and scaling constants, useful at moderate n and p, with finite-sample approximation error. The distribution function is a Fredholm determinant of a kernel built from the Airy function, which Folkmar Bornemann showed in 2010 can be computed accurately by converged quadrature. This implementation uses a finite cutoff and quadrature order, so convergence checks are needed before claiming numerical precision.

Fifteen hundred null samples of four hundred observations on two hundred variables. The centred and scaled largest eigenvalues have mean and standard deviation . The Tracy–Widom law, computed from the Fredholm determinant, has mean and standard deviation , and its density traces the histogram. It is skewed: a normal with the same mean and variance, in red, puts too little mass in the right tail. The grey curve is the complex-matrix version, beta equal to two, narrower and further left. The law's ninety-fifth percentile is .

The use: testing whether there is any spike at all. Samarendra Roy's largest-root test of 1953 rejects when the largest eigenvalue is too big, and Johnstone's result calibrates it: reject when the scaled statistic exceeds . On the null samples, it rejects percent of the time, at a nominal five. Above the BBP threshold its power tends to one. Below it, Alexei Onatski, Marcelo Moreira and Marc Hallin showed in 2013, no test based on the top eigenvalue can do much better than chance, though tests using the whole spectrum retain a little power.

Choosing the number of factors becomes a sequence of tests, as Shira Kritchman and Boaz Nadler proposed in 2008: test zero spikes, then one, then two. At step k, compare the next eigenvalue with the bulk's edge, on the Tracy–Widom scale. Stop at the first k that is not rejected. For Harman's tests, simply counting two eigenvalues above an isotropic MP reference is not an implemented calibrated sequential procedure. A factor-count test needs an appropriate fitted noise model, finite-sample centering, thresholds and sequential error control.

The Tracy–Widom law turned out to be everywhere. Jinho Baik, Percy Deift and Kurt Johansson showed in 1999 that it is the law of the longest increasing subsequence of a random permutation. It describes the fluctuations of growing interfaces and queues in tandem, the KPZ universality class. In statistics it calibrates tests for the number of factors and for signals in sensor arrays, finance and population genetics, where Patterson, Price and Reich used it in 2006 to count the axes of human genetic variation. And like the bulk, the edge is universal for light-tailed entries.

Numbers: n = 400, p = 200: scaled mean −1.18, SD 1.25 (TW₁ −1.207, 1.268); q₀.₉₅ = 0.979; Roy's size 4.8%

10Sparse PCA and graphical modelsPhD4 min

Sparse PCA and graphical models: structure beats the BBP threshold, at a price. If the signal direction has only k non-zero entries, so that the signal lives on a few variables, structure can help. Iain Johnstone and Arthur Lu showed in 2009 that ordinary PCA is inconsistent whenever p over n does not go to zero, and blind below the BBP threshold. Their remedy, diagonal thresholding, is almost embarrassingly simple: the variables carrying the signal have larger variances, so keep the k with the largest sample variances and run PCA on those alone. The minimax squared-angle rate is capped at one and involves one plus ell over ell squared, times k log of p over k over n in the appropriate sparse-spike regime. This is a benchmark for suitable estimators; plain diagonal thresholding need not attain it.

A test: a spike of strength two on ten of a thousand variables. PCA's BBP limit, in white, is zero until p over n falls below ell squared, four, at two hundred and fifty observations. PCA, in red, follows it: at two hundred observations its squared overlap is , nothing. Diagonal thresholding, in blue, already reaches there, below the threshold that blinds PCA. With eight hundred observations PCA reaches and diagonal thresholding : knowing the signal is sparse doubles what can be recovered.

But there is a catch, and Part fifty met it. In principle, k log p over ell squared observations suffice, for an estimator that searches over all supports of size k. For flat sparse spikes, diagonal thresholding typically needs order k squared log p over ell squared samples. Computational lower bounds are conditional and regime-specific; there is no single universal sample requirement for every polynomial-time algorithm. The gap between k and k squared is a statistical–computational gap. Quentin Berthet and Philippe Rigollet showed in 2013 that sufficiently strong improvements in their specified asymptotic detection regimes would yield fast planted-clique algorithms, contrary to a standard conjecture. This is conditional evidence, not an unconditional finite-sample lower bound. Sparse PCA is the standard example of a problem where the information is in the data but may not be extractable in reasonable time.

Sparsity in the inverse covariance means something different: a zero entry of the precision matrix says two variables are independent given all the others, an absent edge in a graphical model, as in Part thirty-one. Nicolai Meinshausen and Peter Bühlmann's neighbourhood selection of 2006 regresses each variable on all the others by the lasso, and draws an edge wherever a coefficient survives. The graphical lasso of Friedman, Hastie and Tibshirani penalizes the Gaussian likelihood directly. Graph recovery also requires minimum edge strength, controlled spectra and the method-specific incoherence conditions; a degree-squared-log-p sample order is a representative sufficient regime, as Pradeep Ravikumar and colleagues proved in 2011.

A test of neighbourhood selection, keeping an edge only when both regressions select it. The truth is a chain of thirty variables, each linked only to its neighbours. With twenty-five observations it finds percent of the true edges, and the plotted average true-edge rate reaches one in the sampled replicates. This does not establish certain exact-graph recovery. The rate of false edges stays between and percent. That is with twenty-five observations and four hundred and thirty-five possible edges: sparsity makes the graph learnable from far fewer observations than parameters.

Numbers: p = 1,000, k = 10, ℓ = 2: overlap² at n = 800, PCA 0.40, diagonal thresholding 0.79; chain p = 30: sampled mean true-edge rate reaches one from n = 100; fraction of absent edges selected ≤ 4%; not a guarantee of exact-graph recovery

11Inference: the debiased lassoPractice6 min

Inference: the debiased lasso, or confidence intervals when p is large. Estimation is not inference. The lasso's coefficients are shrunk towards zero, and often set exactly to zero. Their distribution is a point mass at zero plus a shrunken bump, as Keith Knight and Wenjiang Fu showed in 2000: nothing like a normal. Refitting least squares on the selected variables and reporting the usual intervals ignores the selection, and Part thirty-two's Board found those intervals broken. The ordinary residual bootstrap can fail near zero coefficients because of the nonsmooth selection boundary. Modified bootstrap procedures need separate theory.

The fix, found independently in 2014 by Cun-Hui Zhang and Stephanie Zhang, by Sara van de Geer and colleagues, and by Adel Javanmard and Andrea Montanari: add back a correction, one Newton step from the lasso towards least squares. The step uses a row of an approximate inverse of the sample covariance, which does not exist when p exceeds n, so it is built by regressing variable j on all the others with a lasso: the nodewise regression. The scaled error then splits into a term that is conditionally Gaussian when the model has independent homoskedastic Gaussian errors and the nodewise direction depends only on the design, and a bias term bounded by the lasso's error times the nodewise error, of order s log p over root n. When coefficient sparsity, the approximate inverse, conditional variances and noise estimation satisfy the theorem's uniform conditions so that this remainder vanishes, the debiased coefficient is asymptotically normal, with an estimable standard error, and the usual interval is honest, one coordinate at a time.

Why the bias is small. The lasso's l-one error is s times the root of log p over n, from chapter one. The nodewise regression makes the approximate inverse accurate to the root of log p over n in each entry. By Hölder's inequality the bias is at most root n times their product, s log p over root n. And van de Geer and colleagues showed the resulting variance is the semiparametric efficiency bound of Part forty-nine: under their regularity and inverse-estimation conditions it can attain that bound; arbitrary regularized directions need not be efficient.

Real data: the diabetes study of the LARS paper, patients and ten baseline measurements, with disease progression a year later. Add every pairwise interaction and square, as Part thirty-two did: predictors. Least squares still has a solution, but the total, LDL and HDL cholesterol measures are nearly collinear. The lasso with cross-validation's one-standard-error rule keeps : . Now the debiased intervals for the ten main effects, in units of one standard deviation of each standardized design term. With interactions, a main coefficient is a conditional association at zero values of the other centered main predictors, not a total or causal effect.

Ninety-five percent intervals for the ten main effects. In red, least squares with all terms. For of the variables, the cholesterol measures and the triglycerides, its intervals are thousands of units wide and run off the chart: their separate full-model coefficients are weakly identified, despite a full-rank design. In green, the debiased lasso, using regularized nodewise directions. Regularization does not restore missing information about the original coefficients. of its intervals exclude zero. But note what the price is: the intended target remains the original full-model coefficient, not a new regularized estimand. These narrow intervals have not been validated here. Near-collinearity can leave a large bias remainder; coefficient sparsity alone is insufficient for coverage.

The numbers for six of them. The lasso's estimate for body-mass index is ; debiased, . For the log triglycerides, becomes . Variables the lasso dropped, like sex, get estimates and intervals too. The correction undoes the shrinkage, which is exactly what it is for: the lasso's estimates are biased towards zero, and the correction reduces shrinkage in these examples, but does not make the estimator exactly unbiased.

The fine print. The sparsity the theory needs, s much smaller than root n over log p, is much stronger than estimation needs. In finite samples, coverage can fall short, especially for large effects among correlated variables, where the bias term is largest. The intervals hold one coordinate at a time; for many at once, the multiplicity corrections of Part thirty-three apply. And there is a different answer to the same question: under the corresponding linear-Gaussian selection model, condition on the lasso selection event and compute conditional intervals. Those can target selected-model rather than full-model parameters, the selective inference of Part fifty-six.

Numbers: diabetes, n = 442, p = 64: the lasso (one SE) keeps 8; bmi 23.7 → 27.0 [21.3, 32.8], ltg 20.9 → 27.4 [21.4, 33.4]; 5 main effects exclude zero (sex, bmi, bp, hdl, ltg); OLS intervals for tc, ldl, hdl, ltg are thousands wide

Recap, problems, and the road aheadAll tracks2 min

Part fifty-two in twelve lines. Principal components on pure noise. The lasso's oracle inequality under restricted eigenvalues. Support recovery and its threshold. Decomposable regularizers, one theorem for many problems. Matrix completion. Banding, thresholding and shrinkage for covariances. Davis and Kahan's sin theta theorem. The Stieltjes transform, Marchenko–Pastur and the semicircle. Spikes and the BBP transition, on Harman's tests. Tracy–Widom and Roy's test. Sparse PCA and graphical models. And the debiased lasso.

A promise for the next part. This one found the rates and limits of estimators when parameters outnumber observations. They were frequentist estimators of a fixed truth. Part fifty-three asks whether Bayesian posteriors, with priors like the horseshoe and the spike and slab, contract around the truth at the same rates, and when their credible sets can be trusted.

Where it comes back. Part fifty-three proves posterior contraction for sparse priors. Part fifty-four gives learning bounds in high dimensions. Part fifty-six builds exact inference after selection, the other answer to chapter eleven's question. Part fifty-nine computes the lasso's exact risk when p and n grow together. And Part sixty-two adjusts for many confounders at once.

Six problems, with full solutions in the README. The basic inequality and the cone; the size of the noise's correlations; the nuclear norm's decomposability; Davis–Kahan in two dimensions; the BBP map; and the Marchenko–Pastur density from its quadratic. Pause here if you want to try them.

The books this part follows: Wainwright's High-Dimensional Statistics, Bühlmann and van de Geer, Bai and Silverstein on spectral analysis, Couillet and Liao, and Hastie, Tibshirani and Wainwright; with the papers from Marchenko and Pastur to Javanmard and Montanari.

Fifty-two parts of sixty-five. When parameters outnumber observations, nothing can be learned without structure, and with the right structure, sparsity, low rank, a few spikes, almost everything can, losing only a logarithm. But structure is an assumption, and the hook's lesson stands: before reading a signal into high-dimensional data, know exactly what noise alone would have shown. Next, Part fifty-three: Bayesian asymptotics and nonparametric Bayes.

Where it goes next. Posterior contraction for sparse priors at these rates is in Part 53, learning bounds in high dimensions in Part 54, selective inference after the lasso in Part 56, the lasso's exact risk when p/n tends to a constant in Part 59, and causal adjustment for many confounders in Part 62; Problem 11 of the qualifying exam (Part 55) is the oracle inequality.

Key results

The part's results in one place, for revision.

The lasso's oracle inequality\(\displaystyle \lambda\ge2\|X^\top\varepsilon/n\|_\infty\ \Longrightarrow\ \|\hat\beta-\beta^*\|_2\le\frac{3\sqrt s\,\lambda}{\kappa}\asymp\frac{\sigma}{\kappa}\sqrt{\frac{s\log p}{n}}\)
Davis-Kahan\(\displaystyle \sin\angle(\hat v_1,v_1)\ \le\ \frac{2\,\|\hat\Sigma-\Sigma\|_{\mathrm{op}}}{\lambda_1(\Sigma)-\lambda_2(\Sigma)}\)
Marchenko-Pastur\(\displaystyle f_\gamma(x)=\frac{\sqrt{(b-x)(x-a)}}{2\pi\gamma x},\qquad\allowbreak a,b=(1\mp\sqrt\gamma)^2,\quad\allowbreak \gamma=p/n\le1\)
The BBP transition\(\displaystyle \Sigma=I+\ell vv^\top:\quad\allowbreak \hat\lambda_1\to\begin{cases}(1+\ell)(1+\gamma/\ell),&\ell>\sqrt\gamma\\(1+\sqrt\gamma)^2,&\ell\le\sqrt\gamma\end{cases}\qquad\allowbreak \langle\hat v_1,v\rangle^2\to\Bigl(\frac{1-\gamma/\ell^2}{1+\gamma/\ell}\Bigr)_+\)
Tracy-Widom at the edge\(\displaystyle \frac{\hat\lambda_1-\mu_{np}}{\sigma_{np}}\ \Rightarrow\ TW_1\qquad\allowbreak (\Sigma=I,\ \text{Johnstone's }\allowbreak \text{centring }\allowbreak \text{and }\allowbreak \text{scaling})\)
The debiased lasso\(\displaystyle \hat b_j=\hat\beta_j+\frac{\theta_j^\top X^\top(y-X\hat\beta)}{n},\qquad\allowbreak \hat b_j\pm1.96\,\hat\sigma\sqrt{\theta_j^\top\hat\Sigma\,\theta_j/n}\)

Try it

Lab 52 · The bulk, its edges, and the spike that PCA can or cannot see

Compute the sample eigenvalues of 1,000 observations of 500 independent variables and compare their range with the Marchenko-Pastur edges. Then plant a spike of size ell in the covariance (p/n = 1/2) and compare the top sample eigenvalue and the eigenvector's squared overlap with the BBP limits on both sides of the threshold sqrt(1/2).

Figure produced by Lab 52: The bulk, its edges, and the spike that PCA can or cannot see
Produced by the lab below, seed 0, in 0.3 s.
python -m videos.stats.labs 52 needs numpy, scipy, matplotlib · download lab52.py · source on GitHub
pure noise, n = 1,000, p = 500: smallest / largest eigenvalue  0.091 / 2.839   Marchenko-Pastur edges 0.086 / 2.914   (every true eigenvalue is 1)
spike ell = 0.3: top eigenvalue, overlap^2                     2.86, 0.01   BBP limits 2.91, 0.00
spike ell = 0.5: top eigenvalue, overlap^2                     2.84, 0.05   BBP limits 2.91, 0.00
spike ell = 1.0: top eigenvalue, overlap^2                     3.05, 0.38   BBP limits 3.00, 0.33
spike ell = 2.0: top eigenvalue, overlap^2                     3.77, 0.70   BBP limits 3.75, 0.70
spike ell = 3.0: top eigenvalue, overlap^2                     4.78, 0.81   BBP limits 4.67, 0.81
spike ell = 4.0: top eigenvalue, overlap^2                     5.39, 0.84   BBP limits 5.62, 0.86
threshold sqrt(p/n)                                            0.707

With p/n fixed the sample spectrum of pure noise spreads over [(1 - sqrt g)^2, (1 + sqrt g)^2]; a spike below sqrt g stays inside it, and above it the top eigenvalue lands at (1 + ell)(1 + g/ell) with an eigenvector only partly aligned with the truth.
The code (75 lines; it asserts its own result)
"""Lab 52: PCA on pure noise against Marchenko-Pastur, and a spike crossing the BBP threshold."""

import numpy as np

from videos.coursekit import labs
from explainer.stats.kit import hdstat

TITLE = "The bulk, its edges, and the spike that PCA can or cannot see"
GOAL = ("Compute the sample eigenvalues of 1,000 observations of 500 independent variables and compare their range "
        "with the Marchenko-Pastur edges. Then plant a spike of size ell in the covariance (p/n = 1/2) and compare "
        "the top sample eigenvalue and the eigenvector's squared overlap with the BBP limits on both sides of the "
        "threshold sqrt(1/2).")
TASKS = [
    "Invert the map with hdstat.spike_invert on the top eigenvalue at ell = 3. How close is the estimate to 3, and "
    "how far off is the raw eigenvalue minus one?",
    "Compare hdstat.anderson_ci and hdstat.spike_ci over 200 samples at ell = 3: which covers 1 + ell = 4?",
    "Draw the noise from a t distribution with 5 degrees of freedom scaled to variance one. Do the edges and the "
    "threshold move?",
]


def run(seed=0):
    rng = np.random.default_rng(seed)
    lab = labs.Lab()

    X = rng.standard_normal((1000, 500))
    ev = np.linalg.eigvalsh(X.T @ X / 1000)
    lo, hi = hdstat.mp_edges(0.5)
    lab.row("pure noise, n = 1,000, p = 500: smallest / largest eigenvalue",
            f"{ev[0]:.3f} / {ev[-1]:.3f}   Marchenko-Pastur edges {lo:.3f} / {hi:.3f}   (every true eigenvalue is 1)")
    assert abs(ev[0] - lo) < 0.02 and abs(ev[-1] - hi) < 0.12, "the noise spectrum fills the MP support"
    grid = np.linspace(lo, hi, 4001)
    mass = float(np.sum(hdstat.mp_pdf(grid, 0.5)) * (grid[1] - grid[0]))
    assert abs(mass - 1) < 0.01, "the MP density integrates to one"

    n, p, gamma, reps = 300, 150, 0.5, 12
    ells = [0.3, 0.5, 1.0, 2.0, 3.0, 4.0]
    top, over = [], []
    for ell in ells:
        t, o = [], []
        for _ in range(reps):
            lam, v = hdstat.top_eig(hdstat.spiked_sample(n, p, ell, rng))
            t.append(lam)
            o.append(v[0] ** 2)
        top.append(np.mean(t))
        over.append(np.mean(o))
        lab.row(f"spike ell = {ell}: top eigenvalue, overlap^2",
                f"{top[-1]:.2f}, {over[-1]:.2f}   BBP limits {float(hdstat.spike_eigenvalue(ell, gamma)):.2f}, "
                f"{float(hdstat.spike_overlap(ell, gamma)):.2f}")
    lim_top = hdstat.spike_eigenvalue(np.array(ells), gamma)
    lim_over = hdstat.spike_overlap(np.array(ells), gamma)
    lab.row("threshold sqrt(p/n)", f"{np.sqrt(gamma):.3f}")
    assert over[0] < 0.08 and abs(top[0] / hi - 1) < 0.04, "below the threshold the spike is invisible to PCA"
    assert all(abs(t / l - 1) < 0.08 for t, l in zip(top[3:], lim_top[3:])), "above it, the eigenvalue is biased upward"
    assert all(abs(o - l) < 0.08 for o, l in zip(over[3:], lim_over[3:])), "and the eigenvector is partly right"
    assert top[-1] > 1 + ells[-1] + 0.3, "the top eigenvalue overstates the spike 1 + ell"
    lab.note = ("With p/n fixed the sample spectrum of pure noise spreads over [(1 - sqrt g)^2, (1 + sqrt g)^2]; a "
                "spike below sqrt g stays inside it, and above it the top eigenvalue lands at (1 + ell)(1 + g/ell) "
                "with an eigenvector only partly aligned with the truth.")

    fig, ax = labs.figure(2, size=(11, 4.2))
    ax[0].hist(ev, bins=50, density=True, color=labs.BLUE, alpha=0.6, label="sample eigenvalues")
    ax[0].plot(grid, hdstat.mp_pdf(grid, 0.5), color=labs.GOLD, label="Marchenko-Pastur, p/n = 1/2")
    ax[0].axvline(1, color=labs.MUTED, ls="--", label="every true eigenvalue")
    ax[0].set(title="PCA on pure noise: n = 1,000, p = 500", xlabel="eigenvalue", ylabel="density")
    ax[0].legend()
    fine = np.linspace(0.05, 4.2, 300)
    ax[1].plot(fine, hdstat.spike_overlap(fine, gamma), color=labs.GOLD, label="limit of the squared overlap")
    ax[1].plot(ells, over, "o", color=labs.BLUE, label="simulated, n = 300, p = 150")
    ax[1].axvline(np.sqrt(gamma), color=labs.RED, ls="--", label="threshold sqrt(p/n) = 0.707")
    ax[1].set(title="Does the top eigenvector find the spike?", xlabel="spike ell", ylabel="squared overlap with the truth",
              ylim=(-0.03, 1))
    ax[1].legend(loc="lower right")
    lab.fig = fig
    return lab

Now change it

  1. Invert the map with hdstat.spike_invert on the top eigenvalue at ell = 3. How close is the estimate to 3, and how far off is the raw eigenvalue minus one?
  2. Compare hdstat.anderson_ci and hdstat.spike_ci over 200 samples at ell = 3: which covers 1 + ell = 4?
  3. Draw the noise from a t distribution with 5 degrees of freedom scaled to variance one. Do the edges and the threshold move?

Problems, with solutions

Try each problem before opening its solution.

  1. The basic inequality. Derive the lasso's basic inequality, and show it forces \(\|\Delta_{S^c}\|_1 \le 3\|\Delta_S\|_1\) when \(\lambda \ge 2\|X^\top\varepsilon/n\|_\infty\).

    Solution
    • Optimality of β̂ against β*: (1/2n)‖y − Xβ̂‖² + λ‖β̂‖₁ ≤ (1/2n)‖ε‖² + λ‖β*‖₁.
    • With y = Xβ* + ε and Δ = β̂ − β*, this is (1/2n)‖XΔ‖² ≤ ⟨X^⊤ε/n, Δ⟩ + λ(‖β*‖₁ − ‖β̂‖₁).
    • Hölder gives ⟨X^⊤ε/n, Δ⟩ ≤ (λ/2)‖Δ‖₁. The triangle inequality gives ‖β*‖₁ − ‖β̂‖₁ ≤ ‖Δ_S‖₁ − ‖Δ_{S^c}‖₁.
    • So 0 ≤ (λ/2)(‖Δ_S‖₁ + ‖Δ_{S^c}‖₁) + λ(‖Δ_S‖₁ − ‖Δ_{S^c}‖₁), which gives ‖Δ_{S^c}‖₁ ≤ 3‖Δ_S‖₁.
  2. The noise's correlations. For columns with \(\|X_j\|^2 = n\), show \(P(\|X^\top\varepsilon/n\|_\infty > \sigma\sqrt{2\log(2p/\delta)/n}) \le \delta\).

    Solution
    • For fixed columns with ‖X_j‖² = n and independent homoskedastic Gaussian errors, each X_j^⊤ε/n ~ N(0, σ²/n), so P(|X_j^⊤ε/n| > t) ≤ 2e^{−nt²/(2σ²)}.
    • A union bound over j gives 2p e^{−nt²/(2σ²)}. Setting this equal to δ gives t = σ√(2 log(2p/δ)/n).
  3. The nuclear norm is decomposable. Show the nuclear norm is decomposable: \(\|A + B\|_* = \|A\|_* + \|B\|_*\) if \(A\) and \(B\) have orthogonal row and column spaces.

    Solution
    • If A = U_A D_A V_A^⊤ and B = U_B D_B V_B^⊤ with U_A ⊥ U_B and V_A ⊥ V_B, then [U_A U_B] blockdiag(D_A, D_B) [V_A V_B]^⊤ is an SVD of A + B.
    • So the singular values of A + B are those of A together with those of B, and the nuclear norms add.
  4. Davis–Kahan in two dimensions. For \(\Sigma = \mathrm{diag}(1 + \delta, 1)\) and \(E = \varepsilon(e_1e_2^\top + e_2e_1^\top)\), find the exact angle of \(v_1\), and compare with Davis–Kahan.

    Solution
    • The eigenvector of [[1 + δ, ε], [ε, 1]] is at angle θ with tan 2θ = 2ε/δ.
    • For small ε, sin θ ≈ ε/δ, against the bound 2ε/δ: right order, off by a factor of 2.
    • At ε = δ/2, θ = 22.5° and sin θ = 0.38, against the bound 1.
  5. The BBP map. Invert \(\psi(\ell) = (1 + \ell)(1 + \gamma/\ell)\); show \(\psi'(\ell) = 1 - \gamma/\ell^2\) and that \(\psi\) is minimized at \(\ell = \sqrt\gamma\).

    Solution
    • ψ(ℓ) = 1 + ℓ + γ + γ/ℓ, so ψ′(ℓ) = 1 − γ/ℓ², which is zero at ℓ = √γ. There ψ(√γ) = (1 + √γ)², the bulk's edge.
    • Solving ψ(ℓ) = λ̂ gives ℓ² − (λ̂ − 1 − γ)ℓ + γ = 0. Take the larger root, ℓ = [c + √(c² − 4γ)]/2 with c = λ̂ − 1 − γ.
  6. Marchenko–Pastur from its quadratic. Solve \(\gamma z m^2 + (z + \gamma - 1)m + 1 = 0\) and recover the Marchenko–Pastur density by Stieltjes inversion.

    Solution
    • m = [−(z + γ − 1) + √((z + γ − 1)² − 4γz)]/(2γz), choosing the branch with Im m > 0.
    • The discriminant (z − 1 − γ)² − 4γ is negative exactly for z ∈ (a, b), with a, b = (1 ∓ √γ)².
    • There Im m(x + i0) = √((b − x)(x − a))/(2γx), and dividing by π gives the density.

Notes and sources

Where it comes back

  • Part 53: posterior contraction for sparse priors, at this part's rates.
  • Part 54: learning bounds in high dimensions.
  • Part 56: selective inference after the lasso.
  • Part 59: the lasso's exact risk when p/n → δ, by the CGMT and approximate message passing.
  • Part 62: causal adjustment for many confounders.

Glossary

  • Sparse regression.
    • Oracle inequality; restricted eigenvalue; cone condition; basic inequality; restricted strong convexity: rates.
    • Support recovery; irrepresentable condition; primal–dual witness; beta-min condition; sign consistency: selection.
    • Decomposable regularizer; dual norm; subspace compatibility; group lasso; nuclear norm: the unified theory.
  • Matrices.
    • Matrix completion; incoherence; degrees of freedom; SoftImpute: low rank.
    • Banding; thresholding; Ledoit–Wolf shrinkage; nonlinear shrinkage: covariances.
    • Weyl's inequality; eigengap; Davis–Kahan sin θ; Wedin's theorem: perturbation.
  • Random-matrix theory.
    • Empirical spectral distribution; Stieltjes transform; resolvent; Marchenko–Pastur law; semicircle law; universality: the bulk.
    • Spiked covariance model; BBP transition; eigenvector overlap; Tracy–Widom law; Fredholm determinant; Roy's largest root; parallel analysis: the edge.
  • Structure and inference.
    • Sparse PCA; diagonal thresholding; statistical–computational gap; neighbourhood selection; graphical lasso: structured spectra.
    • Debiased (desparsified) lasso; nodewise regression; one-step estimator; selective inference: intervals.

Sources

  • The lasso.
    • R. Tibshirani, JRSS B 58 (1996); P. Bickel, Y. Ritov & A. Tsybakov, Ann. Stat. 37 (2009); G. Raskutti, M. Wainwright & B. Yu, JMLR 11 (2010).
    • P. Zhao & B. Yu, JMLR 7 (2006); H. Zou, JASA 101 (2006); M. Wainwright, IEEE Trans. Inf. Theory 55 (2009).
    • S. Negahban, P. Ravikumar, M. Wainwright & B. Yu, Stat. Sci. 27 (2012).
  • Low rank. M. Fazel, PhD thesis (2002); E. Candès & B. Recht, Found. Comput. Math. 9 (2009); E. Candès & T. Tao, IEEE Trans. Inf. Theory 56 (2010); D. Gross, IEEE Trans. Inf. Theory 57 (2011); B. Recht, JMLR 12 (2011); V. Koltchinskii, K. Lounici & A. Tsybakov, Ann. Stat. 39 (2011); R. Mazumder, T. Hastie & R. Tibshirani, JMLR 11 (2010).
  • Covariance. P. Bickel & E. Levina, Ann. Stat. 36 (2008a, b); O. Ledoit & M. Wolf, J. Multivar. Anal. 88 (2004), Ann. Stat. 40 (2012); C. Stein, Rietz lecture (1975).
  • Perturbation. H. Weyl, Math. Ann. 71 (1912); C. Davis & W. Kahan, SIAM J. Numer. Anal. 7 (1970); P.-Å. Wedin, BIT 12 (1972); Y. Yu, T. Wang & R. Samworth, Biometrika 102 (2015).
  • Random matrices.
    • V. Marchenko & L. Pastur, Mat. Sb. 72 (1967); E. Wigner, Ann. Math. 62 (1955); J. Silverstein & Z. Bai, J. Multivar. Anal. 54 (1995).
    • J. Baik, G. Ben Arous & S. Péché, Ann. Probab. 33 (2005); D. Paul, Stat. Sinica 17 (2007); Z. Bai & J. Yao, Ann. IHP 44 (2008).
    • C. Tracy & H. Widom, Comm. Math. Phys. 159 (1994), 177 (1996); I. Johnstone, Ann. Stat. 29 (2001); F. Bornemann, Math. Comp. 79 (2010); J. Baik, P. Deift & K. Johansson, JAMS 12 (1999).
    • S. Roy, Ann. Math. Stat. 24 (1953); S. Kritchman & B. Nadler, Chemometr. Intell. Lab. 94 (2008); A. Onatski, M. Moreira & M. Hallin, Ann. Stat. 41 (2013); N. Patterson, A. Price & D. Reich, PLoS Genet. 2 (2006).
  • Sparse PCA and graphs. I. Johnstone & A. Lu, JASA 104 (2009); V. Vu & J. Lei, Ann. Stat. 41 (2013); A. d'Aspremont et al., SIAM Rev. 49 (2007); Q. Berthet & P. Rigollet, Ann. Stat. 41 (2013); N. Meinshausen & P. Bühlmann, Ann. Stat. 34 (2006); J. Friedman, T. Hastie & R. Tibshirani, Biostatistics 9 (2008); P. Ravikumar et al., EJS 5 (2011).
  • Inference. K. Knight & W. Fu, Ann. Stat. 28 (2000); A. Chatterjee & S. Lahiri, Proc. AMS 138 (2010); C.-H. Zhang & S. Zhang, JRSS B 76 (2014); S. van de Geer, P. Bühlmann, Y. Ritov & R. Dezeure, Ann. Stat. 42 (2014); A. Javanmard & A. Montanari, JMLR 15 (2014).
  • Data. K. Holzinger & F. Swineford (1939); H. Harman, Modern Factor Analysis (1967); B. Efron, T. Hastie, I. Johnstone & R. Tibshirani, Ann. Stat. 32 (2004).
  • Books. M. Wainwright, High-Dimensional Statistics (2019); P. Bühlmann & S. van de Geer, Statistics for High-Dimensional Data (2011); Z. Bai & J. Silverstein (2010); R. Couillet & Z. Liao (2022); T. Hastie, R. Tibshirani & M. Wainwright, Statistical Learning with Sparsity (2015).
About this partfrom its README

Part 52 of a sixty-five-part course in statistics, from a first course to a PhD (see the series plan and the syllabus), and the tenth part of Stage IV, the PhD core.

It opens with principal components on pure noise. A thousand observations of five hundred independent variables have a top sample eigenvalue of 2.92 and a bottom one of 0.085, where every true eigenvalue is 1. The first component "explains" 2.9 times its true share, and its loadings point in a uniformly random direction. The part asks what can be estimated, and how fast, when parameters outnumber observations:

  • the lasso's oracle inequality under restricted eigenvalues (Bickel, Ritov & Tsybakov 2009), proved;
  • support recovery: irrepresentability, the primal–dual witness and Wainwright's 2s log(p − s) threshold;
  • decomposable regularizers (Negahban et al. 2012): one theorem for sparse, group, low-rank and GLM problems;
  • low-rank recovery and matrix completion (Candès & Recht 2009; Koltchinskii, Lounici & Tsybakov 2011);
  • covariance estimation by banding, thresholding and Ledoit–Wolf shrinkage;
  • perturbation theory: Weyl, Davis–Kahan, Wedin;
  • random-matrix laws from the Stieltjes transform: Marchenko–Pastur and Wigner's semicircle;
  • spiked models: the BBP transition for eigenvalues and eigenvectors, on Harman's 24 tests (Board);
  • Tracy–Widom fluctuations and Roy's largest-root test (Board);
  • sparse PCA, its computational barrier, and neighbourhood selection for graphical models;
  • inference by the debiased lasso, on the diabetes data with interactions, with explicit caveats about its full-model target, near-collinearity and unvalidated finite-sample coverage.

It keeps three promises:

  • Part 32 showed the lasso and basis pursuit working, by experiment. Chapters 1–3 prove the rates and say when the right variables are found.
  • Part 31's PCA and factor analysis assumed p fixed as n grows. Chapters 6–10 work with p/n fixed, and find a threshold below which ordinary-PCA directional overlap vanishes in the proportional isotropic-spike limit; other statistics or structural assumptions can retain information.
  • Part 51 built concentration, random matrices and Gaussian comparison as probability. Here they are the proofs: the maximum of p Gaussians sets λ, Gordon's inequality gives restricted eigenvalues, and matrix Bernstein drives matrix completion.

Built in this part:

  • statkit.hdstat (explainer/stats/kit/hdstat.py), tested in tests/test_stats_kit_hdstat.py:
    • the Marchenko–Pastur density, its Stieltjes transform and the inversion; Wigner matrices and the semicircle;
    • the BBP limits of the top eigenvalue and of the eigenvector overlap, the inverse map, the spike's fluctuation, Anderson's interval and a BBP-corrected one;
    • Tracy–Widom distributions for β = 1 and 2 by Bornemann's quadrature of Fredholm determinants, with quantiles, moments and Johnstone's centring and scaling;
    • a rate-scale λ helper and oracle rate; the local simulation uses a corrected confidence-calibrated λ, the irrepresentable constant, signed support along the exact LARS path;
    • AR(1) covariances, banding, thresholding, Ledoit–Wolf, sin θ and the Davis–Kahan bound;
    • spiked and sparse-spiked samplers, diagonal thresholding, neighbourhood selection, chain precision matrices, low-rank matrices.
  • The random-matrix lab (SpectrumBulk in explainer/stats/viz.py), the part's instrument: a spectrum's histogram (the bulk), its limiting law, the edges of the support, spikes as stems rising out of the bulk, and arrows for the BBP map.

Data.

  • From the Museum: Harman's 24 psychological tests (Holzinger & Swineford 1939; Harman 1967), and the diabetes data of the LARS paper (Efron, Hastie, Johnstone & Tibshirani 2004).
  • The rest is exact arithmetic or seeded simulation.

The Coverage Board gains four rows:

Method Setting Nominal Achieved Verdict
Anderson's interval for a simple eigenvalue spike 1 + ℓ = 4, n = 200, p = 100 95% 63.6% broken
BBP-corrected interval for the spike spike 1 + ℓ = 4, n = 200, p = 100 95% 95.5% kept
normal test for a spike null Σ = I, n = 200, p = 100 size 5% 100% broken
Roy's test, Tracy–Widom calibration null Σ = I, n = 200, p = 100 size 5% 4.2% kept
Chapter notes
# Chapter Numbers
0 Noise with structure n = 1,000, p = 500: eigenvalues 0.085 to 2.92 (MP edges 0.086, 2.914); top share 0.59% vs 0.20%
1 The oracle inequality p = 500, s = 10: error 2.91 (n = 100) → 0.89 (n = 1,200), with a conditional-Gaussian 95% noise-event penalty including actual column norms; best tested λ at 0.125 × that conservative penalty
2 Support recovery s = 8: P(exact signed support) at θ = 1: 50%, 43%, 40% for p = 128, 256, 512; 0% → 100% from θ = 0.4 to 2; irrepresentable 0.21 (100%) vs 1.51 (0%)
3 Decomposable regularizers the instances table: ℓ₁, group, nuclear, sparse GLM
4 Matrix completion 100 × 100, rank 3: dof 5.9%; median error 0.779 at 6%, 0.129 at 15%, 0.00478 at 30%; four trials, final λ = 0.05, checked proximal fixed-point residual < 2×10⁻⁷
5 Covariance AR(1) ρ = 0.7, p = 200, n = 50: sample 11.1, Ledoit–Wolf 4.4, oracle-tuned thresholding 3.5, oracle-tuned banding 2.3 (‖Σ‖ = 5.66)
6 Perturbation n = 500, p = 200: sin θ 0.51 at ℓ = 2, 0.24 at ℓ = 8; Davis–Kahan vacuous until ℓ = 4; asymptotic BBP reference
7 Random-matrix laws Stieltjes inversion at η = 0.2, 0.05, 10⁻⁶; Wigner n = 1,000: extremes −1.971, 1.984
8 Spikes γ = 1/2: threshold 0.707; ℓ = 3: top 4.73 (limit 4.67), overlap 0.82 (0.81); Harman: 2 eigenvalues above 1.98, spikes 7.95 and 1.69, assumed-model squared overlaps 0.97 and 0.52 (not validated for this correlation matrix); Kaiser keeps 5
9 Tracy–Widom n = 400, p = 200: scaled mean −1.18, SD 1.25 (TW₁ −1.207, 1.268); q₀.₉₅ = 0.979; Roy's size 4.8%
10 Sparse PCA, graphs p = 1,000, k = 10, ℓ = 2: overlap² at n = 800, PCA 0.40, diagonal thresholding 0.79; chain p = 30: sampled mean true-edge rate reaches one from n = 100; fraction of absent edges selected ≤ 4%; not a guarantee of exact-graph recovery
11 The debiased lasso diabetes, n = 442, p = 64: the lasso (one SE) keeps 8; bmi 23.7 → 27.0 [21.3, 32.8], ltg 20.9 → 27.4 [21.4, 33.4]; 5 main effects exclude zero (sex, bmi, bp, hdl, ltg); OLS intervals for tc, ldl, hdl, ltg are thousands wide
12 Outro —
The syllabus's plan for this partfrom SYLLABUS.md, the plan of record
  1. Hook: noise with structure. n = 1,000, p = 500: eigenvalues from ≈ 0.09 to ≈ 2.91.
  2. Upgrade card (Part 32).
  3. The lasso's oracle inequality. Restricted eigenvalues (Bickel, Ritov & Tsybakov 2009), proved.
  4. Support recovery. Irrepresentability; the primal–dual witness (Wainwright 2009).
  5. Decomposable regularizers (Negahban et al. 2012): one theorem for sparse, group and low-rank problems.
  6. Low-rank matrix recovery and completion (Candès & Recht 2009; Koltchinskii, Lounici & Tsybakov 2011).
  7. Covariance estimation. Banding and thresholding (Bickel & Levina 2008); Ledoit–Wolf.
  8. Perturbation theory. Davis–Kahan and Wedin.
  9. Random matrix laws. Marchenko–Pastur via the Stieltjes transform; Wigner (SpectrumBulk).
  10. Spiked models. The BBP transition (Baik, Ben Arous & Péché 2005); eigenvector overlaps (Paul 2007) (Board).
  11. Tracy–Widom fluctuations; Johnstone (2001).
  12. Sparse PCA and graphical models. Consistency; the computational barrier (Part 50).
  13. Inference. The debiased lasso's theory (Javanmard & Montanari 2014; van de Geer et al. 2014).
  14. Outro.

Built: the random-matrix lab. Books: Wainwright; Bühlmann & van de Geer; Bai & Silverstein; Couillet & Liao.

Build the film

python -m videos.stats.stats52.compute        # the part's numbers, into .cache/stats52
python tools/build.py stats52                  # render and assemble the film
EXPLAINER_TTS=silent python tools/qa_scene.py stats52 Hook   # one chapter, silent, with a contact sheet

Scenes: videos/stats/stats52. Setup: see the course page. Source of these notes: the README and the scenes' narration.

Build it
OMP_NUM_THREADS=1 python -m videos.stats.stats52.compute   # once (about ten minutes)
python tools/build.py stats52 -q l                         # fast 480p preview
python tools/build.py stats52                              # 1080p30 -> renders/stats52.mp4
python tools/qa_scene.py stats52 Spikes
python tools/lecture_length.py stats52 --floor 50