Foundations to Frontier
Tests
A. Mathematical Foundations › A4 Probability Theory › Distributions

Exponential Families, Sufficient Statistics and Conjugate Priors

Most common distributions share one form, p(x | η) = h(x) exp(η·T(x) − A(η)). That form explains a lot: the log-partition A generates every moment, the data matter only through the sufficient statistic T, maximum likelihood matches moments, and every member has a conjugate prior that updates by adding statistics. This is the machinery behind GLMs, logistic regression's link, Kalman filters, and Thompson sampling.

Level 0: Foundation

★☆☆☆☆ Introductory⏱ 5 minGeneral audience. No mathematics required.

Keeping score with just a few numbers

To estimate how often a robot’s grasp succeeds, you don’t need the full list of every try, only how many tries and how many successes. Those few numbers capture everything the data can tell you. They’re called sufficient statistics.

Better still, you can start with a guess that’s worth a few imaginary tries, then simply add the real tries as they happen. The updated belief has the same shape as the starting guess, just sharper. Starting beliefs that work like this are called conjugate priors.

Conjugate priors: update by adding statistics
n = 0
Beta(2.0, 2.0) → Beta(2.0, 2.0) after 0 successes / 0 failures · posterior mean 0.500, 95% interval ≈ [0.062, 0.938]
Grey dashed: prior. Blue: likelihood of the data. Orange: posterior (curves scaled to the same height). Green: the true value. The posterior stays in the prior's family, and updating only adds sufficient statistics (successes, event counts, the sum of readings). With little data the prior matters; with lots, the likelihood dominates.
Why engineers care

A robot choosing between grasp strategies, or a website comparing two button designs, can update its beliefs after every trial with a couple of additions, fast enough to run on tiny onboard computers. It can then decide what to try next by sampling from those beliefs.

📝 Quick check (Level 0)
0/3 answered
  1. 1. To estimate a success rate you need…
  2. 2. Prior worth 2 successes + 2 failures, then 7 successes + 3 failures. Estimate?
  3. 3. With lots of data, the prior matters…

Level 1: Beginner

★★☆☆☆ Basic⏱ 15 minSecondary-school mathematics: arithmetic and elementary algebra.

The exponential-family form

p(x∣η)=h(x) exp⁡(η⊤T(x)−A(η))p(x\mid\eta) = h(x)\,\exp\big(\eta^\top T(x) - A(\eta)\big)

Here η\eta is the natural parameter, T(x)T(x) the sufficient statistic, and A(η)=log⁡∫h(x)eη⊤T(x)dxA(\eta) = \log\int h(x)e^{\eta^\top T(x)}dx the log-partition (normalizer).

Family η\eta T(x)T(x) A(η)A(\eta)
Bernoulli(pp) log⁡p1−p\log\frac p{1-p} (logit) xx log⁡(1+eη)\log(1 + e^\eta)
Poisson(λ\lambda) log⁡λ\log\lambda xx eηe^\eta
Normal(μ\mu, known σ2=1\sigma^2 = 1) μ\mu xx η2/2\eta^2/2
Normal(μ,σ2\mu,\sigma^2) (μ/σ2,−1/2σ2)(\mu/\sigma^2, -1/2\sigma^2) (x,x2)(x, x^2) …
Exponential, Gamma, Beta, Dirichlet, Categorical all exponential families

Conjugate pairs

Likelihood Conjugate prior Posterior after data
Bernoulli/Binomial Beta(a,ba,b) Beta(a+#succ,b+#faila + \#\text{succ}, b + \#\text{fail})
Categorical/Multinomial Dirichlet(α\boldsymbol\alpha) Dirichlet(α+n\boldsymbol\alpha + \mathbf n) (A4.2-3)
Poisson Gamma(α,β\alpha,\beta) Gamma(α+∑k,β+n\alpha + \sum k, \beta + n)
Normal (known σ2\sigma^2) Normal(μ0,v0\mu_0, v_0) precisions add, mean precision-weighted
Normal covariance inverse-Wishart (A4.2-3)
📝 Quick check (Level 1)
0/3 answered
  1. 1. Bernoulli's natural parameter is…
  2. 2. The conjugate prior for a Poisson rate is…
  3. 3. Beta(2, 2) prior + 7 successes, 3 failures → ?

Level 2: Intermediate

★★★☆☆ Intermediate⏱ 45 minUndergraduate students and practising engineers.

The log-partition generates moments

A′(η)=E[T(X)],A′′(η)=Var⁡[T(X)]  (≥0, so A is convex)A'(\eta) = \mathbb E[T(X)], \qquad A''(\eta) = \operatorname{Var}[T(X)]\ \ (\ge0, \text{ so } A \text{ is convex})
  • For the Bernoulli: A′=σ(η)=pA' = \sigma(\eta) = p and A′′=p(1−p)A'' = p(1-p).
  • For the Poisson: A′=A′′=eη=λA' = A'' = e^\eta = \lambda.

Maximum likelihood = moment matching

The log-likelihood of i.i.d. data is η⊤∑T(xi)−nA(η)+const\eta^\top\sum T(x_i) - nA(\eta) + \text{const}. It’s concave, because AA is convex, and its maximizer solves

A′(η^)=1n∑iT(xi)A'(\hat\eta) = \frac1n\sum_iT(x_i)

So set the model’s expected sufficient statistic equal to the data’s average. That’s why the Gaussian MLE uses the sample mean and covariance, and why logistic regression’s gradient is X⊤(p−y)X^\top(\mathbf p - \mathbf y) (A3.3-4).

Why conjugate priors exist

For a likelihood ∝exp⁡(η⊤∑T−nA(η))\propto\exp(\eta^\top\sum T - nA(\eta)), take a prior of the same shape: π(η)∝exp⁡(η⊤χ−νA(η))\pi(\eta)\propto\exp(\eta^\top\boldsymbol\chi - \nu A(\eta)). The posterior is ∝exp⁡(η⊤(χ+∑T)−(ν+n)A(η))\propto\exp(\eta^\top(\boldsymbol\chi + \sum T) - (\nu + n)A(\eta)), still in the family. The prior acts as ν\nu pseudo-observations with total statistic χ\boldsymbol\chi (Diaconis and Ylvisaker, 1979).

🐍 Exercise 1: exponential families from their log-partition
Write Bernoulli, Poisson and unit-variance normal in natural form. Verify A′(η) = E[T] and A″(η) = Var T against simulation, and show that two datasets with the same sufficient statistic give identical likelihoods and MLEs.
📝 Quick check (Level 2)
0/3 answered
  1. 1. A′(η) equals…
  2. 2. The exponential-family log-likelihood in η is…
  3. 3. The exponential-family MLE sets the model mean of T equal to…

Level 3: Advanced

★★★★☆ Advanced⏱ 40 minGraduate level, with full derivations and proofs.

Proofs

A′=ETA' = \mathbb E T. Differentiate eA(η)=∫heηTe^{A(\eta)} = \int he^{\eta T}: A′eA=∫hTeηTA'e^A = \int hTe^{\eta T}, so A′=∫T heηT−A=ETA' = \int T\,he^{\eta T - A} = \mathbb E T. Differentiating again gives A′′=ET2−(ET)2A'' = \mathbb E T^2 - (\mathbb E T)^2. ∎

Sufficiency (Fisher–Neyman factorization). TT is sufficient iff p(x∣θ)=g(T(x),θ) h(x)p(\mathbf x\mid\theta) = g(T(\mathbf x),\theta)\,h(\mathbf x). For exponential families, ∏p(xi∣η)=[∏h(xi)]exp⁡(η⊤∑T(xi)−nA)\prod p(x_i\mid\eta) = \big[\prod h(x_i)\big]\exp(\eta^\top\sum T(x_i) - nA), so ∑T(xi)\sum T(x_i) is sufficient. Two datasets with the same ∑T\sum T give identical likelihood functions, and so identical inferences (Exercise 1). ∎

Pitman–Koopman–Darmois. Among families with fixed support, only exponential families have sufficient statistics of fixed dimension for any sample size. That’s why they dominate practical modelling.

Predictive distributions

Integrating the parameter out gives the posterior predictive:

  • Beta–Bernoulli: P(next=1)=aa+bP(\text{next} = 1) = \frac{a}{a + b}.
  • Gamma–Poisson: a negative binomial, with variance αβ+αβ2\frac\alpha\beta + \frac\alpha{\beta^2}. That’s bigger than the mean, because parameter uncertainty fattens predictions. It’s the standard model for overdispersed counts (A4.2-1; Practice Code 5).
Exercise 3.1: Show that the normal–normal posterior has precision 1/v₀ + n/σ²

Prior ∝e−(μ−μ0)2/2v0\propto e^{-(\mu-\mu_0)^2/2v_0} and likelihood ∝e−∑(xi−μ)2/2σ2\propto e^{-\sum(x_i-\mu)^2/2\sigma^2}. The exponent’s μ2\mu^2 coefficient is −12(1/v0+n/σ2)-\frac12(1/v_0 + n/\sigma^2). Completing the square gives a Gaussian with that precision and mean μ0/v0+∑xi/σ21/v0+n/σ2\frac{\mu_0/v_0 + \sum x_i/\sigma^2}{1/v_0 + n/\sigma^2}.

📝 Quick check (Level 3)
0/3 answered
  1. 1. Fisher–Neyman says T is sufficient iff the likelihood…
  2. 2. The Gamma–Poisson posterior predictive is…
  3. 3. Fixed-dimensional sufficient statistics essentially characterize…

Level 4: Expert

★★★★★ Expert⏱ 45 minResearchers: original papers and open problems.

Thompson sampling

To choose among options with unknown success rates (grasp strategies, controller gains, ad layouts), keep a conjugate Beta posterior per option. Sample one rate from each posterior and try the option whose sample is highest (Thompson, 1933). Options you’re unsure about sometimes produce high samples, so they get explored. Options that are clearly worse stop being chosen.

  • Updating costs one addition.
  • Regret grows only logarithmically (Agrawal and Goyal, 2012).
  • In practice it often beats more complex methods (Chapelle and Li, 2011; Russo et al., 2018).
  • Pure greedy choice can lock onto a worse option forever.
🐍 Exercise 2 (research): Thompson sampling vs greedy with Beta posteriors
Run a 3-armed Bernoulli bandit for 2000 pulls with Beta(1,1) priors. Compare Thompson sampling (sample the posteriors) with greedy (use posterior means) on regret, and confirm Thompson concentrates on the best arm with an accurate posterior.

Exponential families everywhere

  • Generalized linear models. The canonical link (logit for Bernoulli, log for Poisson) makes η=w⊤x\eta = \mathbf w^\top\mathbf x, which gives concave likelihoods and simple gradients (McCullagh and Nelder, 1989; A3.3-4).
  • Variational inference and message passing use expected sufficient statistics. Mean-field updates in conjugate-exponential models are closed form (Winn and Bishop, 2005), and so is Kalman smoothing.
  • Energy-based models and maximum entropy. The max-entropy distribution with given expected statistics is exactly the exponential family with those TT (Jaynes, 1957). It underlies maximum-entropy inverse RL for learning from demonstrations (Ziebart et al., 2008).
  • Reliability with few tests. Gamma–Poisson and Beta–binomial updating combine prior engineering knowledge with sparse test data, for example estimating failure rates from a handful of qualification tests.

References

  1. L. Brown (1986). Fundamentals of Statistical Exponential Families. IMS.
  2. P. Diaconis, D. Ylvisaker (1979). “Conjugate priors for exponential families.” Annals of Statistics, 7(2).
  3. W. Thompson (1933). “On the likelihood that one unknown probability exceeds another in view of the evidence of two samples.” Biometrika, 25.
  4. S. Agrawal, N. Goyal (2012). “Analysis of Thompson sampling for the multi-armed bandit problem.” COLT.
  5. O. Chapelle, L. Li (2011). “An empirical evaluation of Thompson sampling.” NeurIPS.
  6. D. Russo, B. Van Roy, A. Kazerouni, I. Osband, Z. Wen (2018). “A tutorial on Thompson sampling.” Foundations and Trends in ML, 11(1).
  7. P. McCullagh, J. Nelder (1989). Generalized Linear Models, 2nd ed. Chapman & Hall.
  8. J. Winn, C. Bishop (2005). “Variational message passing.” JMLR, 6.
  9. E. T. Jaynes (1957). “Information theory and statistical mechanics.” Physical Review, 106(4).
  10. B. Ziebart, A. Maas, J. A. Bagnell, A. Dey (2008). “Maximum entropy inverse reinforcement learning.” AAAI.