The Physics Travel Guide

Bayesian Statistics

Prerequisites: Statistics. Full path (2 pages)

Intuitive

Recommended Books:

Concrete

Bayesian statistics treats a probability as a degree of belief about a proposition, including propositions about the values of parameters. The basic tool is Bayes' theorem. For a parameter θ\theta and observed data DD,

P(θ∣D)=P(D∣θ) P(θ)P(D),P(D)=∫P(D∣θ) P(θ) dθ.P(\theta \mid D) = \frac{P(D \mid \theta)\, P(\theta)}{P(D)}, \qquad P(D) = \int P(D \mid \theta)\, P(\theta)\, d\theta .

The theorem itself is a one-line consequence of the product rule, P(θ,D)=P(θ∣D)P(D)=P(D∣θ)P(θ)P(\theta, D) = P(\theta \mid D) P(D) = P(D \mid \theta) P(\theta).

Worked example: a coin of unknown bias. Let θ\theta be the probability of heads. We take a Beta prior,

P(θ)=θα−1(1−θ)β−1B(α,β),0≤θ≤1,P(\theta) = \frac{\theta^{\alpha-1}(1-\theta)^{\beta-1}}{B(\alpha,\beta)}, \qquad 0 \le \theta \le 1 ,

and observe kk heads in nn flips. The likelihood is binomial, P(D∣θ)=(nk)θk(1−θ)n−kP(D \mid \theta) = \binom{n}{k}\theta^k (1-\theta)^{n-k}. Multiplying prior and likelihood gives a posterior proportional to θα+k−1(1−θ)β+n−k−1\theta^{\alpha+k-1}(1-\theta)^{\beta+n-k-1}, which is again a Beta distribution with parameters α+k\alpha + k and β+n−k\beta + n - k. Its mean is

⟨θ⟩=α+kα+β+n.\langle \theta \rangle = \frac{\alpha + k}{\alpha + \beta + n} .

For a uniform prior (α=β=1\alpha = \beta = 1) this is (k+1)/(n+2)(k+1)/(n+2), Laplace's rule of succession. For large nn the prior parameters become irrelevant and the mean approaches the observed frequency k/nk/n. A prior whose posterior stays in the same family is called conjugate.

Using the posterior. The result of a Bayesian analysis is the whole posterior distribution. From it we quote summaries: the posterior mean or mode, and a credible interval, an interval that contains θ\theta with posterior probability of, say, 68%. Parameters we do not care about (nuisance parameters ν\nu, for example a detector calibration) are integrated out:

P(θ∣D)=∫P(θ,ν∣D) dν.P(\theta \mid D) = \int P(\theta, \nu \mid D)\, d\nu .

Comparing models. For two models M1M_1 and M2M_2, Bayes' theorem applied to the models gives

P(M1∣D)P(M2∣D)=P(D∣M1)P(D∣M2)⋅P(M1)P(M2).\frac{P(M_1 \mid D)}{P(M_2 \mid D)} = \frac{P(D \mid M_1)}{P(D \mid M_2)} \cdot \frac{P(M_1)}{P(M_2)} .

The ratio of evidences P(D∣M1)/P(D∣M2)P(D \mid M_1)/P(D \mid M_2) is the Bayes factor. Because the evidence averages the likelihood over the prior, a model with many adjustable parameters spreads its prior over a large space and is penalized unless the data need those parameters.

In practice the integrals are rarely doable in closed form, and posteriors are sampled numerically, typically with Markov chain Monte Carlo methods.

Abstract

In measure-theoretic form, a Bayesian model consists of a parameter space (Θ,A)(\Theta, \mathcal{A}) with a prior probability measure Π\Pi, a sample space (X,B)(\mathcal{X}, \mathcal{B}), and a Markov kernel θ↦Pθ\theta \mapsto P_\theta assigning to each parameter a probability measure on X\mathcal{X}. These define a joint probability measure on Θ×X\Theta \times \mathcal{X},

Q(A×B)=∫APθ(B) Π(dθ).Q(A \times B) = \int_A P_\theta(B)\, \Pi(d\theta) .

The posterior is the conditional distribution of θ\theta given xx: a kernel x↦Π(⋅∣x)x \mapsto \Pi(\cdot \mid x) such that

Q(A×B)=∫BΠ(A∣x) QX(dx)Q(A \times B) = \int_B \Pi(A \mid x)\, Q_{\mathcal{X}}(dx)

for all measurable AA and BB, where QXQ_{\mathcal{X}} is the marginal of QQ on X\mathcal{X}. Such a regular conditional distribution exists when Θ\Theta is a standard Borel space, and it is unique up to QXQ_{\mathcal{X}}-null sets. If the model is dominated, Pθ(dx)=p(x∣θ) μ(dx)P_\theta(dx) = p(x \mid \theta)\, \mu(dx) for a σ\sigma-finite measure μ\mu, the posterior has a density with respect to the prior and we recover Bayes' formula:

dΠ(⋅∣x)dΠ(θ)=p(x∣θ)∫Θp(x∣θ′) Π(dθ′).\frac{d\Pi(\cdot \mid x)}{d\Pi}(\theta) = \frac{p(x \mid \theta)}{\int_\Theta p(x \mid \theta')\, \Pi(d\theta')} .

Conjugacy in exponential families. If p(x∣θ)=h(x)exp⁡(η(θ)⋅T(x)−A(θ))p(x \mid \theta) = h(x) \exp\big(\eta(\theta) \cdot T(x) - A(\theta)\big), then priors of the form π(θ)∝exp⁡(η(θ)⋅χ−νA(θ))\pi(\theta) \propto \exp\big(\eta(\theta) \cdot \chi - \nu A(\theta)\big) are closed under updating: after nn independent observations the hyperparameters become χ→χ+∑i=1nT(xi)\chi \to \chi + \sum_{i=1}^n T(x_i) and ν→ν+n\nu \to \nu + n. The Beta-binomial example in the Concrete layer is a special case.

Reparametrization and Jeffreys' prior. A prior density is a density, so it transforms with a Jacobian under θ→ϕ(θ)\theta \to \phi(\theta). A "flat" prior in one parametrization is not flat in another. The Jeffreys prior π(θ)∝det⁡I(θ)\pi(\theta) \propto \sqrt{\det I(\theta)}, built from the Fisher information Iij(θ)=Eθ[∂ilog⁡p ∂jlog⁡p]I_{ij}(\theta) = \mathbb{E}_\theta[\partial_i \log p \, \partial_j \log p], is invariant: II transforms as a metric on Θ\Theta, and det⁡I dθ\sqrt{\det I}\, d\theta is its Riemannian volume form.

Large-sample behaviour. For a finite-dimensional model with independent identically distributed data from Pθ0P_{\theta_0}, under regularity conditions that include smoothness of the model, θ0\theta_0 in the interior of Θ\Theta, non-singular Fisher information and a prior with continuous positive density at θ0\theta_0, the Bernstein-von Mises theorem states that the total variation distance between the posterior and the normal distribution N(θ^n,I(θ0)−1/n)N\big(\hat\theta_n, I(\theta_0)^{-1}/n\big) goes to zero in Pθ0P_{\theta_0}-probability, with θ^n\hat\theta_n the maximum likelihood estimator. In this regime Bayesian credible intervals and frequentist confidence intervals agree asymptotically. In infinite-dimensional models this can fail.

Foundations. Cox's theorem gives conditions (whose precise form has been debated) under which any rule for assigning real-valued plausibilities to propositions, consistent with Boolean logic and a few regularity requirements, is equivalent to probability theory. This is the basis of the view of probability as extended logic in Jaynes' book linked in the Concrete layer.

Path to this page

  1. Calculus
  2. Statistics