Skip to main content

Defaults

Thinking about statistics
Principle or heuristic
Intermediate
What statistics is the science of.
Published

November 9, 2026

Modified

November 13, 2026

Entry #37 in Andrew Gelman’s Handy Statistical Lexicon. Original discussion: Statistics is the science of defaults.

Filed under Thinking about statistics · Principle or heuristic · Intermediate.

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

What it is

Gelman’s claim is that statistics is “the science of defaults.” Most applications of a statistical method are carried out by people who will not hand-tune every choice. So the real product of statistical research is a set of default procedures: default priors, default model specifications, default diagnostics, default graphs. These need to work reasonably well across the whole range of problems people will apply them to.

Why it matters

A method that is optimal only when carefully tuned by its inventor will, in practice, be run with whatever the software ships with. The quality of the default therefore determines the quality of thousands of analyses. That is why the choice of default prior in software like Stan or rstanarm, or the default interval width, deserves serious study. Defaults are also policy: they set norms that users rarely question.

How it works

Evaluate a default by its average performance over the population of problems it will meet, not by its performance on any one problem. For shrinkage estimators: if users meet effects of different typical sizes \(\tau\) and studies of different precision, the risk of a default prior scale \(s\) is

\[ R(s) = \mathrm{E}_{\text{problems}}\Big[\mathrm{E}\big[(\tilde\theta_s - \theta)^2\big]\Big]. \]

A good default makes \(R(s)\) small across a wide range of problems, even if it is not optimal for any single one.

Simulated example

Simulate 3,000 users, each with a different problem: the effect size scale and the noise level vary. Every user applies a normal prior with the same default scale \(s\). Plot the average error against \(s\). A flat prior (\(s \to \infty\)) is the “no-default default.”

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, fmt} from "../js/stats.js"

viewof spread = Inputs.range([0.1, 3], {value: 1, step: 0.1, label: "Typical effect size across users"})
viewof seed = Inputs.range([1, 500], {value: 37, step: 1, label: "Random seed"})

risk = {
  const r = rng(seed);
  const users = range(3000).map(() => {
    const tau = spread * Math.exp(r.normal(0, 0.7));
    const se = Math.exp(r.normal(-0.3, 0.6));
    const theta = r.normal(0, tau);
    return {theta, se, y: r.normal(theta, se)};
  });
  const scales = [0.1, 0.2, 0.3, 0.5, 0.75, 1, 1.5, 2, 3, 5, 10, 100];
  return scales.map(s => ({
    s,
    err: Math.sqrt(mean(users.map(u => {
      const w = s * s / (s * s + u.se * u.se);
      return (w * u.y - u.theta) ** 2;
    })))
  }));
}

Plot.plot({
  ariaLabel: "Defaults: simulation chart",
  ariaDescription: "Horizontal axis: Default prior scale s (log scale; 100 ≈ flat prior). Vertical axis: RMSE averaged over all users' problems. The chart updates with the controls above it, and the summary below the charts states the result in words.",
  height: 280,
  x: {type: "log", label: "Default prior scale s (log scale; 100 ≈ flat prior)", grid: true},
  y: {label: "RMSE averaged over all users' problems", grid: true},
  marks: [Plot.line(risk, {x: "s", y: "err", stroke: "#2166ac", strokeWidth: 2}), Plot.dot(risk, {x: "s", y: "err", fill: "#2166ac"})]
})
# Defaults: one default prior scale for thousands of different problems.
1spread <- 1 # typical effect size across users
2set.seed(37)

3tau <- spread * exp(rnorm(3000, 0, 0.7)) # each user's effect scale
se <- exp(rnorm(3000, -0.3, 0.6)) # each user's standard error
theta <- rnorm(3000, 0, tau)
y <- rnorm(3000, theta, se)
4scales <- c(0.1, 0.2, 0.3, 0.5, 0.75, 1, 1.5, 2, 3, 5, 10, 100)
rmse <- sapply(scales, function(s) {
5  w <- s^2 / (s^2 + se^2) # posterior mean under a N(0, s) default prior
  sqrt(mean((w * y - theta)^2))
})

cat(
  "Best default scale:", scales[which.min(rmse)], "(RMSE",
  round(min(rmse), 3), ")\n"
)
cat(
  "Flat 'no default' (scale 100): RMSE", round(rmse[length(rmse)], 3),
  "\n"
)

6plot(scales, rmse,
  log = "x", type = "b", pch = 19, col = "#2166ac",
  xlab = "Default prior scale s (log scale)",
  ylab = "Average error across users (RMSE)"
)
1
The page’s control: the typical effect size across the software’s users.
2
Fixes the random numbers so the run is reproducible.
3
Three thousand users, each with a different effect scale and a different standard error.
4
Candidate default prior scales, from very tight to effectively flat.
5
Under a N(0, s) default prior, each user’s estimate is shrunk by this factor.
6
Average error across all users for each default. A sensible default beats no default, and the flat prior is itself a default, just a bad one.
# Defaults: one default prior scale for thousands of different problems.
import numpy as np
import matplotlib.pyplot as plt

spread = 1  # typical effect size across users
rng = np.random.default_rng(37)

tau = spread * np.exp(rng.normal(0, 0.7, 3000))  # each user's effect scale
se = np.exp(rng.normal(-0.3, 0.6, 3000))         # each user's standard error
theta = rng.normal(0, tau)
y = rng.normal(theta, se)
scales = np.array([0.1, 0.2, 0.3, 0.5, 0.75, 1, 1.5, 2, 3, 5, 10, 100])
rmse = []
for s in scales:
    w = s ** 2 / (s ** 2 + se ** 2)  # posterior mean under a N(0, s) prior
    rmse.append(np.sqrt(np.mean((w * y - theta) ** 2)))
rmse = np.array(rmse)

print(f"Best default scale: {scales[rmse.argmin()]} "
      f"(RMSE {rmse.min():.3f})")
print(f"Flat 'no default' (scale 100): RMSE {rmse[-1]:.3f}")

plt.semilogx(scales, rmse, "o-", color="#2166ac")
plt.xlabel("Default prior scale s (log scale)")
plt.ylabel("Average error across users (RMSE)")
plt.show()

Key takeaways

  • Most statistical analyses run on defaults, so defaults deserve scientific study.
  • Judge a default by its average performance over the problems people actually bring to it.
  • “No default” (flat priors, no regularization) is itself a default, and often a poor one.

Source

Back to top