Basic Prerequisites: 02 · Bayes’ Theorem & Priors.


1. Intuition & Practical Objective

The posterior is a distribution. To act you must compress it - and the honest way to compress a distribution is to say what loss you care about. A point estimate is the minimizer of a posterior expected loss; different losses give different summaries (mean, median, mode). An interval is a range carrying a stated posterior probability. The posterior predictive is what you actually trade on: the distribution of the next observation, with parameter uncertainty fully integrated out.

The practical objective of this page is the inference lookup: given a posterior, produce the point estimate, the credible interval, and the predictive distribution - and know which is which.

The one-sentence essence. “The posterior mean minimizes squared error, the posterior median minimizes absolute error, the MAP minimizes 0–1 loss, a credible interval is a posterior-probability range (not a confidence interval), and the predictive distribution is the posterior pushed through the likelihood.”


2. Mathematical Ground Truth & Derivations

Bayes estimators as posterior-expected loss (C&B §7.2.3, §10.3.1). Given a loss , the Bayes estimator is . Three canonical losses:

Loss Bayes estimatorSummary
Squared error posterior mean center of mass
Absolute error posterior median robust to skew
0–1 / all-or-nothingposterior mode (MAP)highest-density point

These differ whenever the posterior is skewed, and they are not interchangeable: the sample mean can even be a worse estimator of than a constant under squared error (C&B §7.2.3 notes : posterior means are not unbiased).

Credible intervals (C&B §9.2.4). A credible set satisfies

Two standard constructions:

  • Equal-tailed interval: where is the posterior quantile. Easy to compute; can include low-density regions for a skew posterior.
  • Highest posterior density (HPD): the shortest interval with posterior probability , i.e. all with threshold. Minimal length, but for a multimodal posterior it can be a disjoint union of intervals.

Credible vs confidence - the guarantee is different. A Bayesian credible interval says: given the data and the model, lies in with probability . A frequentist confidence interval says: the random procedure that built covers the fixed in 95% of repeated samples - it makes no probability statement about this . For a fixed the frequentist interval either covers or it does not. Quoting one as the other is a genuine category error, and with small samples the two can differ sharply (see the check below).

Posterior predictive. For a new observation , integrate over the posterior:

This is not - plugging in a point estimate ignores parameter uncertainty and understates predictive spread, especially at small .

  • Beta–Bernoulli: with posterior , (the posterior mean of ). For future draws, the count is beta-binomial with mean .
  • Normal (flat prior): with observations, sample variance , the predictive is a Student-: , so the 95% predictive interval is - wider than the posterior for the mean by the factor plus the heavier tail.

Marginalization and the plug-in fallacy. The predictive integral is an instance of the general rule: quantities you do not care about (nuisance parameters) are integrated out, not set to a point value. Setting them to a point estimate is the plug-in approximation - fine for large , biased and over-confident for small .


3. Computational Implementation - mean, median, mode, interval, prediction

Compute all four summaries of a posterior, build the exact 95% equal-tailed credible interval (analytic incomplete beta inverted by bisection), and form the posterior predictive. Compare to the textbook frequentist interval on the same data. Stdlib only.

Three lessons in the numbers. (i) The three point estimates differ - mean , median , mode - because is mildly left-skewed; the mode (MAP) is not the mean, and using one for the other is a modeling choice. (ii) The Bayesian interval is far shorter than the Wald interval on the same data ( vs ) because the prior and the exact beta shape keep the estimate off the unit boundary, where the Wald approximation breaks. They are answering different questions, but the frequentist one is also simply less efficient this small. (iii) The predictive interval is wider than the interval for the mean ( vs a 1-sd posterior sd for of (a 95% interval would be )) - the honest spread of one more observation.


4. Failure Modes & First-Principles Breakdowns

  1. Reporting a credible interval as a confidence interval (or vice versa). The Bayesian 95% says ” is in here with 95% probability given the data”; the frequentist 95% is a statement about the procedure, not this interval. Regulators and textbooks mix these constantly; be explicit about which you computed.
  2. MAP is not invariant to reparameterization; the mean and median are. If is the mode of , the mode of for a nonlinear is not . The posterior mean/median transform correctly (mostly); the mode does not. This makes MAP a poor “point of the distribution” under transformations.
  3. Equating the posterior with the likelihood at the MLE. , and with a strong prior they can be far apart. The posterior mean is biased for in the frequentist sense (C&B §7.2.3) - that is the price of shrinkage, and it is usually the point.
  4. Plugging in a point estimate for prediction. Using instead of the integrated discards parameter uncertainty and systematically understates predictive intervals at small . The predictive above is wider than a naive normal at for exactly this reason.
  5. Improper posterior, meaningless interval. If the prior is improper and the posterior is too, the quantiles are not defined - the “interval” is an artifact. See 02 · Priors.
  6. HPD on a multimodal posterior. The HPD set can be disjoint (""); reporting it as a single interval misstates the posterior.

5. References

  • Casella & Berger, Statistical Inference (2nd ed.)
  • Gelman et al., Bayesian Data Analysis (3rd ed.)
  • Robert, The Bayesian Choice (2nd ed.)
  • Berger, Statistical Decision Theory and Bayesian Analysis (2nd ed.)
  • McElreath, Statistical Rethinking (2nd ed.)

6. Connected Graph Bridges