High-Dimensional Asymptotics
What happens to classical statistics when p and n grow together?
Sur and Candes's 2019 logistic regression opens the part: with one variable for every five observations and signal strength 5, the maximum likelihood estimate is inflated by a factor of 1.499, its spread is 4.74 where the textbook says 3.88, and twice the log likelihood ratio is 1.487 times a chi-squared, so the usual 5% test rejects 8.6% of true nulls. The part derives what replaces the fixed-p theory when p/n tends to a constant. It starts with least squares and the Marchenko-Pastur law, solves the Sur-Candes system by root finding and quadrature, and finds the boundary beyond which the MLE does not exist. Stieltjes transforms and free convolution give the exact risk of ridge and of minimum-norm least squares, with double descent derived and simulated. M-estimation shows least absolute deviations losing to least squares at large p/n even for Laplace errors. Approximate message passing is tracked step by step by the state-evolution cobweb, which also yields the Donoho-Tanner curve; Gordon's comparison and the replica method reach the same equations by other routes, and random features show double descent in a two-layer network. The part ends with corrected inference, the rescaled likelihood-ratio test and the debiased MLE on the Wisconsin biopsies' design, and five open problems.
What you need. Stages I to IV of the series: likelihood theory and Wilks's theorem (Part 22), ridge and the lasso (Part 32), random matrices and Gaussian comparison inequalities (Part 51), high-dimensional rates (Part 52), and complex analysis at the level of a contour and a branch of a square root.
- Hook
- a χ² that is not (Sur & Candès 2019)
- Mathematics
- the proportional regime, free probability, exact ridge risk, AMP and state evolution, CGMT, replica predictions, random features
- Built
- an AMP solver
What you will be able to do
Bachelor's
- Explain the cold open's experiment: what goes wrong with a logistic regression's estimates and tests when there is one variable for every five observations.
Master's
- Compute the limiting risk of least squares, ridge and minimum-norm least squares from the Marchenko-Pastur Stieltjes transform, and explain the peak at p = n.
- Run AMP for the lasso and its state evolution, and check one against the other iteration by iteration.
PhD
- Derive the Marchenko-Pastur equation by leaving one column out, and the ridge risk of Dobriban and Wager from it.
- Derive state evolution for AMP, explain the Onsager term, and obtain the Donoho-Tanner curve from the fixed-point condition.
- State the convex Gaussian min-max theorem and recover the least-squares risk from its auxiliary problem; state which replica predictions are proved and which are open.
Practice
- Diagnose when a fitted logistic regression is in the proportional regime (p/n not small, estimates and z-statistics too large) and apply the rescaled test and debiased estimate, with the signal strength estimated.
- Choose a ridge penalty knowing that interpolation without one is worst near p = n.
Contents
Each chapter has a home level. Choose a track to see what to read and watch: Bachelor's 6 min · Master's 11 min · PhD 55 min · Practice 11 min.
- 0Sur and Candes, 2019Bachelor's4 min
- 1The proportional regimePhD6 min
- 2Random matrix toolsPhD5 min
- 3Exact ridge and ridgeless riskPhD5 min
- 4M-estimation in high dimensionsPhD4 min
- 5AMP and state evolutionPhD6 min
- 6Gordon's comparisonPhD5 min
- 7The replica methodPhD5 min
- 8Random features and kernelsPhD5 min
- 9Corrected inferencePractice5 min
- 10Open problemsPhD3 min
- 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.
Sur and Candes, 2019Bachelor's4 min
Sur and Candes developed a modern proportional-limit theory for logistic maximum likelihood. In their Gaussian example with p over n equal to one-fifth and signal variance five, estimates have an inflation factor about one point five, a larger noise scale than the textbook prediction, and a rescaled likelihood-ratio law. A realized coefficient need not individually overestimate its truth. Classical theory says that under regularity, fixed-dimensional MLEs are asymptotically centered and normal, and Wilks's statistic has a chi-squared limit. It does not claim every finite-sample MLE is unbiased. Those asymptotic conclusions hold in a different limiting regime, with dimension fixed. When a substantial fraction of observations is used to fit parameters, the proportional regime can better describe the errors.
Their setting: n observations, p equal to a fifth of n, Gaussian covariates, and coefficients scaled so that the linear predictor has variance gamma squared equal to five. In the limit, the MLE of each coefficient is alpha star times the truth plus noise: alpha star is . The noise has standard deviation sigma star, in their units, against the classical prediction of about . And twice the log likelihood ratio for a null coefficient is not chi-squared with one degree of freedom, but times one.
One fit is enough to see it. Two thousand observations, four hundred variables; an eighth of the coefficients are plus , an eighth minus , the rest zero. Each dot is a coefficient, true value across, estimate up; the grey line is what the textbook expects. The estimates follow the green line instead, slope , as Sur and Candès predict. The fitted slope is . And the null coefficients scatter with standard deviation : the theory says , the textbook .
The likelihood-ratio test, run times on a coefficient that is truly zero. With the textbook chi-squared, the p-values pile up near zero: percent fall below five percent, and below one. Divide the statistic by Sur and Candès's factor, , and the histogram is closer to uniform, with finite-sample and Monte Carlo error: percent below five percent.
Why can fixed-dimensional approximations fail? With ordinary unit-scale predictors, individual coordinate errors often shrink at the root-n rate in regular fixed-dimensional models. Across p coordinates the total squared error is of order p over n, which need not vanish when p is proportional to n. Taylor remainder rates depend on the model; p over root n is not a universal formula. Nonnegligible joint estimation error can change centering, spread and likelihood-ratio limits. We study exact limiting formulas under stated model assumptions, using random matrices, AMP, Gaussian comparison and replica predictions with rigorous results where available.
Two promises come due. Part twenty-two said the MLE is efficient and Wilks's statistic is chi-squared, assuming p fixed as n grows; chapters one and nine give the proportional limits and the corrections. Part fifty-two gave high-dimensional rates, up to constants, under sparsity; chapters three to eight give exact errors, constants included.
Numbers: n = 2,000, p = 400, β ∈ {−10, 0, 10}: fitted slope 1.478 (α⋆ = 1.499); null spread 4.59 (σ⋆ = 4.74; textbook 3.88); 500 LRTs at n = 1,000: χ²₁ size 8.6% (2.6% at 1%), rescaled 3.8% (0.4%)
1The proportional regimePhD6 min
The proportional regime: what changes when p grows with n, and what takes the place of the old answers.
The proportional regime lets n and p grow together, with their ratio kappa fixed. The signal is scaled so that the linear predictor stays of order one: not every coefficient large, but their total effect fixed. Then each estimated coordinate has error of order one, in the right units, and the empirical distribution of the errors over coordinates has a limit. The answers are deterministic numbers, solutions of fixed-point equations, that depend only on kappa, the signal strength, and the model.
The simplest case is exact at every n. For least squares with Gaussian covariates and noise variance sigma squared, the expected squared error of the coefficient vector is sigma squared times p over n minus p minus one. As a function of kappa, that is sigma squared kappa over one minus kappa: a fifth as many variables as observations inflates each coordinate's variance by a quarter, not by nothing; half as many doubles it. And as kappa approaches one the error explodes: the design becomes singular, which ridgeless regression will cross in chapter three.
Where the trouble comes from. Two thousand observations of a thousand independent variables, each with variance one. The true covariance matrix is the identity: every eigenvalue is one. The sample covariance's eigenvalues spread from to . Their histogram approximates the limiting Marchenko–Pastur law, with edges at one minus and one plus root kappa, squared. Inverting such a matrix amplifies its smallest eigenvalues, and that is where the inflation comes from.
The Marchenko–Pastur law of 1967 is the proportional regime's first exact answer. For a sample covariance with identity truth and ratio kappa, the eigenvalue distribution converges to a law supported between one minus root kappa squared and one plus root kappa squared. Its density is the square root of the product of the distances to the two edges, over two pi kappa x. Its mean is one, but the mean of one over the eigenvalues is one over one minus kappa. That is exactly the least-squares inflation of the last ladder: the trace of the inverse sample covariance, divided by p.
The whole picture, from Sur and Candès's system of three equations in alpha, sigma and lambda, solved here by root finding with Gauss–Hermite quadrature. The bias alpha, the noise level sigma, and the likelihood-ratio factor all grow with kappa: at a twentieth, the factor is about one point oh seven; at a quarter it is one point eight four. These numbers match the paper's, to four decimals, where it reports them. At kappa three tenths the improved solver finds alpha about three point zero seven four and LRT factor about two point nine five two. The old solver failed here, but that was a numerical failure: three tenths lies below the theoretical existence boundary.
A worked case at the global null, where no coefficient matters and the system has two equations. At kappa a fifth, sigma star is 2.85 and lambda star 1.28, so the likelihood-ratio factor is a fifth times 2.85 squared over 1.28, about 1.27. A test at the textbook's five percent level then uses the cutoff 3.84, while the right cutoff is 1.27 times 3.84, about 4.87. The true size of the textbook test is the chance that 1.27 times a chi-squared exceeds 3.84: about eight percent, not five.
When does the MLE exist at all? If the cases and controls can be separated perfectly by a hyperplane, the likelihood has no maximum. Thomas Cover's 1965 counting says that with no signal, random points in p dimensions become separable once p exceeds n over two. Candès and Sur found the boundary for every signal strength: kappa must be below the minimum over t of the expected positive part of Z minus t V, squared. With no signal that is a half; with gamma squared five it is , so three tenths is still inside the asymptotic existence region. At the boundary itself a separate analysis is needed.
Each theorem has its own design assumptions. The original logistic example uses independent Gaussian covariates. Some universality results extend particular limiting laws to specified independent non-Gaussian designs, with moment and signal conditions. Matching two moments alone is not a universal theorem. Coordinate-distribution results require appropriate empirical signal convergence and moment control. Zhao, Sur and Candes extend logistic coefficient inference to arbitrary nonsingular Gaussian covariance, using conditional predictor variances. Arbitrary non-Gaussian correlation requires more justification. The biopsy example is a semi-synthetic stress test outside the Gaussian theorem, not evidence that its coverage guarantee automatically transfers.
Numbers: OLS: σ²κ/(1 − κ); MP at κ = 0.5: eigenvalues 0.088–2.87 (edges 0.086, 2.91); γ² = 5: α⋆ 1.073, 1.168, 1.299, 1.499, 1.871 and factor 1.073, 1.166, 1.294, 1.487, 1.840 at κ = 0.05–0.25; at 0.3, α⋆ = 3.074 and LRT factor 2.952; the old solver failure did not imply nonexistence; the MLE exists for κ < 0.500 (γ = 0), 0.32559 (γ² = 5); global null κ = 0.2: factor 1.268, χ² size ≈ 8%
2Random matrix toolsPhD5 min
The workhorse is the Stieltjes transform. For a probability law mu on the real line, m of z is the expectation of one over lambda minus z, for z off the real axis. For a matrix, it is the normalized trace of the resolvent, the inverse of the matrix minus z. Traces of inverses are exactly what statistics needs: the variance of least squares, the risk of ridge, the degrees of freedom of a smoother. And the transform determines the law, as the characteristic function does in Part forty-three.
Stieltjes inversion recovers a density at its continuity points from the imaginary part of the transform as the imaginary argument tends to zero. At a positive imaginary argument, the result is a Cauchy-smoothed density. Atoms need separate accounting; this formula is not a finite-height plot of an atom. The Marchenko-Pastur transform solves a quadratic, with its branch chosen by positive imaginary part and the proper behavior at infinity. For ratios above one there is also an atom at zero. This converts limiting spectral laws into computable traces for statistical risk.
Use the p by p covariance S, written as a sum of n independent row outer products divided by n. Remove one row contribution, a rank-one update, and apply Sherman-Morrison. At a fixed complex argument above the real axis, the row's quadratic form divided by n concentrates near kappa times m, not m. The trace identity gives one plus z m equal to m over one plus kappa m. Rearranging yields the displayed Marchenko-Pastur quadratic. The independence and normalization in this leave-one-row-out calculation matter. Similar resolvent and concentration ideas recur in more complicated estimation problems.
Some moments of the Marchenko–Pastur law, as a check. Its mean is one: on average, eigenvalues are right. Its variance is kappa: at kappa a half, the eigenvalues spread with standard deviation 0.71 around one. The mean of the inverse is one over one minus kappa, two at a half, which is least squares' inflation. And the largest eigenvalue is near one plus root kappa squared, 2.91 at a half, against the truth of one: the limiting top eigenvalue exceeds one in this isotropic proportional model, which is why Part fifty-two shrank it.
Free probability, Dan Voiculescu's theory from the 1980s, answers a harder question: what is the spectrum of a sum of two large matrices, A plus B, when their eigenvectors are in generic position? Not the convolution of their spectra: eigenvalues do not add. Instead the free convolution, computed through the R-transform, which adds the way cumulants add for independent variables. For a semicircle of variance s squared plus any matrix D, Pastur's equation gives it directly: m of z is the average over D of one over d minus z minus s squared m of z.
A test. W is a Wigner matrix of size , whose spectrum is a semicircle of variance a quarter. D is a diagonal of random plus and minus ones. The eigenvalues of their sum, in blue, form two bumps. The naive guess, ordinary convolution of the two spectral laws, shifts of the semicircle by plus and minus one, is wrong: the bumps are flatter, with hard edges. The free convolution, computed from Pastur's equation, matches the limiting shape. A small positive imaginary part smooths the computed density; finite matrices fluctuate.
Why does Pastur's equation work? Adding a semicircle of variance s squared shifts the argument of D's resolvent by s squared times m: the subordination idea. Then m is the Stieltjes transform of D, evaluated at the shifted point, and it must agree with itself: a fixed point. Solving it at each x slightly above the axis, by damped iteration, gives the density. The same structure, a transform evaluated at a self-consistently shifted point, appears in ridge regression's risk and in the deterministic equivalents of chapter eight.
What these tools buy statistics. The spectrum of a sample covariance, and so the bias of its eigenvalues, which Part fifty-two's shrinkage corrected. Traces of inverses, and so the exact variance and risk of linear estimators. Sums and products of matrices, and so models with structured noise. But not nonlinear estimators, such as the logistic MLE or the lasso: for those we need the next three tools.
Numbers: MP moments at κ = ½: mean 1, SD 0.71, mean inverse 2, top edge 2.91; Wigner (N = 1,500, s² = ¼) plus ±1 diagonal against the free convolution
3Exact ridge and ridgeless riskPhD5 min
Edgar Dobriban and Stefan Wager computed the exact risk of ridge regression in the proportional regime, in 2018. With isotropic features, ratio gamma, signal energy r squared and noise variance sigma squared, everything is a function of the Marchenko–Pastur Stieltjes transform at minus lambda. The bias is r squared lambda squared times the derivative of m: shrinkage pulls the estimate toward zero. The variance is sigma squared gamma times m minus lambda times its derivative. These are limiting excess prediction risks under the stated isotropic model and signal energy. Bias here means its squared-risk contribution; irreducible test noise is excluded.
The curves, at half as many variables as observations and a signal-to-noise ratio of four. The bias rises with the penalty. The variance falls. Their sum is the risk, and simulations at four hundred observations sit on it. Its minimum is at lambda equal to gamma over the signal-to-noise ratio, , with risk : Dobriban and Wager's optimal penalty, in closed form.
The optimal penalty has a Bayesian reading. If the coefficients were drawn from a normal prior with total energy r squared, ridge at lambda equal to gamma sigma squared over r squared would be the posterior mean. In the proportional regime the risk does not depend on the coefficients' direction, only their energy, so the same expected-risk-optimal ridge penalty applies to any fixed vector of that energy in this isotropic model. This is optimality among ridge penalties, not every imaginable estimator. Here its risk is . Leave-one-out or generalized cross-validation can estimate risk under suitable assumptions. Ordinary fixed-fold cross-validation trains at a different aspect ratio and may require an adjustment to select a full-sample penalty.
Now let the penalty go to zero. When gamma is below one, ridge becomes least squares. When gamma exceeds one, there are infinitely many interpolating solutions, and the limit picks the one of minimum norm. Trevor Hastie, Andrea Montanari, Saharon Rosset and Ryan Tibshirani wrote its risk exactly: sigma squared gamma over one minus gamma below the threshold, and r squared times one minus one over gamma, plus sigma squared over gamma minus one, above it. With positive observation noise, risk diverges on approaching gamma one. Past that threshold it first falls; the signal-dependent bias can make it rise again later. These are exact limiting risk formulas, not exact risks of every finite dataset.
Worked numbers, with signal energy four and noise variance one. At gamma a half, least squares' risk is one times a half over a half: one. At gamma nine tenths, it is nine: close to the threshold, noise dominates. At gamma two, the interpolator's risk is four times a half plus one over one: three. At gamma four, four times three quarters plus a third: about 3.33, approaching the risk of predicting zero, which is four.
The ridgeless risk across gamma, with signal energy four and noise variance one. Simulations, in gold, follow it. It explodes at the interpolation threshold, where the design is square. Beyond it the risk first falls. For signal energy four it reaches a minimum at gamma two, then increases toward the risk of predicting zero, shown in grey. The green curve is ridge with the optimal penalty: it rises smoothly with dimension, without the interpolation spike. The second descent is real, but the peak is an artefact of not regularizing.
Why the peak? At gamma equal to one the design matrix is square, and its smallest singular value is close to zero: the Marchenko–Pastur law's left edge, one minus root gamma squared, touches zero. Least squares divides the noise by that singular value, and the variance explodes. Past the threshold, the minimum-norm solution spreads the fit over more directions than there are observations, and the smallest nonzero singular values move away from zero again. So the variance falls, while the bias rises because the interpolator cannot see the part of the signal outside the row space.
What this says about interpolation. Fitting the training data exactly is not automatically a disaster: past the threshold, the minimum-norm interpolator can generalize. With isotropic features it is never better than tuned ridge; with features whose spectrum decays in the right way, Part fifty-four's benign overfitting, it can be nearly as good. And the formulas are exact: the whole curve, peak included, is determined by gamma, r squared and sigma squared.
Numbers: γ = ½, r²/σ² = 4: λ⋆ = 0.125, risk 0.702 (theory = simulation at n = 400); γ = 2: optimal risk 2.56; ridgeless: 1 (γ = ½), 9 (0.9), 3 (2), 3.33 (4); simulated 0.99, 9.99, 2.97, 3.33
4M-estimation in high dimensionsPhD4 min
M-estimation in high dimensions: when the textbook's choice of loss is wrong. Part thirty's robust regression chose the loss by the error distribution: least absolute deviations for heavy-tailed errors, because its asymptotic variance is smaller there. For Laplace errors, fixed-p theory says least absolute deviations has half the variance of least squares. Noureddine El Karoui, Derek Bean, Peter Bickel, Chinghway Lim and Bin Yu asked in 2013 what happens when p grows with n. Their answer: the error of a suitable M-estimator under their design and loss conditions solves a system of two equations, and the ranking of losses can reverse.
A simulation, with Laplace errors of variance one. Least squares follows its finite-n expectation, p over n minus p minus one; the proportional limit is kappa over one minus kappa. Least absolute deviations, in gold, starts lower, as fixed-p theory promises: at a tenth, against . But the curves cross between a fifth and three tenths, and at a half least squares is better, against , although the errors are exactly the kind least absolute deviations was designed for.
The theory behind the crossing. For an M-estimator with loss rho, the residual of a held-out observation is the error plus a Gaussian term whose standard deviation r is the estimator's error, and the fitted residual is the proximal map of rho, at a scale c, applied to that held-out residual. Two equations in r and c follow, from leave-one-out arguments: one matching the proximal map's average slope to one minus kappa, one matching the squared size of the fitted scores to kappa r squared. David Donoho and Andrea Montanari derived the same system from approximate message passing, in 2016.
A check of the system on least squares, where rho is half the square. Its proximal map at scale c is the input divided by one plus c, with constant slope one over one plus c. The first equation gives one over one plus c equal to one minus kappa. The second then gives r squared equal to the error variance times kappa over one minus kappa: chapter one's formula once more, from a third route.
Why least absolute deviations loses. In high dimensions the fitted residuals are not the errors: a held-out residual has effective noise equal to the error plus a Gaussian estimation term. The in-sample fitted residual also has the proximal shrinkage from the previous ladder. As kappa grows, that Gaussian term dominates. A loss tuned to the tails of the errors is then tuned to the wrong distribution: the effective noise is the error convolved with a normal. This helps explain why the OLS-LAD ranking can reverse in the displayed Laplace experiment. It is not a theorem that squared loss is optimal for every error law at every large ratio.
So what is the best loss? Bean, Bickel, El Karoui and Yu found it in 2013: not minus the log density of the errors, as at fixed p, but minus the log density of the errors convolved with a normal of the right variance, passed through a proximal transformation. For log-concave errors the optimal loss is convex, and it becomes more quadratic as kappa grows. Maximum likelihood is no longer optimal among M-estimators: efficiency has to be re-derived for the regime.
The lessons of chapter four. Fixed-p efficiency rankings can reverse in high dimensions. Residuals are not errors: they carry the estimation noise of all p coefficients. And under the stated Gaussian design and loss conditions, a scalar system characterizes the limiting error, which also says how to choose the loss.
Numbers: Laplace errors, n = 400: κ = 0.1 LAD 0.085 vs OLS 0.102; κ = 0.5 LAD 1.15 vs OLS 1.03
5AMP and state evolutionPhD6 min
Approximate message passing and its state evolution: an algorithm whose every step can be predicted exactly.
David Donoho, Arian Maleki and Andrea Montanari introduced approximate message passing in 2009, for compressed sensing: recover a sparse x from y equal to A x plus noise, with A an n by p Gaussian matrix. Each step forms a pseudo-observation, the current estimate plus A transpose times the residual, and soft-thresholds it, as the lasso does. The residual carries one extra term, the Onsager correction: the previous residual, times the fraction of coordinates currently nonzero, divided by delta, the ratio n over p.
Without the Onsager term, this resembles iterative soft thresholding with a unit step; ordinary ISTA also needs a suitable step size, and its pseudo-observations are a tangle of correlated errors. The extra term cancels, to leading order, the correlation between the current estimate and the noise in A transpose z. The effect is remarkable: at every iteration, the pseudo-observation behaves like the truth plus independent Gaussian noise, coordinate by coordinate. The idea comes from statistical physics, where Thouless, Anderson and Palmer used such a reaction term for spin glasses in 1977.
Then the noise level obeys a one-dimensional recursion, the state evolution. The next noise variance is the measurement noise, plus one over delta times the mean squared error of the soft-threshold denoiser applied to the truth plus noise at the current level. The expectation is over one scalar: a coordinate of x drawn from its empirical distribution, and an independent standard normal. Mohsen Bayati and Montanari proved in 2011 that this holds exactly in the proportional limit, for Gaussian matrices, at every fixed iteration.
The part's instrument: the state-evolution cobweb. A thousand measurements of a two-thousand-dimensional signal, a tenth of it plus or minus one. Small noise, and a threshold of one and a half noise levels. The blue curve is the map from one noise variance to the next; the grey line is the diagonal. Iterating the map traces the gold staircase, step by step down to the crossing. The white dots are the real algorithm's measured noise at each iteration: they land on the staircase. Both settle at the fixed point, : the algorithm's whole trajectory was predictable from one scalar map.
The numbers, side by side. After one iteration, AMP's noise variance is , and state evolution predicts . After three, against . After twenty-five, the estimate's mean squared error is . At two thousand dimensions the agreement is close in this single simulation; the theorem says it becomes exact as the dimension grows.
Each dense AMP step multiplies by A and by its transpose. This costs order n times p operations. At a thousand by two thousand, the two products use about four million multiply-accumulate pairs, or eight million elementary floating-point operations. The illustration runs twenty-five iterations. Coordinate descent can have a comparable order per sweep, but wall-clock speed depends on implementation, conditioning and stopping accuracy. State evolution predicts AMP's limiting trajectory under its assumptions. Ordinary AMP can fail for correlated or poorly conditioned designs; damping and vector variants have their own conditions, rather than a universal repair.
State evolution explains Part thirty-two's Donoho–Tanner curve. With no noise, the fixed point at zero is stable, and the signal is recovered exactly, when the map's slope at zero is below one. That slope depends on the sparsity rho, the undersampling delta, and the threshold. Minimizing over the threshold gives the boundary in closed form: rho of delta is the maximum over z of one minus two over delta times a Gaussian integral, divided by one plus z squared minus twice that integral. Donoho, Maleki and Montanari showed it is exactly the curve Donoho and Tanner had found from the geometry of random polytopes.
The curve, computed from state evolution. Below it, l-one minimization and AMP recover the sparse signal exactly when there is no noise. Our problem sits at delta a half and rho a fifth, comfortably inside. It is the same curve Part thirty-two drew from counting the faces of random polytopes: two theories, one answer.
A proof conditions on the matrix information revealed by earlier iterates. For an IID Gaussian design the unexplored component retains a controlled Gaussian distribution. The Onsager correction cancels the leading feedback from reusing the same matrix. Induction proves an empirical distributional state-evolution limit at every fixed iteration, under denoiser and moment conditions. It does not say finite-dimensional errors are exactly independent Gaussians, or justify exchanging iteration and dimension limits without more work. At a converged fixed point, the soft threshold's KKT conditions match a lasso with a calibrated positive penalty. Additional convergence analysis connects fixed-iteration AMP theory to the estimator's limiting risk.
Numbers: n = 1,000, p = 2,000, ε = 0.1, σ² = 0.01, θ = 1.5: τ²₁ 0.129 (SE 0.131), τ²₃ 0.079 (0.079); MSE after 25 iterations 0.019
6Gordon's comparisonPhD5 min
Gordon's comparison inequality: replacing a matrix by two vectors. Yehoram Gordon proved in 1985 a comparison between two Gaussian processes. The primary one is a bilinear form, u transpose G w, for a Gaussian matrix G, plus any function psi of u and w. The auxiliary one replaces the matrix by two independent Gaussian vectors, g and h: the norm of w times g transpose u, plus the norm of u times h transpose w. Gordon's inequality says the min-max of the primary is, with high probability, at least that of the auxiliary, minus a little. The auxiliary problem has only vectors, and its min-max collapses to a few scalars.
Gordon's lower-tail comparison needs compact index sets and a continuous deterministic objective term, with the stated Gaussian construction. It does not claim every auxiliary problem automatically collapses to scalars. Convex compact sets and a convex-concave objective give the complementary optimal-value comparison in the convex Gaussian min-max theorem. If the auxiliary value concentrates, these inequalities can transfer its limit to the primary value. Transferring a minimizer's error requires more: compare a restricted auxiliary problem outside the desired error region and establish a positive value gap. An arbitrary property of an auxiliary minimizer does not transfer for free. Noncompact estimators require localization or truncation justified by the problem. The theorem is a tool for deriving risk, not a universal formula for every convex estimator.
The recipe for an estimator minimizing a loss of y minus X beta plus a penalty. Write the loss through its convex conjugate, which introduces the max over u and the bilinear form in the Gaussian design. Replace it by the auxiliary problem and optimize over the directions of u and w: two or three scalar variables remain, the norm of the error among them. Their saddle point is the answer, and the equations it satisfies are, in every case checked, the same as state evolution's fixed point.
A worked case: least squares, with n by p design, kappa less than one, and noise sigma. The auxiliary problem, after optimizing over directions, is a minimization in one scalar, the error norm a, of root of a squared plus sigma squared, times root n, minus a times root p. Setting its derivative to zero gives a squared over a squared plus sigma squared equal to kappa, so a squared is sigma squared kappa over one minus kappa. That is chapter one's exact formula, recovered in four lines without inverting a matrix.
The same calculation for ridge adds the penalty to the auxiliary problem. The minimization over directions now trades the residual term against the penalty, leaving two scalars: the error norm and the projection of the estimate on the truth. Their optimum reproduces chapter three's Dobriban–Wager formula, which there came from the Marchenko–Pastur Stieltjes transform. Random matrices, Gordon, and AMP: three derivations of one number, which is the strongest evidence that it is right.
For the lasso, the same recipe gives two scalar equations, in the error level tau and a scaling of the penalty. They say tau squared equals sigma squared plus one over delta times the soft-threshold error at noise tau, and that the threshold relates to the penalty through the fraction of nonzero coordinates. These are state evolution's fixed-point equations, from chapter five, exactly. So the lasso's exact error is known two ways: as the limit of an algorithm, and as the saddle point of a Gaussian min-max. The cobweb's fixed point is the lasso's error.
AMP and CGMT provide complementary analyses. AMP's fixed-iteration state evolution does not require convergence. Using it to identify a limiting estimator does require further convergence and limit arguments. Suitable AMP denoisers can be nonconvex or Bayesian. CGMT compares Gaussian optimization problems directly, with convexity for its two-sided conclusion. Risk statements require concentration, localization and a gap for the target minimizer property. Where both theorems apply with the same normalizations, their scalar equations agree. Replica methods can suggest formulas beyond those rigorously covered cases.
Numbers: least squares from the auxiliary problem: a² = σ²κ/(1 − κ)
7The replica methodPhD5 min
The replica method: the physicists' predictions, and their proofs. Statistical physicists study the average free energy, the log of a partition function, of systems with random interactions. The replica trick computes the average of the log through the average of the partition function to the power n, for integer n, and then lets n go to zero. It is not rigorous, but it makes exact predictions, under an assumption called replica symmetry. For a Bayesian inference problem, the free energy is the log of the evidence, Part twenty-eight's marginal likelihood, and its derivatives give the minimum mean squared error.
For sparse linear regression with an i.i.d. prior, the replica-symmetric prediction reduces to a scalar problem: observe one coordinate of the signal in Gaussian noise of variance tau squared, and compute its minimum mean squared error, mmse of tau. The effective noise satisfies tau squared equals sigma squared plus mmse of tau over delta, the fixed point of a state evolution with the Bayes-optimal denoiser in place of soft thresholding. When several fixed points exist, the true one minimizes a potential, the replica free energy.
Bayes-optimal AMP runs that state evolution as an algorithm: replace the soft threshold by the posterior mean of a coordinate given its pseudo-observation. For a signal that is zero with probability nine tenths and plus or minus one otherwise, the posterior mean is a ratio of three Gaussian densities. AMP then reaches the fixed point that state evolution reaches from an uninformative start. When that is the potential's global minimum, AMP is Bayes-optimal: it achieves the minimum mean squared error that any method could.
The Bayes denoiser in numbers. With noise level a half, suppose the pseudo-observation is 0.5, halfway between zero and one. The prior gives zero eighteen times the weight of each signed nonzero value, and the likelihood of 0.5 is the same under zero and under one, and much smaller under minus one: weights nought point nine, nought point oh five, and nearly nothing. So the posterior mean is about 0.05, shrinking hard toward zero. At an observation of 1.0 it rises to about 0.29: a smooth, prior-aware shrinkage that soft thresholding cannot imitate.
These curves are scalar state-evolution predictions for a three-point prior with ten percent nonzeros and small positive measurement noise. The blue curve is the best converged positive-penalty lasso candidate on our threshold grid. The blue vertical line is the separate noiseless Donoho-Tanner threshold, not a proof of exact recovery with positive noise. The gold curve uses the posterior-mean denoiser from an uninformative initialization. It is an algorithmic fixed point; we have not computed the global replica-potential minimum here, so it is not automatically the information-theoretic MMSE. The gold line marks the first sampled measurement ratio with per-coordinate MSE below one-thousandth, a stated near-recovery criterion. The comparison shows how this denoiser uses the known discrete prior. Its thresholds depend on grid resolution, noise and initialization.
The replica formula predicts the minimum mean squared error of any method, efficient or not. In some regions, AMP's fixed point from an uninformative start is not the potential's global minimum: the information is there, but AMP does not find it. Physicists call this the hard phase, and conjecture that no polynomial-time algorithm can do better there. Evidence for the conjecture comes from low-degree polynomials and other restricted models of computation; a proof is open, and it is chapter ten's first problem.
The predictions came first; the proofs came decades later. Jean Barbier, Florent Krzakala, Nicolas Macris, Léo Miolane and Lenka Zdeborová proved in 2019 the replica formula for generalized linear models with i.i.d. Gaussian designs, by interpolation: deform the problem continuously into the scalar channel and control the change in free energy. Earlier proofs covered the linear model, by Reeves and Pfister and by Barbier and colleagues; all confirm the physicists' formulas.
Numbers: three-point prior ε=.1, noise 1e−4: uninformative Bayes-denoising AMP first has MSE<.001 at sampled δ=.30; not the computed global replica MMSE. Noiseless lasso boundary δ=.32879; positive-noise lasso still has error
8Random features and kernelsPhD5 min
Random features and kernels: a bridge from regression to neural networks. Random-features regression: draw N random weight vectors w, once, and use the features sigma of w transpose x, with sigma a fixed nonlinearity such as the ReLU. Then fit the output weights by ridge regression. It is a two-layer neural network whose first layer is frozen at random, and Ali Rahimi and Ben Recht introduced it in 2007 as a cheap kernel method. Its proportional limit has three sizes growing together: observations n, input dimension d, and features N.
Three hundred observations in thirty dimensions, with a linear target, fitted with between ten and two and a half thousand ReLU features. Without a penalty, the test error rises to a spike, , where the number of features equals the number of observations, and then falls again. A tiny ridge penalty, in green, removes the spike: the remaining curve has much less interpolation amplification in this example. Width effects need not be monotone in every model. At the square fit, heavy tails make a six-run mean especially unstable.
Song Mei and Andrea Montanari computed the exact limiting test error of random-features ridge regression in 2022. The key fact is a linearization: the nonlinear features behave, in the proportional limit, like a Gaussian-equivalent matrix for the risk quantities in the theorem, with coefficients determined by the activation's Hermite moments. This is not an identity in distribution for each individual feature. The error is then a ridge-type formula in chapter two's random-matrix transforms, now of a structured matrix. Under their spherical input/weight and target assumptions it gives an exact limiting risk. Our finite Gaussian-input simulation is an illustration, with no computed theorem curve overlaid.
For a standard normal projection, ReLU has mean one over the square root of two pi, about point four. Its linear Hermite coefficient is one-half. The remaining orthogonal Hermite components have variance one-half minus one over two pi minus one-quarter, about point zero nine one. A Gaussian-equivalent matrix with these matched coefficients can reproduce certain limiting spectral and risk quantities under the random-feature theorem's assumptions. This is not a distributional identity turning each nonlinear feature into a linear projection plus independent Gaussian noise.
As the number of features grows without limit, random-features ridge becomes kernel ridge regression, Part twenty-nine's, with the kernel equal to the expected product of features. In the proportional regime, suitable isotropic high-dimensional inner-product kernels can be effectively linear for generic target components: they learn only the linear part of the target, plus a ridge penalty from the nonlinear part, as Noureddine El Karoui showed for kernel matrices in 2010. To learn more, n must grow like a higher power of d. That staircase, one polynomial degree for each power of d, is a theory of what wide networks in this lazy regime can and cannot learn.
Our finite example has three hundred observations and thirty input coordinates. Comparing n to powers of d is an asymptotic guide, not a sharp finite-data impossibility test. In suitable high-dimensional isotropic kernel models, learning a generic degree-two component typically needs a sample size comparable to the quadratic feature dimension, of order d squared. Special low-rank quadratics can be easier. Here the target is linear with variance one over thirty; reported error is against its noiseless conditional mean and excludes test noise. The two penalties use the same repeated datasets and nested features normalized by one over root N. Width can improve approximation to the kernel, but cannot by itself guarantee recovery of every target. We do not infer that all quadratic targets are unlearnable at this finite sample size.
The experiment illustrates one random-feature model, with six repeated datasets per curve. Ridgeless interpolation can have a large spike near the square feature matrix, while sufficiently overparameterized fits can have lower excess risk. A positive penalty regularizes small singular values, but neither monotone improvement with width nor a particular optimal penalty is universal. Read the simulation with its Monte Carlo uncertainty. Rigorous limiting formulas cover particular input, weight, activation and target models. They help explain a frozen first layer, rather than all trained neural networks.
Numbers: normalized paired/nested ReLU experiment, n=300,d=30: six-run ridgeless mean peak 480.8 (empirical SE 287.0), final mean 0.2635; λ=.001 final 0.0308; risk excludes test noise, target variance 1/30
9Corrected inferencePractice5 min
Corrected inference: rescaled tests, debiased estimates, and a real design. The first correction is to the likelihood-ratio test. Under the null, twice the log likelihood ratio converges to kappa sigma star squared over lambda star, times a chi-squared with one degree of freedom. So divide the statistic by that factor before comparing it with the chi-squared table. Here the factor is , and the simulated mean of the statistic is , against the factor's prediction of the same. For a fixed number k of null coefficients tested jointly, the same factor multiplies a chi-squared with k degrees of freedom.
The second correction is to the estimates: divide the MLE by alpha star. Then each coordinate is approximately unbiased, with standard deviation sigma star over alpha star in the same units. A confidence interval for beta j is the debiased estimate, plus or minus one point nine six times that standard deviation, after the right normalization. At kappa a fifth and gamma squared five, alpha star is and sigma star : the uncorrected center is inflated. Once the center is divided by alpha, its appropriate noise scale is also divided by alpha, so the corrected interval need not be wider.
A worked interval in the hook's units. Suppose a coefficient's MLE is 15. The textbook reports it as 15, with a standard error of 3.9 from the Fisher information: an interval from 7.4 to 22.6. The corrected estimate is 15 over 1.50, which is 10, with standard error 4.74 over 1.50, about 3.2. So the corrected interval runs from 3.8 to 16.2: centred a third lower, and shaped by the right noise level.
These corrections depend on an unknown signal-strength parameter. The numerical tables use the known simulation truth, so they are oracle illustrations rather than an implementation of a feasible estimator. ProbeFrontier estimates signal by examining separability under subsampling, using the theoretical phase boundary. SLOE instead estimates the corrupted predictor variance from leave-one-out fitted predictions. Combined with the scalar equations, that reparameterization supports feasible inference with the paper's Gaussian-model consistency guarantees. It is not simply a sample variance of response residuals. Nuisance estimation contributes its own finite-sample error; neither method automatically validates corrections outside its assumptions.
Does the theory survive a real design? The thirty features of the Wisconsin breast cancer biopsies are strongly correlated, nothing like independent Gaussians. Take biopsies at a time, so kappa is a fifth, and simulate logistic outcomes from a known coefficient vector, with gamma squared five as in the hook. Fit the MLE, and measure the inflation on the other biopsies, as the slope of the fitted linear predictor on the true one: with features this correlated, single coefficients are barely identified, but the predictor is. The data are real, the outcomes are simulated, and the truth is known: a semi-synthetic test.
Over subsamples of the biopsies. The textbook expects a slope of one: no inflation. The theory for a Gaussian design predicts . The measured slopes have a median of and a mean of . Eighty percent fall between and : on a real, strongly correlated design these finite converged fits show substantial variability outside the Gaussian model. This fixed-design stress test does not validate Gaussian-theory confidence coverage. Failed or separated fits are reported separately, and slopes condition on a finite converged fit.
Other corrections in the proportional regime. Debiased lasso intervals need a degrees-of-freedom adjustment when the support is a constant fraction of n, as Pierre Bellec and Cun-Hui Zhang showed. Under suitable model and validation assumptions, cross-validation can consistently estimate its target risk, but training-sample size and dependence between folds matter for both target and uncertainty. The bootstrap can fail: El Karoui and Purdom showed in 2018 that resampling residuals or pairs misstates the variance of regression estimates when p is a fraction of n.
Numbers: rescaled LRT; debiased interval example (3.8, 16.2) vs textbook (7.4, 22.6); breast cancer design, n = 150, γ² = 5: held-out predictor slope median 1.53, mean 1.64 (80% between 1.09 and 2.25) vs Gaussian theory 1.50
10Open problemsPhD3 min
The part in one table. The logistic MLE and its test, by leave-one-out and message passing: a bias and a rescaling factor. Spectra and traces of inverses, by Stieltjes transforms and free convolution. Ridgeless regression's exact double-descent curve. M-estimators, whose rankings reverse. The lasso's exact error, by AMP and Gordon's comparison. And the Bayes-optimal error, by replicas, with its hard phases.
Problem one: the hard phase. In sparse regression, planted clique and tensor problems, the replica method finds regions where the information to estimate is present but AMP does not reach it. Restricted models of computation, low-degree polynomials and statistical query algorithms, fail there too, which is evidence that no efficient algorithm succeeds. A proof that no polynomial-time algorithm can, under a standard complexity assumption, is open.
Another direction is realistic design structure. Independent-entry universality and arbitrary-covariance Gaussian logistic results already exist, with specific hypotheses. The biopsy exercise is a fixed-design semi-synthetic stress test with a finite-fit selection step; its predictor slope is not a coverage validation. An open question should specify the heavy tails, dependence, structure or nuisance estimation that remains untreated. A broad assertion that all correlated or structured designs are unsolved would ignore substantial theory.
Problem three: learning features. Random features and kernels are lazy: the first layer never moves. Trained neural networks learn their features, and the proportional theory of that regime, for even two-layer networks trained by gradient descent, is only beginning. Exact asymptotics for feature learning, and inference for its outputs, are open, and are Part sixty-four's frontier.
Problem four: how large is large? The predictions are limits, and at two thousand dimensions chapter five showed close agreement in one numerical example, not a uniform finite-sample accuracy guarantee. Non-asymptotic versions exist for convex problems through Gordon's comparison, and for AMP over a growing number of iterations, but with conservative constants. Sharp finite-sample corrections, so that a practitioner with n of a few hundred knows how much to trust the formulas, are open.
Uncertainty quantification remains an active research direction. Exact limiting risk formulas are point predictions in a specified asymptotic model, rather than exact finite-sample error bars. Cross-validation variability, bootstrap validity and post-selection inference each have existing positive and negative results. Selective and conformal procedures already cover several high-dimensional settings. A meaningful new project should identify a combination of assumptions and goals that those results do not address. The practical target is a usable guarantee with a clearly defined estimand, sampling model, selection rule and approximation error.
Five open problems. A proof of computational hardness in the hard phase. Exact theory for realistic, correlated and structured designs. The proportional asymptotics of feature learning. Sharp finite-sample corrections. And a full toolkit for inference when p grows with n.
Recap, problems, and the road aheadAll tracks2 min
Part fifty-nine in twelve lines. In the stated Gaussian logistic example with signal variance five and dimension ratio one-fifth, the MLE has inflation factor about one point five, and the likelihood-ratio test needs a rescaling. Least squares' variance is inflated by one over one minus kappa. The Marchenko–Pastur law and Stieltjes transforms explain why, and free convolution adds matrices. Ridge's risk is in closed form. Double descent is derived, peak and all. Least absolute deviations loses to least squares when kappa is large. AMP's trajectory is predicted by state evolution, and Gordon's comparison turns a matrix into two vectors. Replicas give the Bayes-optimal error and its hard phases; random features give a first exact theory of wide networks; and the corrections make inference honest again.
A promise for the next part. We studied exact limiting formulas under specified sampling models and numerical illustrations with finite-sample error. It assumed the test data look like the training data. Part sixty asks what can be guaranteed when the data are corrupted, or the future differs from the past.
Where it comes back. Part sixty's robust estimation in high dimensions. Part sixty-one's sample complexity of optimal transport. Part sixty-two's high-dimensional causal adjustment. Part sixty-four's theory of large models. And the dissertation's simulation study.
Six problems, with full solutions in the README. Least squares' exact error; the Marchenko–Pastur equation; the optimal ridge penalty; the ridgeless risk; Gordon's auxiliary problem for least squares; and AMP's fixed points as lasso solutions. Pause here if you want to try them.
The books behind this part: Bai and Silverstein on random matrices; Mingo and Speicher on free probability; and Mézard and Montanari on information, physics and computation; with the papers from Marchenko and Pastur to Sur and Candès.
Fifty-nine parts of sixty-five. In 2019 a team rebuilt the ImageNet test set, following the original recipe as closely as they could, and every model they tested lost accuracy on the new images: test sets are not the future. Next, Part sixty: robustness and distribution shift.
Where it goes next. Robust estimation in high dimensions and distribution shift follow in Part 60; the sample complexity of optimal transport in Part 61; high-dimensional causal adjustment in Part 62; the theory of large models beyond the lazy regime in Part 64; the dissertation's simulation study in Part 65.
Key results
The part's results in one place, for revision.
Try it
Lab 59 · Double descent and state evolution, theory against simulation
Fit minimum-norm least squares with p/n from 0.5 to 4 and compare its excess risk with the limiting formula, peak included; then run approximate message passing for the lasso on one random problem and compare its noise level at every iteration with the scalar recursion of state evolution.
python -m videos.stats.labs 59
needs numpy, scipy, matplotlib · download lab59.py ·
source on GitHubmin-norm risk at p/n = 0.5 1.00 limit 1.00
min-norm risk at p/n = 0.8 3.71 limit 4.00
min-norm risk at p/n = 1.25 4.99 limit 4.80
min-norm risk at p/n = 2 2.59 limit 3.00
min-norm risk at p/n = 4 3.30 limit 3.33
ridge at the optimal penalty, p/n = 0.5 0.677 limit 0.702
AMP noise level tau^2 at iteration 1 0.0537 state evolution 0.0532
AMP noise level tau^2 at iteration 3 0.0248 state evolution 0.0231
AMP noise level tau^2 at iteration 10 0.0172 state evolution 0.0170
mean squared error after 20 iterations 0.0037 state evolution's fixed point 0.0035
With p proportional to n the risk has an exact limit, infinite at p = n and falling again beyond it, and a p-dimensional algorithm is tracked by a one-dimensional recursion, constants included.
The code (74 lines; it asserts its own result)
"""Lab 59: check two exact proportional-regime predictions: the ridgeless risk curve and AMP's state evolution."""
import numpy as np
from videos.coursekit import labs
from explainer.stats.kit import amp
TITLE = "Double descent and state evolution, theory against simulation"
GOAL = ("Fit minimum-norm least squares with p/n from 0.5 to 4 and compare its excess risk with the limiting "
"formula, peak included; then run approximate message passing for the lasso on one random problem and "
"compare its noise level at every iteration with the scalar recursion of state evolution.")
TASKS = [
"Add the penalty lam = gamma/snr to ridge_sim's list at every gamma and overlay amp.optimal_ridge_risk. Where has the peak gone?",
"Lower delta = n/p from 0.5 to 0.2 at eps = 0.05. Does state evolution still reach a small fixed point, and does AMP follow it?",
"Replace the Gaussian matrix A by random signs divided by sqrt(n). State evolution was proved for Gaussian entries: does AMP still track it?",
]
def run(seed=0):
rng = np.random.default_rng(seed)
lab = labs.Lab()
# 1. ridgeless least squares: excess risk E||b - beta||^2 at ratio gamma = p/n, signal ||beta||^2 = 4, noise 1
n, snr = 160, 4.0
gammas = np.array([0.5, 0.8, 1.25, 2.0, 4.0])
reps = [8, 14, 10, 2, 2] # most where the risk is most variable, near p = n
sim = np.array([amp.ridge_sim(n, g, snr, [0.0], r, rng)[0] for g, r in zip(gammas, reps)])
theory = amp.ridgeless_risk(gammas, snr)
for g, s, t in zip(gammas, sim, theory):
lab.row(f"min-norm risk at p/n = {g:g}", f"{s:.2f} limit {t:.2f}")
opt_sim = amp.ridge_sim(n, 0.5, snr, [0.5 / snr], 10, rng)[0]
opt = amp.optimal_ridge_risk(0.5, snr)
lab.row("ridge at the optimal penalty, p/n = 0.5", f"{opt_sim:.3f} limit {opt:.3f}")
# 2. AMP for the lasso against state evolution: n = 1500, p = 3000, 5% of the signal is +-1
nn, p, eps, sigma2, theta = 1500, 3000, 0.05, 0.01, 1.5
A = rng.standard_normal((nn, p)) / np.sqrt(nn)
x0 = np.zeros(p)
x0[rng.choice(p, int(eps * p), replace=False)] = rng.choice([-1.0, 1.0], int(eps * p))
y = A @ x0 + np.sqrt(sigma2) * rng.standard_normal(nn)
fit = amp.amp_lasso(A, y, theta, iters=20)
tau2 = np.array(fit["tau"]) ** 2
se = amp.state_evolution(nn / p, eps, sigma2, theta, iters=20)
mse = np.mean((fit["x"] - x0) ** 2)
mse_se = (nn / p) * (se[-1] - sigma2)
for t in (1, 3, 10):
lab.row(f"AMP noise level tau^2 at iteration {t}", f"{tau2[t]:.4f} state evolution {se[t]:.4f}")
lab.row("mean squared error after 20 iterations", f"{mse:.4f} state evolution's fixed point {mse_se:.4f}")
lab.note = ("With p proportional to n the risk has an exact limit, infinite at p = n and falling again beyond it, "
"and a p-dimensional algorithm is tracked by a one-dimensional recursion, constants included.")
assert np.all(np.abs(sim / theory - 1) < 0.3), "the ridgeless risk matches its limit on both sides of the peak"
assert sim[1] > 2.5 * sim[0] and sim[2] > 1.3 * sim[3], "double descent: up toward p = n, then down beyond it"
assert abs(opt_sim / opt - 1) < 0.3 and opt_sim < sim[0], "the optimal ridge penalty beats least squares"
assert np.max(np.abs(tau2[:12] / se[:12] - 1)) < 0.2, "AMP follows state evolution iteration by iteration"
assert abs(mse / mse_se - 1) < 0.3, "and ends at its fixed point"
fig, ax = labs.figure(2, size=(11, 4.2))
lo, hi = np.linspace(0.05, 0.97, 200), np.linspace(1.03, 5, 300)
for k, g in enumerate((lo, hi)):
ax[0].plot(g, amp.ridgeless_risk(g, snr), color=labs.GOLD, label="limit: min-norm least squares" if k == 0 else None)
gg = np.linspace(0.05, 5, 200)
ax[0].plot(gg, [amp.optimal_ridge_risk(g, snr) for g in gg], color=labs.GREEN, label="limit: ridge at the optimal penalty")
ax[0].plot(gammas, sim, "o", color=labs.BLUE, label=f"simulated min-norm, n = {n}")
ax[0].axvline(1, color=labs.MUTED, ls="--", lw=1)
ax[0].set(title="Double descent: excess risk against p/n", xlabel="p/n", ylabel="excess risk", ylim=(0, 10))
ax[0].legend(loc="upper right")
it = np.arange(len(se))
ax[1].plot(it, se, color=labs.GOLD, label="state evolution (scalar recursion)")
ax[1].plot(it[:len(tau2)], tau2, "o", color=labs.BLUE, ms=4, label=f"AMP on one {nn} x {p} problem")
ax[1].axhline(sigma2, color=labs.MUTED, ls="--", lw=1, label="noise variance, the floor")
ax[1].set(title="AMP for the lasso: effective noise by iteration", xlabel="iteration t", ylabel="tau_t squared (log scale)", yscale="log")
ax[1].legend(loc="upper right")
lab.fig = fig
return lab
Now change it
- Add the penalty lam = gamma/snr to ridge_sim's list at every gamma and overlay amp.optimal_ridge_risk. Where has the peak gone?
- Lower delta = n/p from 0.5 to 0.2 at eps = 0.05. Does state evolution still reach a small fixed point, and does AMP follow it?
- Replace the Gaussian matrix A by random signs divided by sqrt(n). State evolution was proved for Gaussian entries: does AMP still track it?
Problems, with solutions
Try each problem before opening its solution.
-
Least squares. Show that for Gaussian least squares \(E\|\hat\beta - \beta\|^2 = \sigma^2 p/(n - p - 1)\), and find its limit.
Solution
Given X, Cov(β̂) = σ²(X′X)⁻¹, so E‖β̂ − β‖² = σ² E tr (X′X)⁻¹. For Gaussian rows, X′X is Wishart(n, I_p) and E (X′X)⁻¹ = I_p/(n − p − 1), so the trace is p/(n − p − 1) → κ/(1 − κ).
-
Marchenko–Pastur. Derive the Marchenko–Pastur equation \(\kappa z m^2 - (1 - \kappa - z)m + 1 = 0\) by leaving one independent row contribution out.
Solution
Write S = Σ_i x_i x_i′/n. The identity tr (S − z)⁻¹ S − z tr (S − z)⁻¹ = p, the Sherman–Morrison formula for each x_i, and concentration of x_i′(S₋ᵢ − z)⁻¹x_i/n around (p/n) m give p + zpm = n(1 − 1/(1 + κm)). Rearranged, κzm² − (1 − κ − z)m + 1 = 0.
-
Optimal ridge. From the ridge risk, show the optimal penalty is \(\lambda_\star = \gamma\sigma^2/r^2\).
Solution
Differentiating bias + variance in λ, and using the MP equation to eliminate m″, gives the stationarity condition r²λ = σ²γ, so λ⋆ = γσ²/r². This is also the Bayes posterior mean under a normal prior of total energy r², which minimizes the risk among all estimators for that prior.
-
Ridgeless, γ > 1. Derive the ridgeless risk for \(\gamma > 1\): \(r^2(1 - 1/\gamma) + \sigma^2/(\gamma - 1)\).
Solution
The minimum-norm solution is the projection of β onto the row space plus the noise fitted there. The row space has dimension n of p, so the unseen part contributes r²(1 − 1/γ). The noise contributes σ² tr (XX′)⁻¹, whose limit by the MP law with ratio 1/γ is σ²/(γ − 1).
-
Gordon for least squares. Solve Gordon's auxiliary problem for least squares and recover \(\sigma^2\kappa/(1 - \kappa)\).
Solution
The auxiliary objective after optimizing directions is f(a) = √(a² + σ²)√n − a√p. Setting f′ = 0 gives a/√(a² + σ²) = √κ, so a² = σ²κ/(1 − κ).
-
AMP's fixed points. Show that AMP's fixed points with the soft threshold are lasso solutions at the calibrated \(\lambda\).
Solution
At a fixed point, x = η(x + A′z; θτ) and z = y − Ax + z⟨η′⟩/δ. So z(1 − ⟨η′⟩/δ) = y − Ax, and A′z lies in the subdifferential of θτ‖x‖₁ at x. Then A′(y − Ax) = (1 − ⟨η′⟩/δ) A′z ∈ λ ∂‖x‖₁ with λ = θτ(1 − ⟨η′⟩/δ), which is the lasso's optimality condition.
Notes and sources
Where it comes back
- Part 60: robust estimation in high dimensions, and distribution shift.
- Part 61: the sample complexity of optimal transport.
- Part 62: high-dimensional causal adjustment.
- Part 64: the theory of large models, beyond the lazy regime.
- Part 65: the dissertation's simulation study.
Glossary
- The regime. Proportional asymptotics; κ = p/n; signal strength γ²; inflation α⋆; σ⋆; rescaled LRT; separability; universality.
- Random matrices. Marchenko–Pastur law; Stieltjes transform; resolvent; inversion formula; free probability; free convolution; R-transform; Pastur's equation; subordination.
- Risk. Ridge; ridgeless; minimum-norm interpolator; interpolation threshold; double descent; benign overfitting; GCV.
- Algorithms and comparisons. Approximate message passing; Onsager correction; state evolution; cobweb; fixed point; Donoho–Tanner curve; Gordon's inequality; CGMT; auxiliary problem.
- Physics. Free energy; replica trick; replica symmetry; scalar channel; MMSE; Bayes-optimal AMP; hard phase; statistical-computational gap; interpolation proof.
- Networks. Random features; Gaussian equivalence; Hermite coefficients; kernel limit; lazy regime; feature learning.
Sources
- The hook. P. Sur & E. Candès, PNAS 116 (2019); E. Candès & P. Sur, Ann. Stat. 48 (2020); P. Sur, Y. Chen & E. Candès, PTRF 175 (2019); T. Cover, IEEE Trans. Electronic Computers 14 (1965).
- Random matrices. V. Marchenko & L. Pastur, Mat. Sbornik (1967); L. Pastur, Teoret. Mat. Fiz. (1972); D. Voiculescu (1985–91); P. Biane (1998); Z. Bai & J. Silverstein, Spectral Analysis of Large Dimensional Random Matrices (2010); J. Mingo & R. Speicher, Free Probability and Random Matrices (2017).
- Ridge. E. Dobriban & S. Wager, Ann. Stat. 46 (2018); T. Hastie, A. Montanari, S. Rosset & R. Tibshirani, Ann. Stat. 50 (2022).
- M-estimation. N. El Karoui, D. Bean, P. Bickel, C. Lim & B. Yu, PNAS 110 (2013); D. Bean, P. Bickel, N. El Karoui & B. Yu, PNAS 110 (2013); D. Donoho & A. Montanari, PTRF 166 (2016).
- AMP. D. Donoho, A. Maleki & A. Montanari, PNAS 106 (2009); M. Bayati & A. Montanari, IEEE Trans. Inf. Theory 57 (2011) and 58 (2012); E. Bolthausen, Comm. Math. Phys. 325 (2014); D. Thouless, P. Anderson & R. Palmer, Phil. Mag. 35 (1977).
- Gordon. Y. Gordon, Israel J. Math. 50 (1985); C. Thrampoulidis, S. Oymak & B. Hassibi, COLT (2015).
- Replicas. M. Mézard, G. Parisi & M. Virasoro, Spin Glass Theory and Beyond (1987); J. Barbier, F. Krzakala, N. Macris, L. Miolane & L. Zdeborová, PNAS 116 (2019); G. Reeves & H. Pfister, ISIT (2016); M. Mézard & A. Montanari, Information, Physics, and Computation (2009).
- Random features. A. Rahimi & B. Recht, NeurIPS (2007); S. Mei & A. Montanari, CPAM 75 (2022); N. El Karoui, Ann. Stat. 38 (2010).
- Corrections. S. Yadlowsky, T. Yun, C. McLean & A. D'Amour, NeurIPS (2021); P. Bellec & C.-H. Zhang, Bernoulli (2022); N. El Karoui & E. Purdom, JMLR 19 (2018).
- Data. W. Wolberg, W. Street & O. Mangasarian (1995).
About this partfrom its README
Part 59 of a sixty-five-part course in statistics, from a first course to a PhD (see the series plan and the syllabus), and the fourth part of Stage V, the research frontier.
It opens with Sur & Candès (2019). In a logistic regression with one variable for every five observations and signal strength γ² = Var(x′β) = 5, the Gaussian-model MLE has limiting inflation factor α⋆ = 1.499. Its spread is σ⋆ = 4.74 against the textbook's 3.88, and twice the log likelihood ratio for a null coefficient is 1.487 χ²₁, not χ²₁. The part asks what happens to classical statistics when p and n grow together, and derives exact limiting formulas under stated assumptions:
- the proportional regime: the scaling, least squares' σ²κ/(1 − κ), the Marchenko–Pastur law, the Sur–Candès system solved by root finding and quadrature (checked against the paper), the MLE's existence boundary (Candès & Sur 2020), universality;
- random-matrix tools: Stieltjes transforms and inversion, the leave-one-column-out derivation, MP moments, free convolution (Voiculescu) by Pastur's equation, against a simulated Wigner-plus-diagonal matrix, subordination;
- exact ridge and ridgeless risk (Dobriban & Wager 2018; Hastie, Montanari, Rosset & Tibshirani 2022), the optimal penalty, double descent derived and simulated, why the peak, benign interpolation;
- M-estimation in high dimensions (El Karoui et al. 2013; Bean et al. 2013; Donoho & Montanari 2016): least absolute deviations beats least squares at small κ and loses at large κ, even for Laplace errors;
- approximate message passing (Donoho, Maleki & Montanari 2009) and state evolution (Bayati & Montanari 2011), shown in the state-evolution cobweb, the Donoho–Tanner curve from state evolution, Bolthausen's conditioning;
- Gordon's comparison (1985) and the CGMT (Thrampoulidis, Oymak & Hassibi 2015), least squares and ridge worked, the lasso's equations;
- the replica method: the scalar channel, Bayes-optimal AMP against the lasso, hard phases, the proofs (Barbier et al. 2019);
- random features and kernels (Rahimi & Recht 2007; Mei & Montanari 2022): double descent in a two-layer network with a frozen first layer, Gaussian equivalence, the kernel staircase;
- corrected inference: the rescaled LRT, the debiased MLE and its intervals, estimating γ (ProbeFrontier, SLOE), and a semi-synthetic test on the Wisconsin biopsies' correlated design, measured on the held-out linear predictor;
- five open problems.
It keeps two promises:
- Part 22 said the MLE is efficient and 2 log LR ⇒ χ², with p fixed. Chapters 1 and 9 give the proportional limits and the corrections.
- Part 52 gave high-dimensional rates up to constants. Chapters 3–8 give exact errors, constants included.
Built in this part:
statkit.amp(explainer/stats/kit/amp.py), tested intests/test_stats_kit_amp.py:- the logistic proximal map, and the Sur–Candès system in (α, σ, λ) by root finding with 161 × 161 Gauss–Hermite quadrature (it reproduces the paper's κ = 0.1 and κ = 0.2 values to four digits), the global-null system, and the MLE's existence boundary;
- the logistic MLE by damped Newton and the LRT for one coefficient;
- the Marchenko–Pastur Stieltjes transform and density, exact ridge bias, variance and risk, the optimal penalty, the ridgeless risk, and a ridge/ridgeless simulator;
- AMP for the lasso, its state evolution, the minimax-threshold Donoho–Tanner curve (identical to Part 32's), the lasso's best-threshold MSE;
- the posterior-mean scalar denoiser and MMSE for a three-point prior, and Bayes-optimal state evolution;
- free convolution of a semicircle with a ±1 law by Pastur's equation;
- least absolute deviations by linear programming, and random-features ridge regression.
- The state-evolution cobweb (
StateEvolutioninexplainer/stats/viz.py), the part's instrument: the map τ²_t ↦ τ²_{t+1}, the diagonal, the staircase of iterates from τ²₀, the fixed point, and an algorithm's measured iterates on top, so AMP's trajectory can be checked against the theory step by step.
Data.
- From the Museum: the Wisconsin breast cancer design (30 standardized features), with simulated logistic outcomes.
- The rest is exact arithmetic (quadrature, root finding) or seeded simulation.
The Coverage Board gains two rows:
| Method | Setting | Nominal | Achieved | Verdict |
|---|---|---|---|---|
| LRT with the χ²₁ approximation | logistic, p/n = 0.2, γ² = 5 | 5% | 8.6% | broken |
| LRT rescaled by κσ⋆²/λ⋆ | logistic, p/n = 0.2, γ² = 5 | 5% | 3.8% | kept |
Chapter notes
| # | Chapter | Numbers |
|---|---|---|
| 0 | Sur and Candès | n = 2,000, p = 400, β ∈ {−10, 0, 10}: fitted slope 1.478 (α⋆ = 1.499); null spread 4.59 (σ⋆ = 4.74; textbook 3.88); 500 LRTs at n = 1,000: χ²₁ size 8.6% (2.6% at 1%), rescaled 3.8% (0.4%) |
| 1 | The proportional regime | OLS: σ²κ/(1 − κ); MP at κ = 0.5: eigenvalues 0.088–2.87 (edges 0.086, 2.91); γ² = 5: α⋆ 1.073, 1.168, 1.299, 1.499, 1.871 and factor 1.073, 1.166, 1.294, 1.487, 1.840 at κ = 0.05–0.25; at 0.3, α⋆ = 3.074 and LRT factor 2.952; the old solver failure did not imply nonexistence; the MLE exists for κ < 0.500 (γ = 0), 0.32559 (γ² = 5); global null κ = 0.2: factor 1.268, χ² size ≈ 8% |
| 2 | Random matrices | MP moments at κ = ½: mean 1, SD 0.71, mean inverse 2, top edge 2.91; Wigner (N = 1,500, s² = ¼) plus ±1 diagonal against the free convolution |
| 3 | Ridge | γ = ½, r²/σ² = 4: λ⋆ = 0.125, risk 0.702 (theory = simulation at n = 400); γ = 2: optimal risk 2.56; ridgeless: 1 (γ = ½), 9 (0.9), 3 (2), 3.33 (4); simulated 0.99, 9.99, 2.97, 3.33 |
| 4 | M-estimation | Laplace errors, n = 400: κ = 0.1 LAD 0.085 vs OLS 0.102; κ = 0.5 LAD 1.15 vs OLS 1.03 |
| 5 | AMP | n = 1,000, p = 2,000, ε = 0.1, σ² = 0.01, θ = 1.5: τ²₁ 0.129 (SE 0.131), τ²₃ 0.079 (0.079); MSE after 25 iterations 0.019 |
| 6 | Gordon | least squares from the auxiliary problem: a² = σ²κ/(1 − κ) |
| 7 | Replicas | three-point prior ε=.1, noise 1e−4: uninformative Bayes-denoising AMP first has MSE<.001 at sampled δ=.30; not the computed global replica MMSE. Noiseless lasso boundary δ=.32879; positive-noise lasso still has error |
| 8 | Random features | normalized paired/nested ReLU experiment, n=300,d=30: six-run ridgeless mean peak 480.8 (empirical SE 287.0), final mean 0.2635; λ=.001 final 0.0308; risk excludes test noise, target variance 1/30 |
| 9 | Corrected inference | rescaled LRT; debiased interval example (3.8, 16.2) vs textbook (7.4, 22.6); breast cancer design, n = 150, γ² = 5: held-out predictor slope median 1.53, mean 1.64 (80% between 1.09 and 2.25) vs Gaussian theory 1.50 |
| 10 | Open problems | — |
| 11 | Outro | — |
Companion material in this repository
The syllabus's plan for this partfrom SYLLABUS.md, the plan of record
- Hook: Sur & Candès (2019). The inflated MLE and the χ² that is not (Board).
- The proportional regime. Why classical asymptotics fail; what replaces them.
- Random matrix tools. Stieltjes transforms; free convolution (Voiculescu).
- Exact ridge and ridgeless risk (Dobriban & Wager 2018; Hastie, Montanari, Rosset & Tibshirani 2022); double descent derived.
- M-estimation in high dimensions (El Karoui et al. 2013; Donoho & Montanari 2016).
- AMP and state evolution (Donoho, Maleki & Montanari 2009; Bayati & Montanari 2011); the Donoho–Tanner curve from AMP.
- CGMT (Thrampoulidis, Oymak & Hassibi 2015).
- The replica method's predictions and their proofs for GLMs (Barbier et al. 2019).
- Random features and kernels (Mei & Montanari 2022).
- Corrected inference. Rescaled LRTs; debiased estimators in proportional regimes.
- Open problems.
Built: an AMP solver with state evolution.
Build the film
python -m videos.stats.stats59.compute # the part's numbers, into .cache/stats59
python tools/build.py stats59 # render and assemble the film
EXPLAINER_TTS=silent python tools/qa_scene.py stats59 Hook # one chapter, silent, with a contact sheet
Scenes: videos/stats/stats59. 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.stats59.compute # once (about two minutes)
python tools/build.py stats59 -q l # fast 480p preview
python tools/build.py stats59 # 1080p30 -> renders/stats59.mp4
python tools/qa_scene.py stats59 AMP
python tools/lecture_length.py stats59 --floor 50