TL;DR
Many of the distributions you already know are written with the same template: a fixed base function, times the exponential of a dot product between a set of natural parameters and a set of summary statistics, divided by a normaliser. The distributions that fit this template form the exponential family. Because they share one shape, estimation is unusually clean. The maximum likelihood estimate is found by setting the model's average summary statistics equal to the data's average.
Where you'll see it: in the Bernoulli and softmax outputs of classifiers, in the conjugate priors of Bayesian models, and in the E-step of the EM algorithm.
Intuition
One recipe, many distributions
Think of a family of recipes. Each recipe counts some ingredients in the data, and each ingredient gets a dial that sets how strongly it counts. The counted ingredients are the sufficient statistics . The dials are the natural parameters . A base factor says how likely each raw value is before any dial is turned, and a normaliser makes the final result add up to 1.
For a Bernoulli coin, the counted ingredient is simply whether the flip came up heads. For a Poisson count, it is the count itself. For a Gaussian with a known spread, it is the value itself. Each member of the family is one recipe with its own ingredients.
Why the template is worth having
When you fit a model to data, you want to know which features of the data matter. The template gives a strong answer. Every bit of information the data carries about the parameter sits in the sum of the sufficient statistics, plus the sample size. The order of the observations does not matter, and neither do the details that the statistics ignore. This is a lossless compression of the data, and it is why the family has such convenient formulas.
The shape also controls what the normaliser looks like. Its logarithm, called the log-partition function , is a smooth convex curve. Its slope is the average of the statistics, so once you know the curve you know the mean. The plot below shows this for a coin.
- A(η), the log-partition
- A′(η), the mean θ
The math
Definition
A family of distributions , indexed by a vector of natural parameters , is an exponential family if its density (or mass function, for discrete ) can be written as
where is a fixed vector of sufficient statistics, is a base measure that does not depend on , and
is the log-partition function. For discrete the integral becomes a sum.
Read the symbols in words. is one observation. is the list of dials. is the list of counted ingredients, and the dot product combines them with the dials. The term is exactly the logarithm of the normaliser, so subtracting it makes the density integrate to 1. Its definition is the log of an integral, and the sum or integral runs over every possible value of .
Many textbooks write the family with the original parameter and a map . The form above, where enters linearly, is called the canonical form, and it is the one that makes the algebra below work.
Three familiar members
Bernoulli. Take for . Take logs:
Define . Then , so and . Substituting, . So
with , , and . The natural parameter is the log-odds, which is why logistic regression is built on this family.
Gaussian with known variance. For with fixed, expand the square in the exponent:
Set , , . Then , so .
Poisson. for . Set , , . The normaliser is (the series for the exponential function evaluated at ), so .
Other members include the exponential, the gamma, the beta, the multinomial and the categorical distribution. The Student-t and the Cauchy are not members, for reasons we return to under tradeoffs.
Moments come from derivatives of A
The most useful fact is this. Differentiate with respect to . The derivative of the exponent with respect to is , so
Differentiating once more gives .
Check it on the Bernoulli. , which is the mean of . And , which is the variance of a Bernoulli. Both match.
Because a covariance matrix is positive semidefinite, is a convex function. That single fact drives the estimation results below.
Maximum likelihood by moment matching
Take independent observations . The log-likelihood is
The data enter only through the sum and the count . Set the gradient to zero:
The left side is the model's expected statistics. The right side is the observed average. The estimate is the setting that makes them equal. This is moment matching, and it is the maximum likelihood estimate. Since is a concave function (the negative of a convex one, plus a linear term), any stationary point is the global maximum.
Conjugate priors
In Bayesian work, the family also gives a ready-made prior. A prior of the form is conjugate to the likelihood. After observations, the posterior has the same form with updated hyperparameters and . Learning is just adding counts. For the Bernoulli, this is the Beta prior, where the success and failure counts are added to the prior's pseudo-counts.
Worked examples
Observed flips: 1, 0, 1, 1, 0. Here , so the data's average statistic is the sample proportion.
- Sum of statistics: , and .
- Average: .
- Match: , so .
- Natural parameter: .
- Interpretation: the estimate is the familiar sample proportion, reached through the template. The general recipe produced a result you could have guessed.
Measurements from , so . Here .
- Sum of statistics: , and .
- For this family , so matching gives .
- .
- Interpretation: the maximum likelihood estimate of a Gaussian mean is the sample mean. Only the sum of the values mattered, not their order.
A mailbox receives 2, 0, 3 and 1 messages in four consecutive hours. Assume the counts are Poisson with rate , so .
- Sum of statistics: , and .
- For this family , so matching gives .
- Natural parameter: .
- Interpretation: about 1.5 messages per hour. Reordering the four counts would not change the estimate, because only and enter the likelihood.
Two Bernoulli experiments each record three flips. Experiment A gives 1, 1, 0 and experiment B gives 0, 1, 1.
- Both have .
- Both have .
- The log-likelihood is for both.
- So the two likelihood curves are identical, and so is the MLE .
- Interpretation: the sufficient statistic keeps everything the parameter needs. The order of the flips is discarded without loss.
Tradeoffs and failure modes
The family is powerful because it is narrow. Whenever a model leaves it, the clean estimation results go away.
| Situation | Problem | Better choice |
|---|---|---|
| Mixture of two or more Gaussians | Not an exponential family; one bell cannot have two humps, and the likelihood has no single summary | Expectation-maximization, which applies the exponential-family formulas to the complete data |
| Uniform on | The support depends on the parameter, so the template (and its moment-matching result) does not apply | Work directly with the maximum observed value, which is sufficient here |
| Student-t or Cauchy noise | The density cannot be written in the canonical form, so there is no moment-matching equation | Numerical maximum likelihood or robust losses |
| Models with an intractable normaliser (large Ising or energy-based models) | has no closed form, so cannot be computed exactly | Sampling (Markov chain Monte Carlo) or variational approximations |
| Mixing up natural and mean parameters | Plugging or into gives wrong answers | Always convert with the link function first |
Two warnings in practice:
- Canonical form is required for the clean moment-matching result. If you fit a non-canonical parametrisation, the gradient picks up a chain-rule factor, and a textbook shortcut will silently give the wrong equation.
- Being in the family is a claim you should check. Plotting a histogram does not confirm it. Check that the support does not depend on the parameter, and that the statistic is a fixed-length sum.
History
Ronald Fisher developed the idea of a sufficient statistic in the 1920s, as a way to say that some summaries of data keep all the information about a parameter. In the mid-1930s, Georges Darmois, Bernard Koopman and Edwin Pitman each worked out, independently, that the families with a fixed-length sufficient statistic (and a support that does not depend on the parameter) are exactly the exponential families. This result is now called the Pitman–Koopman–Darmois theorem. The name "exponential family" came into common use later in the twentieth century.
The family caught on for two reasons. First, it unified many separate distributions into one theory with one estimation rule. Second, in 1972 John Nelder and Robert Wedderburn used it to define generalised linear models, which include logistic and Poisson regression and are still used across the sciences. Lawrence Brown's 1986 monograph gave the full mathematical treatment, and Martin Wainwright and Michael Jordan showed in 2008 how the same convex log-partition function links probabilistic graphical models to variational inference.
Check yourself
QuestionWhat is the log-partition function , and what is its derivative?Show answer
is the log of the integral (or sum) of over all . Subtracting it from the exponent makes the density integrate to 1, so it is the logarithm of the normaliser. Its gradient is the expected value of the sufficient statistics, .
QuestionFive independent Poisson counts are 3, 1, 2, 0 and 4. Find the maximum likelihood estimate of the rate and of the natural parameter .Show answer
The sum of the statistics is , and . Matching to the sample average gives . The natural parameter is .
QuestionWhy does the maximum likelihood estimate of an exponential-family model depend on the data only through the sum of the sufficient statistics and the sample size?Show answer
The log-likelihood is a linear function of with coefficient , minus times , plus a term that does not depend on . Every other feature of the data is absent from the likelihood. This is what sufficiency means for this family.
QuestionA sensor reports whether a light is on (1) or off (0) on 20 trials, and it is on in 14 of them. Which family models this, and what is the maximum likelihood estimate of the on-probability and of the natural parameter ?Show answer
It is a Bernoulli model, which is an exponential family with . The sample average is , so . The natural parameter is the log-odds . The same estimate would follow from any ordering of the 20 trials, because only the count of ons matters.
Sources
- Exponential family (Wikipedia)
- Bishop, Pattern Recognition and Machine Learning, §2.4: Microsoft Research page
- Wainwright and Jordan, Graphical Models, Exponential Families, and Variational Inference (2008): doi:10.1561/2200000001