Skip to content
mlmentorship

Exponential family

A unified family of distributions (Gaussian, Bernoulli, Poisson, Beta, Gamma, etc.) with shared properties: sufficient statistics, conjugate priors, simple MLE.

Published · 5 min read ·Core ·Foundation

Visual quick review

Visual first · depth when needed

See how an i.i.d. exponential-family sample collapses to a fixed-size summed sufficient statistic and why an interior MLE matches its empirical moment to the model moment.

Preparing the visual…

Summary

A distribution is in the exponential family if its density / mass function can be written as:

with natural parameter , sufficient statistic , base measure , and log-partition (which normalizes).

Most distributions you use day-to-day are exponential family: Gaussian, Bernoulli, categorical, Poisson, Beta, Gamma, Dirichlet, geometric, exponential. Recognizing them as such gives you free results:

  • MLE is closed-form when the natural parameter is unconstrained: just match sample moments to model moments.
  • Conjugate priors exist and are themselves exponential family.
  • Sufficient statistics contain all the data’s information about . You can summarize a dataset by and forget the rest.
  • Generalized linear models (GLMs) are linear regression generalized to exponential-family responses.

The canonical form

Given the form above:

  • are the sufficient statistics (Bernoulli: ; Gaussian: ).
  • are the natural parameters (Bernoulli: , the logit; Gaussian: ).
  • is the log-partition function; its derivatives with respect to the natural parameter give the mean and covariance of :

This is why MLE via moment-matching works: the gradient of the log-likelihood is “data sufficient stat minus model expected sufficient stat.”

Learning objective

Why do sufficient statistics and moment matching come from the same factorization?

Six Bernoulli observations collapse to one sufficient statistic and one moment equation The Bernoulli observations 1, 0, 1, 1, 0, and 1 map through T of x equals x and sum to the fixed-size sufficient statistic S equals 4. The parameter-dependent sample log-likelihood is 4 eta minus 6 A of eta, so the raw observations are no longer needed. Its score is 4 minus 6 sigmoid eta. Setting that score to zero matches the empirical mean S over n equals 4 over 6 to the model mean expected T of X equals p, yielding p hat equals 4 over 6. 1 · REDUCE THE SAMPLE six Bernoulli observations 1 0 1 1 0 1 S = Σ T(xᵢ) = 4 one number for any n 2 · WRITE THE SAMPLE LOG-LIKELIHOOD ℓ(η) = Sη − nA(η) here: 4η − 6A(η); raw xᵢ disappear 3 · SET THE SCORE TO ZERO S/n = Eη[T(X)] = p̂ = 4/6
Read it this way: first replace the six observations by the single count S = 4. In the sample log-likelihood, every parameter-dependent data term now passes through S. Differentiating gives S − n∇A(η); when an interior MLE exists, setting this to zero matches the empirical statistic S/n to the model moment Eη[T(X)]. For Bernoulli data, that gives p̂ = 4/6. Original schematic checked against Berkeley Stat 210A notes and Minnesota Stat 5421 notes.

Common members

DistributionSufficient stat Natural parameter
Bernoulli() (logit)
Categorical()one-hot (log-probabilities)
Gaussian()
Poisson()
Beta()
Gamma()

Generalized linear models

A GLM combines a linear predictor with an exponential-family response distribution. The link function maps the linear predictor to the natural parameter:

ResponseGLMLink
Continuous (Gaussian)linear regressionidentity
Binary (Bernoulli)logistic regressionlogit
Count (Poisson)Poisson regressionlog
Categoricalmultinomial logisticsoftmax
Time-to-event (Exponential, Weibull)survival modelslog

Logistic regression is a GLM with Bernoulli response and logit link. This unifies the entire family of “regression-style” classifiers.

Properties to remember

  • Convexity: is convex in . So negative log-likelihood is convex, and there is a unique MLE.
  • Sufficient statistics: by Pitman-Koopman-Darmois theorem, exponential families are essentially the only distributions with finite-dimensional sufficient statistics independent of .
  • Conjugacy: exponential families have conjugate priors, also in the exponential family.
  • Maximum entropy: the exponential family with sufficient statistics matching given moments is the maximum-entropy distribution under those constraints.

Common pitfalls

  • Forgetting that the Cauchy distribution is not exponential family. Heavy tails break the sufficient-statistic property.
  • Confusing “exponential” (the distribution) with “exponential family” (the class). The Exp() distribution is one member.
  • Treating natural parameters as the same as canonical parameters. A Gaussian’s natural parameters are , not . Some software libraries default to one or the other; check.