Skip to main content

Uncertainty Interval

Showing and telling
Advice
Intermediate
Say this instead of confidence or credible interval.
Published

November 9, 2026

Modified

November 13, 2026

Entry #54 in Andrew Gelman’s Handy Statistical Lexicon. Original discussion: Instead of “confidence interval,” let’s say “uncertainty interval”.

Filed under Showing and telling · Advice · Intermediate.

Related terms: confidence interval, credible interval, coverage.

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

What it is

Gelman proposes calling intervals “uncertainty intervals” rather than “confidence intervals” (the frequentist term) or “credible intervals” (the Bayesian term). The word “confidence” suggests the interval makes you confident. “Credible” suggests you should believe it. Neither is guaranteed. The interval’s actual job is to express uncertainty, and the name should say so.

Why it matters

Labels shape interpretation. “95% confidence” sounds like a guarantee, so people ignore the assumptions behind it: the model is right, the sample is random, there are no forking paths. Arguing over “confidence” versus “credible” also exaggerates the differences between frameworks, when in most applied problems the two intervals are almost numerically identical. “Uncertainty interval” is neutral and honest.

How it works

For an estimate with standard error \(\text{se}\) and a weak prior, the frequentist interval \(\hat\theta \pm 1.96\,\text{se}\) and the Bayesian posterior interval are almost the same. They diverge only when the prior is informative relative to the data. In either case, the interval reflects only the uncertainty the model knows about. Model misspecification, such as ignoring clustering, can make both too narrow, which is another reason not to call them “confidence.”

Simulated example

The same study is replicated 400 times, and the chart shows the first 30. For each replication, we compute a classical interval and a Bayesian interval under a weakly informative prior, both nominally 95%. Optionally, the data have unmodeled clustering, which both intervals ignore.

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

viewof priorSd = Inputs.range([0.1, 10], {value: 5, step: 0.1, label: "Prior sd (Bayesian interval)"})
viewof clustered = Inputs.toggle({label: "Data have unmodeled clustering", value: false})
viewof seed = Inputs.range([1, 500], {value: 54, step: 1, label: "Random seed"})

intervals = {
  const r = rng(seed);
  const truth = 1;
  return range(400).map(k => {
    const y = clustered
      ? range(10).flatMap(() => { const c = r.normal(0, 0.8); return r.normals(10, truth + c, 1); })
      : r.normals(100, truth, 1);
    const est = mean(y), se = sd(y) / Math.sqrt(y.length);
    const post = normalPosterior(0, priorSd, est, se);
    return {k, est, lo: est - 1.96 * se, hi: est + 1.96 * se, bLo: post.mean - 1.96 * post.sd, bHi: post.mean + 1.96 * post.sd, truth};
  });
}

Plot.plot({
  ariaLabel: "Uncertainty Interval: simulation chart",
  ariaDescription: "Horizontal axis: Replication (first 30). Vertical axis: Interval. The chart updates with the controls above it, and the summary below the charts states the result in words.",
  height: 300,
  x: {label: "Replication (first 30)"},
  y: {label: "Interval", grid: true},
  color: {legend: true, domain: ["Classical", "Bayesian"], range: ["#2166ac", "#d6604d"]},
  marks: [
    Plot.ruleX(intervals.slice(0, 30), {x: d => d.k - 0.15, y1: "lo", y2: "hi", stroke: () => "Classical", strokeWidth: 2}),
    Plot.ruleX(intervals.slice(0, 30), {x: d => d.k + 0.15, y1: "bLo", y2: "bHi", stroke: () => "Bayesian", strokeWidth: 2}),
    Plot.ruleY([1], {stroke: "currentColor", strokeDasharray: "4 3"})
  ]
})
# Uncertainty Interval: confidence and credible intervals cover alike, and
# fail alike.
1prior_sd <- 5 # prior sd for the Bayesian interval
clustered <- FALSE # do the data have unmodeled clustering?
2set.seed(54)

truth <- 1
res <- t(replicate(400, {
3  y <- if (clustered) {
    rnorm(100, truth + rep(rnorm(10, 0, 0.8), each = 10))
  } else {
    rnorm(100, truth, 1)
  }
  est <- mean(y)
  se <- sd(y) / sqrt(100)
  prec <- 1 / prior_sd^2 + 1 / se^2 # normal prior centered at 0
4  post_mean <- (est / se^2) / prec
  post_sd <- sqrt(1 / prec)
  c(
    classical = abs(est - truth) < 1.96 * se,
    bayesian = abs(post_mean - truth) < 1.96 * post_sd
  )
}))
cat("Coverage over 400 replications: classical ",
  round(100 * mean(res[, 1]), 1), "%, Bayesian ",
  round(100 * mean(res[, 2]), 1), "%",
  if (clustered) " (both too narrow)" else "", "\n",
  sep = ""
)

5barplot(100 * colMeans(res),
  col = c("grey70", "#2166ac"),
  ylab = "Coverage of the 95% interval (%)", ylim = c(0, 100)
)
abline(h = 95, lty = 2)
1
The page’s controls: the prior standard deviation for the Bayesian interval, and whether the data have clustering the model ignores.
2
Fixes the random numbers so the run is reproducible.
3
Data with or without an unmodeled cluster structure.
4
The Bayesian posterior under a normal prior centered at zero, next to the classical interval from the sample mean.
5
Coverage of both intervals. In most applied problems they cover alike; when the model is wrong, they fail alike. The name uncertainty interval fits both.
# Uncertainty Interval: confidence and credible intervals cover alike, and
# fail alike.
import numpy as np
import matplotlib.pyplot as plt

prior_sd = 5       # prior sd for the Bayesian interval
clustered = False  # do the data have unmodeled clustering?
rng = np.random.default_rng(54)

truth = 1
if clustered:
    shift = np.repeat(rng.normal(0, 0.8, (400, 10)), 10, axis=1)
    y = rng.normal(truth + shift, 1)
else:
    y = rng.normal(truth, 1, (400, 100))
est = y.mean(axis=1)
se = y.std(axis=1, ddof=1) / 10
prec = 1 / prior_sd ** 2 + 1 / se ** 2       # normal prior centered at 0
post_mean, post_sd = (est / se ** 2) / prec, np.sqrt(1 / prec)
classical = np.mean(np.abs(est - truth) < 1.96 * se)
bayesian = np.mean(np.abs(post_mean - truth) < 1.96 * post_sd)
print(f"Coverage over 400 replications: classical {100 * classical:.1f}%, "
      f"Bayesian {100 * bayesian:.1f}%"
      + (" (both too narrow)" if clustered else ""))

plt.bar(["Classical", "Bayesian"], [100 * classical, 100 * bayesian],
        color=["0.7", "#2166ac"])
plt.axhline(95, color="black", linestyle="--")
plt.ylim(0, 100)
plt.ylabel("Coverage of the 95% interval (%)")
plt.show()

Key takeaways

  • Call intervals what they are: expressions of uncertainty.
  • Classical and Bayesian intervals usually agree closely. The name shouldn’t suggest a bigger difference.
  • An interval is only as trustworthy as the model behind it. It doesn’t guarantee anything.

Source

Back to top