Bayesian statistics Created 2026-09-24 Updated 2026-10-14
Bayesian statistics expresses uncertainty about an unknown statistical parameter through a probability distribution, then uses Bayes' theorem to update it after observing data. The prior distribution describes uncertainty before the current observations; the likelihood function describes how the statistical model generates those observations at each parameter value; the posterior distribution describes uncertainty conditional on the observations and that model. A physical parameter can have one fixed value while its value remains uncertain to us. Assigning it a probability distribution represents that uncertainty under the chosen model, rather than requiring the physical parameter to change randomly between measurements.
For example, suppose ten Bernoulli trials are independent conditional on an unknown heads probability , with a beta distribution prior . Eight heads and two tails give the posterior distribution by Beta-binomial conjugacy. Its posterior mean is , between the prior mean and observed binomial proportion . The Bayesian posterior below computes the whole update, and the credible interval below summarizes its remaining uncertainty. The conjugate update is explained in MIT 18.05, Reading 15: beta and normal conjugate priors.
The useful feature is that one posterior distribution supports several questions: a posterior mean estimates a value, a credible interval reports a range, and a posterior predictive distribution predicts a future observation while averaging over parameter uncertainty. With conditionally independent new data, today's posterior distribution can become tomorrow's prior distribution. These conclusions remain conditional on the statistical model and prior distribution; a precise update does not establish that either assumption fits the experiment.
A historical starting point is Thomas Bayes's essay in the 1763 volume of the Royal Society's Philosophical Transactions, communicated after his death by Richard Price. Its opening problem asks for uncertainty about an unknown event probability given observed successes and failures: the same direction of reasoning illustrated by the coin example. See Bayes and Price, An Essay towards solving a Problem in the Doctrine of Chances, opening letter and problem.
Beta-binomial distribution Created 2026-10-14 Updated 2026-10-20
Mix a binomial distribution with a beta distribution for its success probability: and . Integrating their densities gives the displayed mass for . Its expectation is , and its variance is . It is the posterior predictive distribution for repeated Bernoulli trials after a beta-prior update.
Conditional on the pooled number of successes in exchangeable random variables that are binary, all placements of those successes are equally likely under a common success-chance mixture. The count in a chosen batch of size therefore has a hypergeometric distribution, with mass . Under the uniform-count predictive property, is uniform on . Dividing the joint pooled-and-batch probability by the first batch's uniform marginal gives the posterior predictive distribution, with factor . Substituting in the hypergeometric expression does not give a single normalized hypergeometric mass as varies, since its population success total then varies too.
Gaussian process regression supplies a predictive distribution and uncertainty estimates. A Gaussian process regression posterior gives both a posterior mean and a posterior variance, allowing credible intervals for the latent function and a posterior predictive distribution for future noisy observations. The kernel ridge regression estimator by itself specifies a point estimate.
With the same positive-semidefinite kernel and matching regularization, the Gaussian process regression posterior mean equals the kernel ridge regression prediction. Thus the main additional benefit is the explicit probability distribution of predictions, conditional on the chosen Gaussian process model and its hyperparameters, rather than an automatic improvement in point-prediction accuracy.
Past exam of the mathematics course of the University of Cambridge 2008 iii Paper 44 3 d Solution Created 2026-10-03 Updated 2026-10-14
Integrate the next independent measurement error over the posterior distribution of . The posterior predictive distribution isBoth uncertainty about the personal mean and variation in a new measurement contribute.
Past exam of the mathematics course of the University of Cambridge 2008 iii Paper 44 3 e Solution 2026-10-14
Taking the upper quantile of the posterior predictive distribution givesThe same predictive false-alarm probability is retained after updating with the first measurement.
Past exam of the mathematics course of the University of Cambridge 2008 iii Paper 44 3 h Solution 2026-10-14
Add the new individual's latent mean and log variance to the same population hierarchy. Enter only that individual's first two measurements as observations; use the historical data and these two values to fit the model. The third measurement must be held out, or the predictive check reuses the value it is meant to test. For example, augment the unchanged population hyperpriors with this WinBUGS structure:
new.mean ~ dnorm(mu, invtau2)
new.logvar ~ dnorm(phi, invpsi2)
new.precision <- exp(-new.logvar)
for (k in 1:2) {
new.Y[k] ~ dnorm(new.mean, new.precision)
}
future.Y ~ dnorm(new.mean, new.precision)
upper.indicator <- step(future.Y - held.out.third)future.Y is unobserved. Its simulated values give the posterior predictive distribution, including uncertainty in the population parameters and personal variance. A central 99.9% prediction interval uses its and empirical quantiles. Flag the third value if it is outside that interval. Equivalently, estimate its predictive tail probability by the mean of upper.indicator and flag if that mean is below or above . This is two-sided, unlike the earlier one-sided upper limit. Past exam of the mathematics course of the University of Cambridge 2009 iii Paper 36 1 d Solution Created 2026-10-03 Updated 2026-10-14
With a uniform beta distribution prior, the posterior predictive distribution for another batch of the same size isBut . HenceThe displayed expression is symmetric in . This is the uniform-count predictive property: the joint batch counts are exchangeable and both marginal counts are uniform. Conditional reversal is not a general property of arbitrary priors; it holds here because those marginal probabilities coincide.
Past exam of the mathematics course of the University of Cambridge 2009 iii Paper 36 3 h Solution Created 2026-10-03 Updated 2026-10-14
Use conditional versus marginal posterior predictive checks to replicate new plates, rather than recycling the fitted plate effects. For each joint posterior draw of , draw fresh independent and thenUse the same doses and three-plate design, giving the posterior predictive distribution for repeated experiments. Compare observed dose means and their trend, the high-dose downturn, within-dose spreads, and outliers with the replicated curves and intervals. For example compare a discrepancywith draw by draw. The resulting posterior predictive tail fraction or graphical rank assesses whether the observed trend is unusual under this model. Fresh plate effects are needed to assess the population dose-response assumption. Reusing the fitted effects would mainly check the conditional sampling layer and could hide systematic departures from the proposed curve.
Past exam of the mathematics course of the University of Cambridge 2013 iii Paper 34 4 d Solution Created 2026-10-03 Updated 2026-10-14
Model gives the sequential forecast . The probability chain rule yieldsApplication of Bayes' theorem makes the factors successive posterior predictive distributions, and their product is the Bayesian model evidence. Under conditionally independent sampling it isTaking logarithms gives the prequential log score identityTherefore the Bayes factor isThis solves the second half of part (d), which is missing from the TeX. Proper priors and finite positive evidences are needed; unrelated improper-prior normalizing constants do not cancel.
Past exam of the mathematics course of the University of Cambridge 2015 iii Paper 35 1 d Solution Created 2026-10-03 Updated 2026-10-06
Multiple imputation by chained equations specifies one conditional distribution for each incomplete variable. In general, let be the incomplete variables, the fully observed predictors, and the parameters of a model . The notation means all variables except . The models should respect each variable's support and contain the terms needed by the planned analysis.
First choose suitable models and initialise only the missing entries with admissible provisional values. One sweep updates in turn. At update , fit its model to records whose is observed, using the latest filled-in predictors. DrawThe first draw represents parameter uncertainty through a Bayesian posterior; the second represents residual uncertainty through a posterior predictive distribution. Replace the missing entries with these draws, leaving every genuinely observed entry fixed. Repeat whole sweeps until the chain has settled, assessing traces, mixing and plausibility. Obtain completed datasets from independently initialised chains, or sufficiently separated draws after convergence. Both parameter and missing-value uncertainty must be propagated; repeated deterministic prediction is not multiple imputation.
Here use a logistic regression for conditional on , age and sex. For , use an appropriate discrete count model conditional on , age and sex, such as a suitably checked negative binomial regression, allowing enough flexibility for skewness and nonlinear effects. Include interactions or transformations needed by the analysis in the imputation models. If condom use is structurally undefined for a record, preserve that applicability rule rather than treating it as ordinary missing data.
Impute the eligible survey information before discarding records solely because the observed is absent. In each completed dataset select its own records and fit the requested logistic regression. This allows a record with missing to contribute to the target group in some imputations and not others. Models must respect any known eligibility restrictions; if eligibility was independently known, use that information.
For a scalar regression coefficient, let be its estimate and its estimated variance in completed dataset . Rubin's rules giveThe standard error is . Use the corresponding multiple-imputation confidence interval, rather than treating one completed dataset as fully observed. For vector coefficients replace the squared differences by outer products and by the covariance matrix. This combines within-imputation and between-imputation uncertainty.
Conditional on , the future Bernoulli random variable is independent of the observed statistical sample and has success probability . Its posterior predictive probability is therefore the posterior mean of . Put and . Thenusing the beta-gamma identity and the Gamma function recurrence. HenceThe whole posterior predictive distribution of is the Bernoulli distribution with this success probability.
Put . As a linear combination of independent normal random variables under the posterior distribution,The shortest 95% credible interval isHere is the standard normal distribution cumulative distribution function. To justify shortest length, consider all intervals of a fixed length . If is this normal distribution posterior density, the interval probability has derivative with respect to . The normal distribution is symmetric and its density strictly decreases with distance from its mean, so this probability is uniquely maximized when the midpoint is . The centered interval can therefore attain 95% posterior probability with the least length. It is both an equal-tailed credible interval and a highest posterior density interval.
The target is the experiment's mean at . A posterior predictive distribution for a new noisy observation would instead have variance ; that extra observation variance does not belong in the requested interval.
Write and . Conditional independence of the next count given allows us to average its Poisson distribution over the posterior distribution:This Poisson-gamma mixture is the posterior predictive distribution. In the stated negative binomial distribution convention its parameters areIts expected value equals the posterior mean of , while its variance includes both conditional Poisson variation and uncertainty in .
Posterior predictive check Created 2026-10-06 Updated 2026-10-25
A posterior predictive check compares a summary of the observed data with the same summary in replicated data drawn from a model's posterior predictive distribution. The replication must match the target: replicating an existing group's observations conditional on its effect differs from predicting a new group with a newly drawn effect. Such checks expose mismatches in dispersion, tails or other features; using the observations to fit and check the model means they are not automatically calibrated frequentist tests.
Predictive distribution 2026-10-14
A probability law for a future observation conditional on currently available information. A posterior predictive distribution integrates the observation model over the posterior distribution of unknown parameters; a plug-in predictive law instead fixes an estimate of those parameters.
Sequential normal predictive monitoring 2026-10-14
For repeated independent measurements with prior and known scales, normal-normal conjugacy gives and . The next measurement has posterior predictive distribution . Its one-sided false-alarm level yields the displayed limit. Predictive width tends to the irreducible measurement width, while the center adapts to the individual's data. To assess a held-out measurement, fit with earlier measurements only.