Skip to main content

Between regularization and discovery

Building and checking models
Principle or heuristic
Advanced
There is no tradeoff.
Published

November 9, 2026

Modified

November 13, 2026

Entry #122 in Andrew Gelman’s Handy Statistical Lexicon. Original discussion: No tradeoff between regularization and discovery.

Filed under Building and checking models · Principle or heuristic · Advanced.

Related terms: ridge regression, lasso, shrinkage, ranking noisy estimates.

Source check: ✓ The explanation was checked against the source.

What it is

A common worry is that regularization, meaning shrinkage, priors or partial pooling, will “hide” real discoveries by pulling interesting estimates toward zero. Gelman’s answer is that there is no tradeoff. In his example, a prior centered at zero pulls an estimate of 0.5 ± 0.2, which is “clearly statistically significant”, down to 0.03 ± 0.05. Has the discovery been lost? No: “There’s nothing stopping you from gathering more data to pursue this possible effect you’ve discovered.” And regularization doesn’t forbid calling an uncertain lead a discovery: “If you want to label something that might likely be wrong as a ‘discovery,’ that’s fine by me! No need for a discovery to represent certainty or even to represent near-certainty.” What regularization changes is how confident you should be in each lead. It doesn’t stop you from following them.

Why it matters

Fear of regularization keeps people using raw estimates, which are dominated by the most extreme noisy results: small subgroups, small samples, lucky draws. Those are disproportionately the “discoveries” that fail to replicate. Shrinkage pulls large-looking estimates that rest on little data in much harder than well-measured ones. On average, that makes a ranked list of leads more reliable. A shrunken lead isn’t declared false. It’s marked as uncertain, and “if you want to be more open to discovery, you can pursue more leads and gather more and higher quality data. That’s how discovery happens.”

How it works

With estimates \(y_j \sim \mathrm{N}(\theta_j, \text{se}_j^2)\) and partial pooling, the shrunken estimate is \(\tilde\theta_j = \frac{\tau^2}{\tau^2 + \text{se}_j^2}\,y_j\). Estimates with large \(\text{se}_j\) are pulled in hard, and precise ones barely move. Ranking by \(\tilde\theta_j\) rather than \(y_j\) demotes noisy extremes and promotes well-measured large effects. On average, the top of the list then contains more of the truly large effects. Gelman’s own example works one estimate through by hand: a \(\mathrm{N}(0, 0.05)\) population prior and an estimate of \(0.5 \pm 0.2\) give a posterior of \(0.03 \pm 0.05\), still a 72% chance the effect is positive, and a lead worth following up.

Simulated example

There are 300 effects, most small and a few large, estimated with very different precisions (sample sizes vary). Take the “top 20 discoveries” by raw estimate and by regularized estimate. How many are truly among the 20 largest effects?

Show simulation code

The R version uses base R, and the Python version uses NumPy and Matplotlib. Where the simulation draws random numbers, each language draws its own, so exact numbers differ slightly but show the same pattern. The numbered markers in the R code are explained under it.

import {rng, range, mean} from "../js/stats.js"

viewof spreadN = Inputs.range([0, 2], {value: 1.2, step: 0.1, label: "Variation in sample sizes (log scale)"})
viewof seed = Inputs.range([1, 500], {value: 122, step: 1, label: "Random seed"})

disc = {
  const r = rng(seed);
  const rows = range(300).map(j => {
    const theta = r() < 0.08 ? r.normal(0, 1.5) : r.normal(0, 0.2);
    const n = Math.round(30 * Math.exp(r.normal(0, spreadN))) + 2;
    const se = 2 / Math.sqrt(n);
    return {j, theta, se, y: r.normal(theta, se)};
  });
  const tau2 = Math.max(0.01, mean(rows.map(d => d.y * d.y - d.se * d.se)));
  const all = rows.map(d => ({...d, shrunk: tau2 / (tau2 + d.se * d.se) * d.y}));
  const top = k => new Set(all.slice().sort((a, b) => Math.abs(b[k]) - Math.abs(a[k])).slice(0, 20).map(d => d.j));
  const truth = top("theta"), raw = top("y"), reg = top("shrunk");
  return {all: all.map(d => ({...d, rawTop: raw.has(d.j), regTop: reg.has(d.j), trueTop: truth.has(d.j)})),
    rawHits: [...raw].filter(j => truth.has(j)).length, regHits: [...reg].filter(j => truth.has(j)).length};
}

Plot.plot({
  ariaLabel: "Between regularization and discovery: simulation chart",
  ariaDescription: "Horizontal axis: Raw estimate. Vertical axis: Regularized estimate. The chart updates with the controls above it, and the summary below the charts states the result in words.",
  height: 320,
  grid: true,
  x: {label: "Raw estimate"},
  y: {label: "Regularized estimate"},
  marks: [
    Plot.dot(disc.all, {x: "y", y: "shrunk", r: d => 1.5 + 3 / d.se / 2, fill: d => d.trueTop ? "#2166ac" : "#8a8a8a", stroke: d => d.rawTop && !d.regTop ? "#d6604d" : "none", strokeWidth: 2}),
    Plot.ruleX([0]), Plot.ruleY([0])
  ]
})
# Between regularization and discovery: ranking noisy estimates.
1spread_n <- 1.2 # variation in sample sizes (log scale)
2set.seed(122)

# 300 groups: most effects tiny, 8% large; sample sizes vary
3theta <- ifelse(runif(300) < 0.08, rnorm(300, 0, 1.5), rnorm(300, 0, 0.2))
n <- round(30 * exp(rnorm(300, 0, spread_n))) + 2
se <- 2 / sqrt(n)
y <- rnorm(300, theta, se)
tau2 <- max(0.01, mean(y^2 - se^2))
4shrunk <- tau2 / (tau2 + se^2) * y

5top <- function(v) order(-abs(v))[1:20] # the 20 most extreme groups
cat("Of the true top 20, the raw estimates find ",
  length(intersect(top(y), top(theta))), " and the regularized ",
  "estimates find ", length(intersect(top(shrunk), top(theta))), "\n",
  sep = ""
)

6plot(theta, y,
  pch = 19, cex = 0.6, col = "grey60",
  xlab = "True effect", ylab = "Estimate"
)
points(theta[top(y)], y[top(y)], col = "#d6604d", cex = 1.4)
points(theta[top(shrunk)], shrunk[top(shrunk)], pch = 19, col = "#2166ac")
legend("topleft", c("Raw top 20", "Regularized top 20"),
  pch = c(1, 19),
  col = c("#d6604d", "#2166ac"), bty = "n"
)
1
The page’s control: how much sample sizes vary across the 300 groups.
2
Fixes the random numbers so the run is reproducible.
3
Most true effects are tiny; a few are large. Those few are the discoveries worth making.
4
Regularized estimates: each shrunk toward zero in proportion to its noise.
5
The 20 most extreme groups under each estimator, compared with the true top 20.
6
Raw estimates against the truth, with each estimator’s top 20 marked. Regularization finds more of the real discoveries, because the raw top 20 is full of noisy small groups.
# Between regularization and discovery: ranking noisy estimates.
import numpy as np
import matplotlib.pyplot as plt

spread_n = 1.2  # variation in sample sizes (log scale)
rng = np.random.default_rng(122)

# 300 groups: most effects tiny, 8% large; sample sizes vary
theta = np.where(rng.uniform(size=300) < 0.08, rng.normal(0, 1.5, 300),
                 rng.normal(0, 0.2, 300))
n = np.round(30 * np.exp(rng.normal(0, spread_n, 300))) + 2
se = 2 / np.sqrt(n)
y = rng.normal(theta, se)
tau2 = max(0.01, np.mean(y ** 2 - se ** 2))
shrunk = tau2 / (tau2 + se ** 2) * y


def top(v):  # the 20 most extreme groups
    return set(np.argsort(-np.abs(v))[:20])


print(f"Of the true top 20, the raw estimates find "
      f"{len(top(y) & top(theta))} and the regularized estimates find "
      f"{len(top(shrunk) & top(theta))}")

raw_top, reg_top = list(top(y)), list(top(shrunk))
plt.scatter(theta, y, s=8, color="0.6")
plt.scatter(theta[raw_top], y[raw_top], s=60, facecolors="none",
            edgecolors="#d6604d", label="Raw top 20")
plt.scatter(theta[reg_top], shrunk[reg_top], color="#2166ac",
            label="Regularized top 20")
plt.xlabel("True effect")
plt.ylabel("Estimate")
plt.legend()
plt.show()

Key takeaways

  • Regularization pulls in noisy estimates and leaves precise ones mostly alone.
  • It reduces noise-driven “discoveries” and, on average, makes rankings of leads more reliable.
  • A shrunken lead isn’t ruled out. Pursue it with more or better data, or call it an uncertain discovery.

Source

Back to top