The Exponential Family
One algebraic template that most named distributions secretly share. Recognise it and you get sufficient statistics, the maximum-likelihood equation, conjugate priors and generalised linear models handed to you for free.
Prerequisites: Maximum Likelihood Estimation (MLE), The Poisson Distribution
Open any statistics textbook and the distributions arrive one at a time, each with its own personality: the binomial has its counting argument, the Poisson its limiting argument, the normal its bell. Each seems to need its own estimation theory, its own Bayesian machinery, its own regression model. Learning them individually is a lot of memorising, and worse, it hides the fact that almost all of them are the same object wearing different clothes. The exponential family is that realisation, written down.
The analogy: the shop only wants your total
Think about a coffee shop loyalty scheme. You buy dozens of things over a year — different drinks, different days, different prices. But when the shop decides what reward you have earned, it does not reread every receipt. It looks at two numbers: how much you spent in total and how many times you visited. Everything else about your year is thrown away, and nothing is lost, because the reward rule only ever depended on those two totals.
A distribution belongs to the exponential family when the same thing is true of its data. However many observations you gather, the distribution only "sees" them through a small fixed set of totals. Those totals are called sufficient statistics, and the whole payoff of the family follows from their existence: if a handful of running sums is all the information there is, then estimation, updating and prediction all become arithmetic on those sums.
The template
A distribution for an observation with parameter belongs to the exponential family if its probability (or density) can be written as
Four pieces, each with a job:
- , the base measure, is whatever depends on the data alone and not on the parameter. It carries no information about .
- , the sufficient statistic, is the only function of the data the parameter ever multiplies. This is the loyalty-card total.
- , the natural parameter, is the parameter re-expressed in whatever units make the formula linear. It is often not the parameter you started with.
- , the log-partition function, is the bookkeeping term that makes the probabilities sum to one.
In words, the template says: take a data-only factor, multiply the parameter by one summary of the data, exponentiate, and divide by whatever makes it a valid distribution.
The one derivation worth doing
Because has to integrate to one, the template forces
Differentiate both sides with respect to . On the left, differentiating brings down a factor ; on the right, the chain rule gives :
Now divide both sides by . The left-hand side becomes , which is just the expected value of . So
In words: differentiate the bookkeeping term once and you get the mean of the sufficient statistic; differentiate twice and you get its variance. You never have to compute a moment integral for any member of the family again — you differentiate one scalar function.
The same trick gives the estimator. With independent observations the log-likelihood is . Setting its derivative in to zero leaves , so the maximum-likelihood estimate solves
In words: choose the parameter whose predicted average of equals the average of you actually observed. Every maximum-likelihood problem in the family is that one sentence.
Worked example 1: the Bernoulli, and where logistic regression comes from
A single coin flip, , heads with probability :
Take logs and regroup. . Exponentiating back:
Match it to the template: , , the natural parameter is — the log-odds — and .
Check it with real numbers at :
- .
- .
- . That is the mean of a Bernoulli, . Correct.
- . That is the Bernoulli variance. Correct.
Look at again: it is the logistic function. Mapping the natural parameter back to a probability is the logistic curve, which is why Logistic Regression puts a straight line on the log-odds and then squashes it — it is fitting the natural parameter of a Bernoulli, nothing more exotic than that.
The explorer below plots that curve. Set the shape to "logistic", then drag the probe to and read the output: with steepness 1 you land on 0.30, the probability we started from.
Worked example 2: the Poisson, and why its mean equals its variance
Counts of events — trades hitting your quote in a minute, say — with rate :
Match the template: , , , and since , the log-partition is .
Now differentiate. and as well, because is its own derivative. The mean and the variance are the same function, so for a Poisson they are the same number — a fact usually presented as a curiosity, here forced by one line of calculus.
Fit it to data. Five one-minute trade counts: . Their sum is 20 and , so the average of is . The estimating equation says , that is , so and .
Notice what you needed: the total, 20, and the count, 5. The individual numbers 3, 5, 2, 6, 4 never entered. That is sufficiency doing real work — a monitoring system can keep two running numbers and refit exactly.
The explorer below shows the fitted distribution. Drag to 4 and note that the spread grows in lockstep with the centre, exactly as requires.
What this means in practice
- Generalised linear models. Logistic regression, Poisson regression and ordinary least squares are one idea: put a linear model on the natural parameter of an exponential-family response. Choosing "the right model for count data" is choosing and .
- Bayesian updating that costs nothing. Conjugate priors exist precisely for exponential families, so a posterior update is addition on sufficient statistics. See Conjugate Priors.
- Streaming and aggregation. Sufficiency means a system can store totals rather than history. Ten years of tick counts collapse to two numbers with no loss.
- Curvature is information. is both the variance and the Fisher information, which is why a flat log-partition means a poorly identified parameter.
- Where it fails. Mixtures, and heavy-tailed models such as Student's t, are not in the family. Their tails cannot be captured by a fixed finite set of totals, which is exactly why fat-tailed estimation is harder.
An exponential-family distribution touches the data only through a fixed summary . Everything else follows: the maximum-likelihood equation is "match the observed average of ", and the mean and variance of are the first and second derivatives of the single scalar function .
Three traps, in the order people fall into them. First, the name: the "exponential family" is a class of distributions; the "exponential distribution" is one member of it. Second, the parameter: is almost never the parameter you were handed. For a Bernoulli it is the log-odds, not ; for a Poisson it is , not . Differentiating with respect to the wrong one gives nonsense. Third, the support: if the set of possible values depends on the parameter — a uniform on to , for instance — the distribution is not in the family, no matter how it is rewritten, and none of the results above apply.
Related concepts
Practice in interviews
Further reading
- Casella & Berger, Statistical Inference (ch. 3)
- Wasserman, All of Statistics (ch. 9)
- McCullagh & Nelder, Generalized Linear Models (ch. 2)