Exponential family

From HandWiki
Revision as of 18:31, 6 February 2024 by John Stpola (talk | contribs) (simplify)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Short description: Family of probability distributions related to the normal distribution


In probability and statistics, an exponential family is a parametric set of probability distributions of a certain form, specified below. This special form is chosen for mathematical convenience, including the enabling of the user to calculate expectations, covariances using differentiation based on some useful algebraic properties, as well as for generality, as exponential families are in a sense very natural sets of distributions to consider. The term exponential class is sometimes used in place of "exponential family",[1] or the older term Koopman–Darmois family. Sometimes loosely referred to as "the" exponential family, this class of distributions is distinct because they all possess a variety of desirable properties, most importantly the existence of a sufficient statistic.

The concept of exponential families is credited to[2] E. J. G. Pitman,[3] G. Darmois,[4] and B. O. Koopman[5] in 1935–1936. Exponential families of distributions provide a general framework for selecting a possible alternative parameterisation of a parametric family of distributions, in terms of natural parameters, and for defining useful sample statistics, called the natural sufficient statistics of the family.

Nomenclature difficulty

The terms "distribution" and "family" are often used loosely: Specifically, an exponential family is a set of distributions, where the specific distribution varies with the parameter;[lower-alpha 1] however, a parametric family of distributions is often referred to as "a distribution" (like "the normal distribution", meaning "the family of normal distributions"), and the set of all exponential families is sometimes loosely referred to as "the" exponential family.

Definition

Most of the commonly used distributions form an exponential family or subset of an exponential family, listed in the subsection below. The subsections following it are a sequence of increasingly more general mathematical definitions of an exponential family. A casual reader may wish to restrict attention to the first and simplest definition, which corresponds to a single-parameter family of discrete or continuous probability distributions.

Examples of exponential family distributions

Exponential families include many of the most common distributions. Among many others, exponential families includes the following:[6]


A number of common distributions are exponential families, but only when certain parameters are fixed and known. For example:

Note that in each case, the parameters which must be fixed are those that set a limit on the range of values that can possibly be observed.

Examples of common distributions that are not exponential families are Student's t, most mixture distributions, and even the family of uniform distributions when the bounds are not fixed. See the section below on examples for more discussion.

Scalar parameter

The value of [math]\displaystyle{ \ \theta\ }[/math] is called the parameter of the family.

A single-parameter exponential family is a set of probability distributions whose probability density function (or probability mass function, for the case of a discrete distribution) can be expressed in the form

[math]\displaystyle{ \ f_X\!\left( x\ \big|\ \theta \right) = h(x)\ \exp \bigl[\ \eta(\theta) \cdot T(x) - A(\theta)\ \bigr]\ }[/math]

where [math]\displaystyle{ \ T(x)\ , }[/math] [math]\displaystyle{ \ h(x)\ , }[/math] [math]\displaystyle{ \ \eta(\theta)\ , }[/math] and [math]\displaystyle{ \ A(\theta)\ }[/math] are known functions. The function [math]\displaystyle{ \ h(x)\ }[/math] must be non-negative.

An alternative, equivalent form often given is

[math]\displaystyle{ \ f_X\!\left( x\ \big|\ \theta \right) = h(x)\ g(\theta)\ \exp \bigl[\ \eta(\theta) \cdot T(x)\ \bigr]\ }[/math]

or equivalently

[math]\displaystyle{ \ f_X\!\left( x\ \big|\ \theta \right) = \exp\!\bigl[\ \eta(\theta) \cdot T(x) - A(\theta) + B(x)\ \bigr] ~. }[/math]

Note that [math]\displaystyle{ \quad g(\theta) = e^{-A(\theta)} \quad }[/math] and [math]\displaystyle{ \quad h(x) = e^{B(x)} ~. }[/math]

Support must be independent of θ

Importantly, the support of [math]\displaystyle{ \ f_X\!\left( x \big| \theta \right)\ }[/math] (all the possible [math]\displaystyle{ \ x\ }[/math] values for which [math]\displaystyle{ \ f_X\!\left( x \big| \theta \right)\ }[/math] is greater than [math]\displaystyle{ \ 0\ }[/math]) is required to not depend on [math]\displaystyle{ \ \theta ~. }[/math][7] This requirement can be used to exclude a parametric family distribution from being an exponential family.

For example: The Pareto distribution has a pdf which is defined for [math]\displaystyle{ \ x \geq x_{\mathsf m}\ }[/math] (the minimum value, [math]\displaystyle{ \ x_m\ , }[/math] being the scale parameter) and its support, therefore, has a lower limit of [math]\displaystyle{ \ x_{\mathsf m} ~. }[/math] Since the support of [math]\displaystyle{ \ f_{\alpha, x_m}\!(x)\ }[/math] is dependent on the value of the parameter, the family of Pareto distributions does not form an exponential family of distributions (at least when [math]\displaystyle{ \ x_m\ }[/math] is unknown).

Another example: Bernoulli-type distributions – binomial, negative binomial, geometric distribution, and similar – can only be included in the exponential class if the number of Bernoulli trials, [math]\displaystyle{ \ n\ , }[/math] is treated as a fixed constant – excluded from the free parameter(s) [math]\displaystyle{ \ \theta\ }[/math] – since the allowed number of trials sets the limits for the number of "successes" or "failures" that can be observed in a set of trials.

Vector valued x and θ

Often [math]\displaystyle{ \ x\ }[/math] is a vector of measurements, in which case [math]\displaystyle{ \ T(x)\ }[/math] may be a function from the space of possible values of [math]\displaystyle{ \ x\ }[/math] to the real numbers.

More generally, [math]\displaystyle{ \ \eta(\theta)\ }[/math] and [math]\displaystyle{ \ T(x)\ }[/math] can each be vector-valued such that [math]\displaystyle{ \ \eta(\theta) \cdot T(x)\ }[/math] is real-valued. However, see the discussion below on vector parameters, regarding the curved exponential family.

Canonical formulation

If [math]\displaystyle{ \ \eta(\theta) = \theta \ , }[/math] then the exponential family is said to be in canonical form. By defining a transformed parameter [math]\displaystyle{ \ \eta = \eta(\theta)\ , }[/math] it is always possible to convert an exponential family to canonical form. The canonical form is non-unique, since [math]\displaystyle{ \ \eta(\theta)\ }[/math] can be multiplied by any nonzero constant, provided that [math]\displaystyle{ \ T(x)\ }[/math] is multiplied by that constant's reciprocal, or a constant c can be added to [math]\displaystyle{ \ \eta(\theta)\ }[/math] and [math]\displaystyle{ \ h(x)\ }[/math] multiplied by [math]\displaystyle{ \ \exp\!\bigl[{-c} \cdot T(x)\,\bigr]\ }[/math] to offset it. In the special case that [math]\displaystyle{ \ \eta(\theta) = \theta \ }[/math] and [math]\displaystyle{ \ T(x) = x\ , }[/math] then the family is called a natural exponential family.

Even when [math]\displaystyle{ \ x\ }[/math] is a scalar, and there is only a single parameter, the functions [math]\displaystyle{ \ \eta(\theta)\ }[/math] and [math]\displaystyle{ \ T(x)\ }[/math] can still be vectors, as described below.

The function [math]\displaystyle{ \ A(\theta)\ , }[/math] or equivalently [math]\displaystyle{ \ g(\theta)\ , }[/math] is automatically determined once the other functions have been chosen, since it must assume a form that causes the distribution to be normalized (sum or integrate to one over the entire domain). Furthermore, both of these functions can always be written as functions of [math]\displaystyle{ \ \eta\ , }[/math] even when [math]\displaystyle{ \ \eta(\theta)\ }[/math] is not a one-to-one function, i.e. two or more different values of [math]\displaystyle{ \ \theta\ }[/math] map to the same value of [math]\displaystyle{ \ \eta(\theta)\ , }[/math] and hence [math]\displaystyle{ \ \eta(\theta)\ }[/math] cannot be inverted. In such a case, all values of [math]\displaystyle{ \ \theta\ }[/math] mapping to the same [math]\displaystyle{ \ \eta(\theta)\ }[/math] will also have the same value for [math]\displaystyle{ \ A(\theta)\ }[/math] and [math]\displaystyle{ \ g(\theta) ~. }[/math]

Factorization of the variables involved

What is important to note, and what characterizes all exponential family variants, is that the parameter(s) and the observation variable(s) must factorize (can be separated into products each of which involves only one type of variable), either directly or within either part (the base or exponent) of an exponentiation operation. Generally, this means that all of the factors constituting the density or mass function must be of one of the following forms:

[math]\displaystyle{ \ f(x)\ ,~ g(\theta)\ ,~ c^{f(x)}\ ,~ c^{g(\theta)}\ ,~ {[f(x)]}^c\ ,~ {[g(\theta)]}^c\ ,~ {[f(x)]}^{g(\theta)}\ ,~ {[g(\theta)]}^{f(x)}\ ,~ {[f(x)]}^{h(x)g(\theta)}\ ,~ ~~\mathsf{ or }~~ {[g(\theta)]}^{h(x)j(\theta)}\ ,\ }[/math]

where [math]\displaystyle{ \ f\ }[/math] and [math]\displaystyle{ \ h\ }[/math] are arbitrary functions of [math]\displaystyle{ \ x\ , }[/math] the observed statistical variable; [math]\displaystyle{ \ g\ }[/math] and [math]\displaystyle{ \ j\ }[/math] are arbitrary functions of [math]\displaystyle{ \ \theta\ , }[/math] the fixed parameters defining the shape of the distribution; and [math]\displaystyle{ \ c\ }[/math] is any arbitrary constant expression (i.e. a number or an expression that does not change with either [math]\displaystyle{ \ x\ }[/math] or [math]\displaystyle{ \ \theta\ }[/math]).

There are further restrictions on how many such factors can occur. For example, the two expressions:

[math]\displaystyle{ {[f(x) g(\theta)]}^{h(x)j(\theta)}, \qquad {[f(x)]}^{h(x)j(\theta)} [g(\theta)]^{h(x)j(\theta)}, }[/math]

are the same, i.e. a product of two "allowed" factors. However, when rewritten into the factorized form,

[math]\displaystyle{ {[f(x) g(\theta)]}^{h(x)j(\theta)} = {[f(x)]}^{h(x)j(\theta)} [g(\theta)]^{h(x)j(\theta)} = e^{[h(x) \log f(x)] j(\theta) + h(x) [j(\theta) \log g(\theta)]}, }[/math]

it can be seen that it cannot be expressed in the required form. (However, a form of this sort is a member of a curved exponential family, which allows multiple factorized terms in the exponent.[citation needed])

To see why an expression of the form

[math]\displaystyle{ {[f(x)]}^{g(\theta)} }[/math]

qualifies,

[math]\displaystyle{ {[f(x)]}^{g(\theta)} = e^{g(\theta) \log f(x)} }[/math]

and hence factorizes inside of the exponent. Similarly,

[math]\displaystyle{ {[f(x)]}^{h(x)g(\theta)} = e^{h(x)g(\theta)\log f(x)} = e^{[h(x) \log f(x)] g(\theta)} }[/math]

and again factorizes inside of the exponent.

A factor consisting of a sum where both types of variables are involved (e.g. a factor of the form [math]\displaystyle{ 1+f(x)g(\theta) }[/math]) cannot be factorized in this fashion (except in some cases where occurring directly in an exponent); this is why, for example, the Cauchy distribution and Student's t distribution are not exponential families.

Vector parameter

The definition in terms of one real-number parameter can be extended to one real-vector parameter

[math]\displaystyle{ \boldsymbol \theta \equiv \left[\,\theta_1,\,\theta_2,\,\ldots,\,\theta_s\,\right]^\mathsf T~. }[/math]

A family of distributions is said to belong to a vector exponential family if the probability density function (or probability mass function, for discrete distributions) can be written as

[math]\displaystyle{ f_X(x\mid\boldsymbol \theta) = h(x)\,\exp\left(\sum_{i=1}^s \eta_i({\boldsymbol \theta}) T_i(x) - A({\boldsymbol \theta}) \right)~, }[/math]

or in a more compact form,

[math]\displaystyle{ f_X(x\mid\boldsymbol \theta) = h(x)\,\exp\Big(\boldsymbol\eta({\boldsymbol \theta}) \cdot \mathbf{T}(x) - A({\boldsymbol \theta}) \Big) }[/math]

This form writes the sum as a dot product of vector-valued functions [math]\displaystyle{ \boldsymbol\eta({\boldsymbol \theta}) }[/math] and [math]\displaystyle{ \mathbf{T}(x)\, }[/math].

An alternative, equivalent form often seen is

[math]\displaystyle{ f_X(x\mid\boldsymbol \theta) = h(x)\,g(\boldsymbol \theta)\,\exp\Big(\boldsymbol\eta({\boldsymbol \theta}) \cdot \mathbf{T}(x)\Big) }[/math]

As in the scalar valued case, the exponential family is said to be in canonical form if

[math]\displaystyle{ \quad \eta_i({\boldsymbol \theta}) = \theta_i \quad \forall i\,. }[/math]

A vector exponential family is said to be curved if the dimension of

[math]\displaystyle{ \boldsymbol \theta \equiv \left[\,\theta_1,\,\theta_2,\,\ldots,\,\theta_d\,\,\right]^\mathsf T }[/math]

is less than the dimension of the vector

[math]\displaystyle{ {\boldsymbol \eta}(\boldsymbol \theta) \equiv \left[\,\eta_1(\boldsymbol \theta),\,\eta_2(\boldsymbol \theta),\,\ldots,\,\eta_s(\boldsymbol \theta)\,\right]^\mathsf T~. }[/math]

That is, if the dimension, d, of the parameter vector is less than the number of functions, s, of the parameter vector in the above representation of the probability density function. Most common distributions in the exponential family are not curved, and many algorithms designed to work with any exponential family implicitly or explicitly assume that the distribution is not curved.

Just as in the case of a scalar-valued parameter, the function [math]\displaystyle{ A(\boldsymbol \theta) }[/math] or equivalently [math]\displaystyle{ g(\boldsymbol \theta) }[/math] is automatically determined by the normalization constraint, once the other functions have been chosen. Even if [math]\displaystyle{ \boldsymbol\eta(\boldsymbol\theta) }[/math] is not one-to-one, functions [math]\displaystyle{ A(\boldsymbol \eta) }[/math] and [math]\displaystyle{ g(\boldsymbol \eta) }[/math] can be defined by requiring that the distribution is normalized for each value of the natural parameter [math]\displaystyle{ \boldsymbol\eta }[/math]. This yields the canonical form

[math]\displaystyle{ f_X(x\mid\boldsymbol \eta) = h(x)\,\exp\Big(\boldsymbol\eta \cdot \mathbf{T}(x) - A({\boldsymbol \eta})\Big), }[/math]

or equivalently

[math]\displaystyle{ f_X(x\mid\boldsymbol \eta) = h(x)\,g(\boldsymbol \eta)\,\exp\Big(\boldsymbol\eta \cdot \mathbf{T}(x)\Big). }[/math]

The above forms may sometimes be seen with [math]\displaystyle{ \boldsymbol\eta^\mathsf T \mathbf{T}(x) }[/math] in place of [math]\displaystyle{ \boldsymbol\eta \cdot \mathbf{T}(x)\, }[/math]. These are exactly equivalent formulations, merely using different notation for the dot product.

Vector parameter, vector variable

The vector-parameter form over a single scalar-valued random variable can be trivially expanded to cover a joint distribution over a vector of random variables. The resulting distribution is simply the same as the above distribution for a scalar-valued random variable with each occurrence of the scalar x replaced by the vector

[math]\displaystyle{ \mathbf{x} = \left( x_1, x_2, \cdots, x_k \right)^{\mathsf T}~. }[/math]

The dimensions k of the random variable need not match the dimension d of the parameter vector, nor (in the case of a curved exponential function) the dimension s of the natural parameter [math]\displaystyle{ \boldsymbol\eta }[/math] and sufficient statistic T(x) .

The distribution in this case is written as

[math]\displaystyle{ f_X\!\left(\mathbf{x}\mid\boldsymbol \theta\right) = h(\mathbf{x})\,\exp\!\left(\,\sum_{i=1}^s \eta_i({\boldsymbol \theta}) T_i(\mathbf{x}) - A({\boldsymbol \theta})\,\right) }[/math]

Or more compactly as

[math]\displaystyle{ f_X\!\left(\,\mathbf{x}\mid\boldsymbol \theta\,\right) = h(\mathbf{x}) \, \exp\!\Big(\,\boldsymbol\eta({\boldsymbol \theta}) \cdot \mathbf{T}(\mathbf{x}) - A({\boldsymbol \theta})\,\Big) }[/math]

Or alternatively as

[math]\displaystyle{ f_X\!\left(\,\mathbf{x}\mid\boldsymbol \theta\,\right) = g(\boldsymbol \theta) \; h(\mathbf{x}) \, \exp\!\Big(\,\boldsymbol\eta({\boldsymbol \theta}) \cdot \mathbf{T}(\mathbf{x})\,\Big) }[/math]

Measure-theoretic formulation

We use cumulative distribution functions (CDF) in order to encompass both discrete and continuous distributions.

Suppose H is a non-decreasing function of a real variable. Then Lebesgue–Stieltjes integrals with respect to [math]\displaystyle{ {\rm d\,} H(\mathbf{x}) }[/math] are integrals with respect to the reference measure of the exponential family generated by H .

Any member of that exponential family has cumulative distribution function

[math]\displaystyle{ {\rm d\,} F\left(\,\mathbf{x}\mid\boldsymbol\theta\,\right) = \exp\bigl(\,\boldsymbol\eta(\theta) \cdot \mathbf{T}(\mathbf{x})\,-\,A(\boldsymbol\theta)\,\bigr) ~ {\rm d\,} H(\mathbf{x})~. }[/math]

H(x) is a Lebesgue–Stieltjes integrator for the reference measure. When the reference measure is finite, it can be normalized and H is actually the cumulative distribution function of a probability distribution. If F is absolutely continuous with a density [math]\displaystyle{ f(x) }[/math] with respect to a reference measure [math]\displaystyle{ \,{\rm d\,} x \, }[/math] (typically Lebesgue measure), one can write [math]\displaystyle{ \,{\rm d\,} F(x) = f(x)~{\rm d\,} x \, }[/math]. In this case, H is also absolutely continuous and can be written [math]\displaystyle{ \,{\rm d\,} H(x) = h(x)\,{\rm d\,} x \, }[/math] so the formulas reduce to that of the previous paragraphs. If F is discrete, then H is a step function (with steps on the support of F).

Alternatively, we can write the probability measure directly as

[math]\displaystyle{ P\left(\,{\rm d\,}\mathbf{x}\mid\boldsymbol\theta\,\right) = \exp\bigl(\,\boldsymbol\eta(\theta) \cdot \mathbf{T}(\mathbf{x}) - A(\boldsymbol\theta)\,\bigr) ~ \mu({\rm d\,}\mathbf{x})~. }[/math]

for some reference measure [math]\displaystyle{ \mu\, }[/math].

Interpretation

In the definitions above, the functions T(x), η(θ), and A(η) were arbitrary. However, these functions have important interpretations in the resulting probability distribution.

  • T(x) is a sufficient statistic of the distribution. For exponential families, the sufficient statistic is a function of the data that holds all information the data x provides with regard to the unknown parameter values. This means that, for any data sets [math]\displaystyle{ x }[/math] and [math]\displaystyle{ y }[/math], the likelihood ratio is the same, that is [math]\displaystyle{ \frac{f(x;\theta_1)}{f(x;\theta_2)} = \frac{f(y;\theta_1)}{f(y;\theta_2)} }[/math] if  T(x) = T(y. This is true even if x and y are not equal to each other. The dimension of T(x) equals the number of parameters of θ and encompasses all of the information regarding the data related to the parameter θ. The sufficient statistic of a set of independent identically distributed data observations is simply the sum of individual sufficient statistics, and encapsulates all the information needed to describe the posterior distribution of the parameters, given the data (and hence to derive any desired estimate of the parameters). (This important property is discussed further below.)
  • η is called the natural parameter. The set of values of η for which the function [math]\displaystyle{ f_X(x;\eta) }[/math] is integrable is called the natural parameter space. It can be shown that the natural parameter space is always convex.
  • A(η) is called the log-partition function[lower-alpha 2] because it is the logarithm of a normalization factor, without which [math]\displaystyle{ f_X(x;\theta) }[/math] would not be a probability distribution:
[math]\displaystyle{ A(\eta) = \log\left ( \int_X h(x)\,\exp (\eta(\theta) \cdot T(x)) \, \mathrm{d}x \right ) }[/math]

The function A is important in its own right, because the mean, variance and other moments of the sufficient statistic T(x) can be derived simply by differentiating A(η). For example, because log(x) is one of the components of the sufficient statistic of the gamma distribution, [math]\displaystyle{ \operatorname{\mathcal E}[\log x] }[/math] can be easily determined for this distribution using A(η). Technically, this is true because

[math]\displaystyle{ K\left( u\mid\eta \right) = A(\eta+u) - A(\eta)\,, }[/math]

is the cumulant generating function of the sufficient statistic.

Properties

Exponential families have a large number of properties that make them extremely useful for statistical analysis. In many cases, it can be shown that only exponential families have these properties. Examples:

  • Exponential families are the only families with sufficient statistics that can summarize arbitrary amounts of independent identically distributed data using a fixed number of values. (Pitman–KoopmanDarmois theorem)
  • Exponential families have conjugate priors, an important property in Bayesian statistics.
  • The posterior predictive distribution of an exponential-family random variable with a conjugate prior can always be written in closed form (provided that the normalizing factor of the exponential-family distribution can itself be written in closed form).[lower-alpha 3]
  • In the mean-field approximation in variational Bayes (used for approximating the posterior distribution in large Bayesian networks), the best approximating posterior distribution of an exponential-family node (a node is a random variable in the context of Bayesian networks) with a conjugate prior is in the same family as the node.[8]

Given an exponential family defined by [math]\displaystyle{ f_X(x\mid\theta) = h(x)\,\exp\!\bigl[\,\theta \cdot T(x) - A(\theta)\,\bigr] }[/math], where [math]\displaystyle{ \Theta }[/math] is the parameter space, such that [math]\displaystyle{ \theta\in\Theta\subset\R^k }[/math]. Then

  • If [math]\displaystyle{ \Theta }[/math] has nonempty interior in [math]\displaystyle{ \R^k }[/math], then given any IID samples [math]\displaystyle{ X_1,... , X_n\sim f_X }[/math], the statistic [math]\displaystyle{ T(X_1, ..., X_n):= \sum_{i=1}^n T(X_i) }[/math] is a complete statistic for [math]\displaystyle{ \theta }[/math].[9][10]
  • [math]\displaystyle{ T }[/math] is a minimal statistic for [math]\displaystyle{ \theta }[/math] iff for all [math]\displaystyle{ \theta_1, \theta_2\in \Theta }[/math], and [math]\displaystyle{ x_1, x_2 }[/math] in the support of [math]\displaystyle{ X }[/math], if [math]\displaystyle{ (\theta_1 - \theta_2)\cdot (T(x_1) - T(x_2)) = 0 }[/math], then [math]\displaystyle{ \theta_1 = \theta_2 }[/math] or [math]\displaystyle{ x_1 = x_2 }[/math].[11]

Examples

It is critical, when considering the examples in this section, to remember the discussion above about what it means to say that a "distribution" is an exponential family, and in particular to keep in mind that the set of parameters that are allowed to vary is critical in determining whether a "distribution" is or is not an exponential family.

The normal, exponential, log-normal, gamma, chi-squared, beta, Dirichlet, Bernoulli, categorical, Poisson, geometric, inverse Gaussian, ALAAM, von Mises, and von Mises-Fisher distributions are all exponential families.

Some distributions are exponential families only if some of their parameters are held fixed. The family of Pareto distributions with a fixed minimum bound xm form an exponential family. The families of binomial and multinomial distributions with fixed number of trials n but unknown probability parameter(s) are exponential families. The family of negative binomial distributions with fixed number of failures (a.k.a. stopping-time parameter) r is an exponential family. However, when any of the above-mentioned fixed parameters are allowed to vary, the resulting family is not an exponential family.

As mentioned above, as a general rule, the support of an exponential family must remain the same across all parameter settings in the family. This is why the above cases (e.g. binomial with varying number of trials, Pareto with varying minimum bound) are not exponential families — in all of the cases, the parameter in question affects the support (particularly, changing the minimum or maximum possible value). For similar reasons, neither the discrete uniform distribution nor continuous uniform distribution are exponential families as one or both bounds vary.

The Weibull distribution with fixed shape parameter k is an exponential family. Unlike in the previous examples, the shape parameter does not affect the support; the fact that allowing it to vary makes the Weibull non-exponential is due rather to the particular form of the Weibull's probability density function (k appears in the exponent of an exponent).

In general, distributions that result from a finite or infinite mixture of other distributions, e.g. mixture model densities and compound probability distributions, are not exponential families. Examples are typical Gaussian mixture models as well as many heavy-tailed distributions that result from compounding (i.e. infinitely mixing) a distribution with a prior distribution over one of its parameters, e.g. the Student's t-distribution (compounding a normal distribution over a gamma-distributed precision prior), and the beta-binomial and Dirichlet-multinomial distributions. Other examples of distributions that are not exponential families are the F-distribution, Cauchy distribution, hypergeometric distribution and logistic distribution.

Following are some detailed examples of the representation of some useful distribution as exponential families.

Normal distribution: unknown mean, known variance

As a first example, consider a random variable distributed normally with unknown mean μ and known variance σ2. The probability density function is then

[math]\displaystyle{ f_\sigma(x;\mu) = \frac 1 {\sqrt{2 \pi \sigma^2}} e^{-(x-\mu)^2/(2\sigma^2)}. }[/math]

This is a single-parameter exponential family, as can be seen by setting

[math]\displaystyle{ \begin{align} h_\sigma(x) &= \frac 1 {\sqrt{2\pi\sigma^2}} e^{-x^2/(2\sigma^2)} \\[4pt] T_\sigma(x) &= \frac x \sigma \\[4pt] A_\sigma(\mu) &= \frac{\mu^2}{2\sigma^2}\\[4pt] \eta_\sigma(\mu) &= \frac \mu \sigma. \end{align} }[/math]

If σ = 1 this is in canonical form, as then η(μ) = μ.

Normal distribution: unknown mean and unknown variance

Next, consider the case of a normal distribution with unknown mean and unknown variance. The probability density function is then

[math]\displaystyle{ f(y;\mu,\sigma) = \frac{1}{\sqrt{2 \pi \sigma^2}} e^{-(y-\mu)^2/2 \sigma^2}. }[/math]

This is an exponential family which can be written in canonical form by defining

[math]\displaystyle{ \begin{align} \boldsymbol {\eta} &= \left[\,\frac{\mu}{\sigma^2},~-\frac{1}{2\sigma^2}\,\right] \\ h(y) &= \frac{1}{\sqrt{2 \pi}} \\ T(y) &= \left( y, y^2 \right)^{\rm T} \\ A({\boldsymbol \eta}) &= \frac{\mu^2}{2 \sigma^2} + \log |\sigma| = -\frac{\eta_1^2}{4\eta_2} + \frac{1}{2}\log\left|\frac{1}{2\eta_2} \right| \end{align} }[/math]

Binomial distribution

As an example of a discrete exponential family, consider the binomial distribution with known number of trials n. The probability mass function for this distribution is

[math]\displaystyle{ f(x)={n \choose x}p^x (1-p)^{n-x}, \quad x \in \{0, 1, 2, \ldots, n\}. }[/math]

This can equivalently be written as

[math]\displaystyle{ f(x)={n \choose x}\exp\left(x \log\left(\frac{p}{1-p}\right) + n \log(1-p)\right), }[/math]

which shows that the binomial distribution is an exponential family, whose natural parameter is

[math]\displaystyle{ \eta = \log\frac{p}{1-p}. }[/math]

This function of p is known as logit.

Table of distributions

The following table shows how to rewrite a number of common distributions as exponential-family distributions with natural parameters. Refer to the flashcards[12] for main exponential families.

For a scalar variable and scalar parameter, the form is as follows:

[math]\displaystyle{ f_X(x\mid \theta) = h(x) \exp\Big(\eta({\theta}) T(x) - A({ \eta})\Big) }[/math]

For a scalar variable and vector parameter:

[math]\displaystyle{ f_X(x\mid\boldsymbol \theta) = h(x) \exp\Big(\boldsymbol\eta({\boldsymbol \theta}) \cdot \mathbf{T}(x) - A({\boldsymbol \eta})\Big) }[/math]
[math]\displaystyle{ f_X(x\mid\boldsymbol \theta) = h(x) g(\boldsymbol \theta) \exp\Big(\boldsymbol\eta({\boldsymbol \theta}) \cdot \mathbf{T}(x)\Big) }[/math]

For a vector variable and vector parameter:

[math]\displaystyle{ f_X(\mathbf{x}\mid\boldsymbol \theta) = h(\mathbf{x}) \exp\Big(\boldsymbol\eta({\boldsymbol \theta}) \cdot \mathbf{T}(\mathbf{x}) - A({\boldsymbol \eta})\Big) }[/math]

The above formulas choose the functional form of the exponential-family with a log-partition function [math]\displaystyle{ A({\boldsymbol \eta}) }[/math]. The reason for this is so that the moments of the sufficient statistics can be calculated easily, simply by differentiating this function. Alternative forms involve either parameterizing this function in terms of the normal parameter [math]\displaystyle{ \boldsymbol\theta }[/math] instead of the natural parameter, and/or using a factor [math]\displaystyle{ g(\boldsymbol\eta) }[/math] outside of the exponential. The relation between the latter and the former is:

[math]\displaystyle{ A(\boldsymbol\eta) = -\log g(\boldsymbol\eta) }[/math]
[math]\displaystyle{ g(\boldsymbol\eta) = e^{-A(\boldsymbol\eta)} }[/math]

To convert between the representations involving the two types of parameter, use the formulas below for writing one type of parameter in terms of the other.

Distribution Parameter(s) [math]\displaystyle{ \boldsymbol\theta }[/math] Natural parameter(s) [math]\displaystyle{ \boldsymbol\eta }[/math] Inverse parameter mapping Base measure [math]\displaystyle{ h(x) }[/math] Sufficient statistic [math]\displaystyle{ T(x) }[/math] Log-partition [math]\displaystyle{ A(\boldsymbol\eta) }[/math] Log-partition [math]\displaystyle{ A(\boldsymbol\theta) }[/math]
Bernoulli distribution [math]\displaystyle{ p }[/math] [math]\displaystyle{ \log\frac{p}{1-p} }[/math]
  • This is the logit function.
[math]\displaystyle{ \frac{1}{1+e^{-\eta}} = \frac{e^\eta}{1+e^{\eta}} }[/math] [math]\displaystyle{ 1 }[/math] [math]\displaystyle{ x }[/math] [math]\displaystyle{ \log (1+e^{\eta}) }[/math] [math]\displaystyle{ -\log (1-p) }[/math]
binomial distribution
with known number of trials [math]\displaystyle{ n }[/math]
[math]\displaystyle{ p }[/math] [math]\displaystyle{ \log\frac{p}{1-p} }[/math] [math]\displaystyle{ \frac{1}{1+e^{-\eta}} = \frac{e^\eta}{1+e^{\eta}} }[/math] [math]\displaystyle{ {n \choose x} }[/math] [math]\displaystyle{ x }[/math] [math]\displaystyle{ n \log (1+e^{\eta}) }[/math] [math]\displaystyle{ -n \log (1-p) }[/math]
Poisson distribution [math]\displaystyle{ \lambda }[/math] [math]\displaystyle{ \log\lambda }[/math] [math]\displaystyle{ e^\eta }[/math] [math]\displaystyle{ \frac{1}{x!} }[/math] [math]\displaystyle{ x }[/math] [math]\displaystyle{ e^{\eta} }[/math] [math]\displaystyle{ \lambda }[/math]
negative binomial distribution
with known number of failures [math]\displaystyle{ r }[/math]
[math]\displaystyle{ p }[/math] [math]\displaystyle{ \log(1-p) }[/math] [math]\displaystyle{ 1-e^\eta }[/math] [math]\displaystyle{ {x+r-1 \choose x} }[/math] [math]\displaystyle{ x }[/math] [math]\displaystyle{ -r \log (1-e^{\eta}) }[/math] [math]\displaystyle{ -r \log (1-p) }[/math]
exponential distribution [math]\displaystyle{ \lambda }[/math] [math]\displaystyle{ -\lambda }[/math] [math]\displaystyle{ -\eta }[/math] [math]\displaystyle{ 1 }[/math] [math]\displaystyle{ x }[/math] [math]\displaystyle{ -\log(-\eta) }[/math] [math]\displaystyle{ -\log\lambda }[/math]
Pareto distribution
with known minimum value [math]\displaystyle{ x_m }[/math]
[math]\displaystyle{ \alpha }[/math] [math]\displaystyle{ -\alpha-1 }[/math] [math]\displaystyle{ -1-\eta }[/math] [math]\displaystyle{ 1 }[/math] [math]\displaystyle{ \log x }[/math] [math]\displaystyle{ -\log (-1-\eta) + (1+\eta) \log x_{\mathrm m} }[/math] [math]\displaystyle{ -\log \alpha - \alpha \log x_{\mathrm m} }[/math]
Weibull distribution
with known shape k
[math]\displaystyle{ \lambda }[/math] [math]\displaystyle{ -\frac{1}{\lambda^k} }[/math] [math]\displaystyle{ (-\eta)^{-1/k} }[/math] [math]\displaystyle{ x^{k-1} }[/math] [math]\displaystyle{ x^k }[/math] [math]\displaystyle{ -\log(-\eta) -\log k }[/math] [math]\displaystyle{ k\log\lambda -\log k }[/math]
Laplace distribution
with known mean [math]\displaystyle{ \mu }[/math]
[math]\displaystyle{ b }[/math] [math]\displaystyle{ -\frac{1}{b} }[/math] [math]\displaystyle{ -\frac{1}{\eta} }[/math] [math]\displaystyle{ 1 }[/math] [math]\displaystyle{ |x-\mu| }[/math] [math]\displaystyle{ \log\left(-\frac{2}{\eta}\right) }[/math] [math]\displaystyle{ \log 2b }[/math]
chi-squared distribution [math]\displaystyle{ \nu }[/math] [math]\displaystyle{ \frac{\nu}{2}-1 }[/math] [math]\displaystyle{ 2(\eta+1) }[/math] [math]\displaystyle{ e^{-x/2} }[/math] [math]\displaystyle{ \log x }[/math] [math]\displaystyle{ \log \Gamma(\eta+1)+(\eta+1)\log 2 }[/math] [math]\displaystyle{ \log \Gamma\left(\frac{\nu}{2}\right)+\frac{\nu}{2}\log 2 }[/math]
normal distribution
known variance
[math]\displaystyle{ \mu }[/math] [math]\displaystyle{ \frac{\mu}{\sigma} }[/math] [math]\displaystyle{ \sigma\eta }[/math] [math]\displaystyle{ \frac{e^{-x^2/(2\sigma^2)}}{\sqrt{2\pi}\sigma} }[/math] [math]\displaystyle{ \frac{x}{\sigma} }[/math] [math]\displaystyle{ \frac{\eta^2}{2} }[/math] [math]\displaystyle{ \frac{\mu^2}{2\sigma^2} }[/math]
continuous Bernoulli distribution [math]\displaystyle{ \lambda }[/math] [math]\displaystyle{ \log\frac{\lambda}{1-\lambda} }[/math] [math]\displaystyle{ \frac{e^\eta}{1+e^\eta} }[/math] [math]\displaystyle{ 1 }[/math] [math]\displaystyle{ x }[/math] [math]\displaystyle{ \log\frac{e^\eta - 1}{\eta} }[/math] [math]\displaystyle{ \log\left( \frac{1 - 2\lambda}{(1-\lambda)\log\left(\frac{1-\lambda}{\lambda}\right)} \right) }[/math]
normal distribution [math]\displaystyle{ \mu,\ \sigma^2 }[/math] [math]\displaystyle{ \begin{bmatrix} \dfrac{\mu}{\sigma^2} \\[10pt] -\dfrac{1}{2\sigma^2} \end{bmatrix} }[/math] [math]\displaystyle{ \begin{bmatrix} -\dfrac{\eta_1}{2\eta_2} \\[15pt] -\dfrac{1}{2\eta_2} \end{bmatrix} }[/math] [math]\displaystyle{ \frac{1}{\sqrt{2\pi}} }[/math] [math]\displaystyle{ \begin{bmatrix} x \\ x^2 \end{bmatrix} }[/math] [math]\displaystyle{ -\frac{\eta_1^2}{4\eta_2} - \frac12\log(-2\eta_2) }[/math] [math]\displaystyle{ \frac{\mu^2}{2\sigma^2} + \log \sigma }[/math]
log-normal distribution [math]\displaystyle{ \mu,\ \sigma^2 }[/math] [math]\displaystyle{ \begin{bmatrix} \dfrac{\mu}{\sigma^2} \\[10pt] -\dfrac{1}{2\sigma^2} \end{bmatrix} }[/math] [math]\displaystyle{ \begin{bmatrix} -\dfrac{\eta_1}{2\eta_2} \\[15pt] -\dfrac{1}{2\eta_2} \end{bmatrix} }[/math] [math]\displaystyle{ \frac{1}{\sqrt{2\pi}x} }[/math] [math]\displaystyle{ \begin{bmatrix} \log x \\ (\log x)^2 \end{bmatrix} }[/math] [math]\displaystyle{ -\frac{\eta_1^2}{4\eta_2} - \frac12\log(-2\eta_2) }[/math] [math]\displaystyle{ \frac{\mu^2}{2\sigma^2} + \log \sigma }[/math]
inverse Gaussian distribution [math]\displaystyle{ \mu,\ \lambda }[/math] [math]\displaystyle{ \begin{bmatrix} -\dfrac{\lambda}{2\mu^2} \\[15pt] -\dfrac{\lambda}{2} \end{bmatrix} }[/math] [math]\displaystyle{ \begin{bmatrix} \sqrt{\dfrac{\eta_2}{\eta_1}} \\[15pt] -2\eta_2 \end{bmatrix} }[/math] [math]\displaystyle{ \frac{1}{\sqrt{2\pi}x^{3/2}} }[/math] [math]\displaystyle{ \begin{bmatrix} x \\[5pt] \dfrac{1}{x} \end{bmatrix} }[/math] [math]\displaystyle{ -2\sqrt{\eta_1\eta_2} -\frac12\log(-2\eta_2) }[/math] [math]\displaystyle{ -\frac{\lambda}{\mu} -\frac12\log\lambda }[/math]
gamma distribution [math]\displaystyle{ \alpha,\ \beta }[/math] [math]\displaystyle{ \begin{bmatrix} \alpha-1 \\ -\beta \end{bmatrix} }[/math] [math]\displaystyle{ \begin{bmatrix} \eta_1+1 \\ -\eta_2 \end{bmatrix} }[/math] [math]\displaystyle{ 1 }[/math] [math]\displaystyle{ \begin{bmatrix} \log x \\ x \end{bmatrix} }[/math] [math]\displaystyle{ \log \Gamma(\eta_1+1)-(\eta_1+1)\log(-\eta_2) }[/math] [math]\displaystyle{ \log \Gamma(\alpha)-\alpha\log\beta }[/math]
[math]\displaystyle{ k,\ \theta }[/math] [math]\displaystyle{ \begin{bmatrix} k-1 \\[5pt] -\dfrac{1}{\theta} \end{bmatrix} }[/math] [math]\displaystyle{ \begin{bmatrix} \eta_1+1 \\[5pt] -\dfrac{1}{\eta_2} \end{bmatrix} }[/math] [math]\displaystyle{ \log \Gamma(k)+k\log\theta }[/math]
inverse gamma distribution [math]\displaystyle{ \alpha,\ \beta }[/math] [math]\displaystyle{ \begin{bmatrix} -\alpha-1 \\ -\beta \end{bmatrix} }[/math] [math]\displaystyle{ \begin{bmatrix} -\eta_1-1 \\ -\eta_2 \end{bmatrix} }[/math] [math]\displaystyle{ 1 }[/math] [math]\displaystyle{ \begin{bmatrix} \log x \\ \frac{1}{x} \end{bmatrix} }[/math] [math]\displaystyle{ \log \Gamma(-\eta_1-1)-(-\eta_1-1)\log(-\eta_2) }[/math] [math]\displaystyle{ \log \Gamma(\alpha)-\alpha\log\beta }[/math]
generalized inverse Gaussian distribution [math]\displaystyle{ p,\ a,\ b }[/math] [math]\displaystyle{ \begin{bmatrix} p-1 \\ -a/2 \\ -b/2 \end{bmatrix} }[/math] [math]\displaystyle{ \begin{bmatrix} \eta_1+1 \\ -2\eta_2\\ -2\eta_3 \end{bmatrix} }[/math] [math]\displaystyle{ 1 }[/math] [math]\displaystyle{ \begin{bmatrix} \log x \\ x \\ \frac{1}{x} \end{bmatrix} }[/math] [math]\displaystyle{ \log 2 K_{\eta_1+1}(\sqrt{4\eta_2\eta_3}) - \frac{\eta_1+1}{2}\log\frac{\eta_2}{\eta_3} }[/math] [math]\displaystyle{ \log 2 K_{p}(\sqrt{ab}) - \frac{p}{2}\log\frac{a}{b} }[/math]
scaled inverse chi-squared distribution [math]\displaystyle{ \nu,\ \sigma^2 }[/math] [math]\displaystyle{ \begin{bmatrix} -\dfrac{\nu}{2}-1 \\[10pt] -\dfrac{\nu\sigma^2}{2} \end{bmatrix} }[/math] [math]\displaystyle{ \begin{bmatrix} -2(\eta_1+1) \\[10pt] \dfrac{\eta_2}{\eta_1+1} \end{bmatrix} }[/math] [math]\displaystyle{ 1 }[/math] [math]\displaystyle{ \begin{bmatrix} \log x \\ \frac{1}{x} \end{bmatrix} }[/math] [math]\displaystyle{ \log \Gamma(-\eta_1-1)-(-\eta_1-1)\log(-\eta_2) }[/math] [math]\displaystyle{ \log \Gamma\left(\frac{\nu}{2}\right)-\frac{\nu}{2}\log\frac{\nu\sigma^2}{2} }[/math]
beta distribution

(variant 1)
[math]\displaystyle{ \alpha,\ \beta }[/math] [math]\displaystyle{ \begin{bmatrix} \alpha \\ \beta \end{bmatrix} }[/math] [math]\displaystyle{ \begin{bmatrix} \eta_1 \\ \eta_2 \end{bmatrix} }[/math] [math]\displaystyle{ \frac{1}{x(1-x)} }[/math] [math]\displaystyle{ \begin{bmatrix} \log x \\ \log (1-x) \end{bmatrix} }[/math] [math]\displaystyle{ \log \Gamma(\eta_1) + \log \Gamma(\eta_2) - \log \Gamma(\eta_1+\eta_2) }[/math] [math]\displaystyle{ \log \Gamma(\alpha) + \log \Gamma(\beta) - \log \Gamma(\alpha+\beta) }[/math]
beta distribution

(variant 2)
[math]\displaystyle{ \alpha,\ \beta }[/math] [math]\displaystyle{ \begin{bmatrix} \alpha - 1 \\ \beta - 1 \end{bmatrix} }[/math] [math]\displaystyle{ \begin{bmatrix} \eta_1 + 1 \\ \eta_2 + 1 \end{bmatrix} }[/math] [math]\displaystyle{ 1 }[/math] [math]\displaystyle{ \begin{bmatrix} \log x \\ \log (1-x) \end{bmatrix} }[/math] [math]\displaystyle{ \log \Gamma(\eta_1 + 1) + \log \Gamma(\eta_2 + 1) - \log \Gamma(\eta_1 + \eta_2 + 2) }[/math] [math]\displaystyle{ \log \Gamma(\alpha) + \log \Gamma(\beta) - \log \Gamma(\alpha+\beta) }[/math]
multivariate normal distribution [math]\displaystyle{ \boldsymbol\mu,\ \boldsymbol\Sigma }[/math] [math]\displaystyle{ \begin{bmatrix} \boldsymbol\Sigma^{-1}\boldsymbol\mu \\[5pt] -\frac12\boldsymbol\Sigma^{-1} \end{bmatrix} }[/math] [math]\displaystyle{ \begin{bmatrix} -\frac12\boldsymbol\eta_2^{-1}\boldsymbol\eta_1 \\[5pt] -\frac12\boldsymbol\eta_2^{-1} \end{bmatrix} }[/math] [math]\displaystyle{ (2\pi)^{-\frac{k}{2}} }[/math] [math]\displaystyle{ \begin{bmatrix} \mathbf{x} \\[5pt] \mathbf{x}\mathbf{x}^{\mathsf T} \end{bmatrix} }[/math] [math]\displaystyle{ -\frac{1}{4}\boldsymbol\eta_1^{\mathsf T}\boldsymbol\eta_2^{-1}\boldsymbol\eta_1 - \frac12\log\left|-2\boldsymbol\eta_2\right| }[/math] [math]\displaystyle{ \frac12\boldsymbol\mu^{\mathsf T}\boldsymbol\Sigma^{-1}\boldsymbol\mu + \frac12 \log |\boldsymbol\Sigma| }[/math]
categorical distribution

(variant 1)
[math]\displaystyle{ p_1,\ \ldots,\,p_k }[/math]

where [math]\displaystyle{ \textstyle\sum_{i=1}^k p_i=1 }[/math]
[math]\displaystyle{ \begin{bmatrix} \log p_1 \\ \vdots \\ \log p_k \end{bmatrix} }[/math] [math]\displaystyle{ \begin{bmatrix} e^{\eta_1} \\ \vdots \\ e^{\eta_k} \end{bmatrix} }[/math]

where [math]\displaystyle{ \textstyle\sum_{i=1}^k e^{\eta_i}=1 }[/math]
[math]\displaystyle{ 1 }[/math] [math]\displaystyle{ \begin{bmatrix} [x=1] \\ \vdots \\ {[x=k]} \end{bmatrix} }[/math] [math]\displaystyle{ 0 }[/math] [math]\displaystyle{ 0 }[/math]
categorical distribution

(variant 2)
[math]\displaystyle{ p_1,\ \ldots,\,p_k }[/math]

where [math]\displaystyle{ \textstyle\sum_{i=1}^k p_i=1 }[/math]
[math]\displaystyle{ \begin{bmatrix} \log p_1+C \\ \vdots \\ \log p_k+C \end{bmatrix} }[/math] [math]\displaystyle{ \begin{bmatrix} \dfrac{1}{C}e^{\eta_1} \\ \vdots \\ \dfrac{1}{C}e^{\eta_k} \end{bmatrix} = }[/math]

[math]\displaystyle{ \begin{bmatrix} \dfrac{e^{\eta_1}}{\sum_{i=1}^{k}e^{\eta_i}} \\[10pt] \vdots \\[5pt] \dfrac{e^{\eta_k}}{\sum_{i=1}^k e^{\eta_i}} \end{bmatrix} }[/math]

where [math]\displaystyle{ \textstyle\sum_{i=1}^k e^{\eta_i}=C }[/math]

[math]\displaystyle{ 1 }[/math] [math]\displaystyle{ \begin{bmatrix} [x=1] \\ \vdots \\ {[x=k]} \end{bmatrix} }[/math] [math]\displaystyle{ 0 }[/math] [math]\displaystyle{ 0 }[/math]
categorical distribution

(variant 3)
[math]\displaystyle{ p_1,\ \ldots,\,p_k }[/math]

where [math]\displaystyle{ p_k = 1 - \textstyle\sum_{i=1}^{k-1} p_i }[/math]
[math]\displaystyle{ \begin{bmatrix} \log \dfrac{p_1}{p_k} \\[10pt] \vdots \\[5pt] \log \dfrac{p_{k-1}}{p_k} \\[15pt] 0 \end{bmatrix} = }[/math]

[math]\displaystyle{ \begin{bmatrix} \log \dfrac{p_1}{1-\sum_{i=1}^{k-1}p_i} \\[10pt] \vdots \\[5pt] \log \dfrac{p_{k-1}}{1-\sum_{i=1}^{k-1}p_i} \\[15pt] 0 \end{bmatrix} }[/math]
[math]\displaystyle{ \begin{bmatrix} \dfrac{e^{\eta_1}}{\sum_{i=1}^{k}e^{\eta_i}} \\[10pt] \vdots \\[5pt] \dfrac{e^{\eta_k}}{\sum_{i=1}^{k}e^{\eta_i}} \end{bmatrix} = }[/math]

[math]\displaystyle{ \begin{bmatrix} \dfrac{e^{\eta_1}}{1+\sum_{i=1}^{k-1}e^{\eta_i}} \\[10pt] \vdots \\[5pt] \dfrac{e^{\eta_{k-1}}}{1+\sum_{i=1}^{k-1}e^{\eta_i}} \\[15pt] \dfrac{1}{1+\sum_{i=1}^{k-1}e^{\eta_i}} \end{bmatrix} }[/math]

[math]\displaystyle{ 1 }[/math] [math]\displaystyle{ \begin{bmatrix} [x=1] \\ \vdots \\ {[x=k]} \end{bmatrix} }[/math] [math]\displaystyle{ \log \left(\sum_{i=1}^{k} e^{\eta_i}\right) = \log \left(1+\sum_{i=1}^{k-1} e^{\eta_i}\right) }[/math] [math]\displaystyle{ -\log p_k = -\log \left(1 - \sum_{i=1}^{k-1} p_i\right) }[/math]
multinomial distribution

(variant 1)
with known number of trials [math]\displaystyle{ n }[/math]
[math]\displaystyle{ p_1,\ \ldots,\,p_k }[/math]

where [math]\displaystyle{ \textstyle\sum_{i=1}^k p_i=1 }[/math]
[math]\displaystyle{ \begin{bmatrix} \log p_1 \\ \vdots \\ \log p_k \end{bmatrix} }[/math] [math]\displaystyle{ \begin{bmatrix} e^{\eta_1} \\ \vdots \\ e^{\eta_k} \end{bmatrix} }[/math]

where [math]\displaystyle{ \textstyle\sum_{i=1}^k e^{\eta_i}=1 }[/math]
[math]\displaystyle{ \frac{n!}{\prod_{i=1}^k x_i!} }[/math] [math]\displaystyle{ \begin{bmatrix} x_1 \\ \vdots \\ x_k \end{bmatrix} }[/math] [math]\displaystyle{ 0 }[/math] [math]\displaystyle{ 0 }[/math]
multinomial distribution

(variant 2)
with known number of trials [math]\displaystyle{ n }[/math]
[math]\displaystyle{ p_1,\ \ldots,\,p_k }[/math]

where [math]\displaystyle{ \textstyle\sum_{i=1}^k p_i=1 }[/math]
[math]\displaystyle{ \begin{bmatrix} \log p_1+C \\ \vdots \\ \log p_k+C \end{bmatrix} }[/math] [math]\displaystyle{ \begin{bmatrix} \dfrac{1}{C}e^{\eta_1} \\ \vdots \\ \dfrac{1}{C}e^{\eta_k} \end{bmatrix} = }[/math]

[math]\displaystyle{ \begin{bmatrix} \dfrac{e^{\eta_1}}{\sum_{i=1}^{k}e^{\eta_i}} \\[10pt] \vdots \\[5pt] \dfrac{e^{\eta_k}}{\sum_{i=1}^{k}e^{\eta_i}} \end{bmatrix} }[/math]

where [math]\displaystyle{ \textstyle\sum_{i=1}^k e^{\eta_i}=C }[/math]

[math]\displaystyle{ \frac{n!}{\prod_{i=1}^k x_i!} }[/math] [math]\displaystyle{ \begin{bmatrix} x_1 \\ \vdots \\ x_k \end{bmatrix} }[/math] [math]\displaystyle{ 0 }[/math] [math]\displaystyle{ 0 }[/math]
multinomial distribution

(variant 3)
with known number of trials [math]\displaystyle{ n }[/math]
[math]\displaystyle{ p_1,\ \ldots,\,p_k }[/math]

where [math]\displaystyle{ p_k = 1 - \textstyle\sum_{i=1}^{k-1} p_i }[/math]
[math]\displaystyle{ \begin{bmatrix} \log \dfrac{p_1}{p_k} \\[10pt] \vdots \\[5pt] \log \dfrac{p_{k-1}}{p_k} \\[15pt] 0 \end{bmatrix} = }[/math]

[math]\displaystyle{ \begin{bmatrix} \log \dfrac{p_1}{1-\sum_{i=1}^{k-1}p_i} \\[10pt] \vdots \\[5pt] \log \dfrac{p_{k-1}}{1-\sum_{i=1}^{k-1}p_i} \\[15pt] 0 \end{bmatrix} }[/math]
[math]\displaystyle{ \begin{bmatrix} \dfrac{e^{\eta_1}}{\sum_{i=1}^k e^{\eta_i}} \\[10pt] \vdots \\[5pt] \dfrac{e^{\eta_k}}{\sum_{i=1}^k e^{\eta_i}} \end{bmatrix} = }[/math]

[math]\displaystyle{ \begin{bmatrix} \dfrac{e^{\eta_1}}{1+\sum_{i=1}^{k-1}e^{\eta_i}} \\[10pt] \vdots \\[5pt] \dfrac{e^{\eta_{k-1}}}{1+\sum_{i=1}^{k-1}e^{\eta_i}} \\[15pt] \dfrac{1}{1+\sum_{i=1}^{k-1}e^{\eta_i}} \end{bmatrix} }[/math]

[math]\displaystyle{ \frac{n!}{\prod_{i=1}^k x_i!} }[/math] [math]\displaystyle{ \begin{bmatrix} x_1 \\ \vdots \\ x_k \end{bmatrix} }[/math] [math]\displaystyle{ n\log \left(\sum_{i=1}^k e^{\eta_i}\right) = n\log \left(1+\sum_{i=1}^{k-1} e^{\eta_i}\right) }[/math] [math]\displaystyle{ -n\log p_k = -n\log \left(1 - \sum_{i=1}^{k-1} p_i\right) }[/math]
Dirichlet distribution

(variant 1)
[math]\displaystyle{ \alpha_1,\ \ldots,\,\alpha_k }[/math] [math]\displaystyle{ \begin{bmatrix} \alpha_1 \\ \vdots \\ \alpha_k \end{bmatrix} }[/math] [math]\displaystyle{ \begin{bmatrix} \eta_1 \\ \vdots \\ \eta_k \end{bmatrix} }[/math] [math]\displaystyle{ \frac{1}{\prod_{i=1}^k x_i} }[/math] [math]\displaystyle{ \begin{bmatrix} \log x_1 \\ \vdots \\ \log x_k \end{bmatrix} }[/math] [math]\displaystyle{ \sum_{i=1}^k \log \Gamma(\eta_i) - \log \Gamma\left(\sum_{i=1}^k \eta_i \right) }[/math] [math]\displaystyle{ \sum_{i=1}^k \log \Gamma(\alpha_i) - \log \Gamma\left(\sum_{i=1}^k\alpha_i\right) }[/math]
Dirichlet distribution

(variant 2)
[math]\displaystyle{ \alpha_1,\ \ldots,\,\alpha_k }[/math] [math]\displaystyle{ \begin{bmatrix} \alpha_1 - 1 \\ \vdots \\ \alpha_k - 1 \end{bmatrix} }[/math] [math]\displaystyle{ \begin{bmatrix} \eta_1 + 1 \\ \vdots \\ \eta_k + 1 \end{bmatrix} }[/math] [math]\displaystyle{ 1 }[/math] [math]\displaystyle{ \begin{bmatrix} \log x_1 \\ \vdots \\ \log x_k \end{bmatrix} }[/math] [math]\displaystyle{ \sum_{i=1}^k \log \Gamma(\eta_i + 1) - \log \Gamma\left(\sum_{i=1}^k (\eta_i + 1) \right) }[/math] [math]\displaystyle{ \sum_{i=1}^k \log \Gamma(\alpha_i) - \log \Gamma\left(\sum_{i=1}^k\alpha_i\right) }[/math]
Wishart distribution [math]\displaystyle{ \mathbf V,\ n }[/math] [math]\displaystyle{ \begin{bmatrix} -\frac12\mathbf{V}^{-1} \\[5pt] \dfrac{n-p-1}{2} \end{bmatrix} }[/math] [math]\displaystyle{ \begin{bmatrix} -\frac12{\boldsymbol\eta_1}^{-1} \\[5pt] 2\eta_2+p+1 \end{bmatrix} }[/math] [math]\displaystyle{ 1 }[/math] [math]\displaystyle{ \begin{bmatrix} \mathbf{X} \\ \log|\mathbf{X}| \end{bmatrix} }[/math] [math]\displaystyle{ -\left(\eta_2+\frac{p+1}{2}\right)\log|-\boldsymbol\eta_1| }[/math]

      [math]\displaystyle{ + \log\Gamma_p\left(\eta_2+\frac{p+1}{2}\right) = }[/math]
[math]\displaystyle{ -\frac{n}{2}\log|-\boldsymbol\eta_1| + \log\Gamma_p\left(\frac{n}{2}\right) = }[/math]
[math]\displaystyle{ \left(\eta_2+\frac{p+1}{2}\right)(p\log 2 + \log|\mathbf{V}|) }[/math]
      [math]\displaystyle{ + \log\Gamma_p\left(\eta_2+\frac{p+1}{2}\right) }[/math]

  • Three variants with different parameterizations are given, to facilitate computing moments of the sufficient statistics.
[math]\displaystyle{ \frac{n}{2}(p\log 2 + \log|\mathbf{V}|) + \log\Gamma_p\left(\frac{n}{2}\right) }[/math]
Note: Uses the fact that [math]\displaystyle{ {\rm tr}(\mathbf{A}^{\mathsf T}\mathbf{B}) = \operatorname{vec}(\mathbf{A}) \cdot \operatorname{vec}(\mathbf{B}), }[/math] i.e. the trace of a matrix product is much like a dot product. The matrix parameters are assumed to be vectorized (laid out in a vector) when inserted into the exponential form. Also, [math]\displaystyle{ \mathbf{V} }[/math] and [math]\displaystyle{ \mathbf{X} }[/math] are symmetric, so e.g. [math]\displaystyle{ \mathbf{V}^{\mathsf T} = \mathbf{V}\ . }[/math]
inverse Wishart distribution [math]\displaystyle{ \mathbf \Psi,\,m }[/math] [math]\displaystyle{ \begin{bmatrix} -\frac12\boldsymbol\Psi \\[5pt] -\dfrac{m+p+1}{2} \end{bmatrix} }[/math] [math]\displaystyle{ \begin{bmatrix} -2\boldsymbol\eta_1 \\[5pt] -(2\eta_2+p+1) \end{bmatrix} }[/math] [math]\displaystyle{ 1 }[/math] [math]\displaystyle{ \begin{bmatrix} \mathbf{X}^{-1} \\ \log|\mathbf{X}| \end{bmatrix} }[/math] [math]\displaystyle{ \left(\eta_2 + \frac{p + 1}{2}\right)\log|-\boldsymbol\eta_1| }[/math]

      [math]\displaystyle{ + \log\Gamma_p\left(-\Big(\eta_2 + \frac{p + 1}{2}\Big)\right) = }[/math]
[math]\displaystyle{ -\frac{m}{2}\log|-\boldsymbol\eta_1| + \log\Gamma_p\left(\frac{m}{2}\right) = }[/math]
[math]\displaystyle{ -\left(\eta_2 + \frac{p + 1}{2}\right)(p\log 2 - \log|\boldsymbol\Psi|) }[/math]
      [math]\displaystyle{ + \log\Gamma_p\left(-\Big(\eta_2 + \frac{p + 1}{2}\Big)\right) }[/math]

[math]\displaystyle{ \frac{m}{2}(p\log 2 - \log|\boldsymbol\Psi|) + \log\Gamma_p\left(\frac{m}{2}\right) }[/math]
normal-gamma distribution [math]\displaystyle{ \alpha,\ \beta,\ \mu,\ \lambda }[/math] [math]\displaystyle{ \begin{bmatrix} \alpha-\frac12 \\ -\beta-\dfrac{\lambda\mu^2}{2} \\ \lambda\mu \\ -\dfrac{\lambda}{2}\end{bmatrix} }[/math] [math]\displaystyle{ \begin{bmatrix} \eta_1+\frac12 \\ -\eta_2 + \dfrac{\eta_3^2}{4\eta_4} \\ -\dfrac{\eta_3}{2\eta_4} \\ -2\eta_4 \end{bmatrix} }[/math] [math]\displaystyle{ \dfrac{1}{\sqrt{2\pi}} }[/math] [math]\displaystyle{ \begin{bmatrix} \log \tau \\ \tau \\ \tau x \\ \tau x^2 \end{bmatrix} }[/math] [math]\displaystyle{ \log \Gamma\left(\eta_1+\frac12\right) - \frac12\log\left(-2\eta_4\right) }[/math]

      [math]\displaystyle{ - \left(\eta_1+\frac12\right)\log\left(-\eta_2 + \dfrac{\eta_3^2}{4\eta_4}\right) }[/math]

[math]\displaystyle{ \log \Gamma\left(\alpha\right)-\alpha\log\beta-\frac12\log\lambda }[/math]
* The Iverson bracket is a generalization of the discrete delta-function: If the bracketed expression is true, the bracket has value 1; if the enclosed statement is false, the Iverson bracket is zero. There are many variant notations, e.g. wavey brackets: a=b is equivalent to the [a=b] notation used above.

The three variants of the categorical distribution and multinomial distribution are due to the fact that the parameters [math]\displaystyle{ p_i }[/math] are constrained, such that

[math]\displaystyle{ \sum_{i=1}^k p_i = 1~. }[/math]

Thus, there are only [math]\displaystyle{ k-1 }[/math] independent parameters.

  • Variant 1 uses [math]\displaystyle{ k }[/math] natural parameters with a simple relation between the standard and natural parameters; however, only [math]\displaystyle{ k-1 }[/math] of the natural parameters are independent, and the set of [math]\displaystyle{ k }[/math] natural parameters is nonidentifiable. The constraint on the usual parameters translates to a similar constraint on the natural parameters.
  • Variant 2 demonstrates the fact that the entire set of natural parameters is nonidentifiable: Adding any constant value to the natural parameters has no effect on the resulting distribution. However, by using the constraint on the natural parameters, the formula for the normal parameters in terms of the natural parameters can be written in a way that is independent on the constant that is added.
  • Variant 3 shows how to make the parameters identifiable in a convenient way by setting [math]\displaystyle{ C = -\log p_k\ . }[/math] This effectively "pivots" around [math]\displaystyle{ p_k }[/math] and causes the last natural parameter to have the constant value of 0. All the remaining formulas are written in a way that does not access [math]\displaystyle{ p_k\ }[/math], so that effectively the model has only [math]\displaystyle{ k-1 }[/math] parameters, both of the usual and natural kind.

Variants 1 and 2 are not actually standard exponential families at all. Rather they are curved exponential families, i.e. there are [math]\displaystyle{ k-1 }[/math] independent parameters embedded in a [math]\displaystyle{ k }[/math]-dimensional parameter space.[13] Many of the standard results for exponential families do not apply to curved exponential families. An example is the log-partition function [math]\displaystyle{ A(x)\ }[/math], which has the value of 0 in the curved cases. In standard exponential families, the derivatives of this function correspond to the moments (more technically, the cumulants) of the sufficient statistics, e.g. the mean and variance. However, a value of 0 suggests that the mean and variance of all the sufficient statistics are uniformly 0, whereas in fact the mean of the [math]\displaystyle{ i }[/math]th sufficient statistic should be [math]\displaystyle{ p_i\ }[/math]. (This does emerge correctly when using the form of [math]\displaystyle{ A(x)\ }[/math] shown in variant 3.)

Moments and cumulants of the sufficient statistic

Normalization of the distribution

We start with the normalization of the probability distribution. In general, any non-negative function f(x) that serves as the kernel of a probability distribution (the part encoding all dependence on x) can be made into a proper distribution by normalizing: i.e.

[math]\displaystyle{ p(x) = \frac{1}{Z} f(x) }[/math]

where

[math]\displaystyle{ Z = \int_x f(x) \,dx. }[/math]

The factor Z is sometimes termed the normalizer or partition function, based on an analogy to statistical physics.

In the case of an exponential family where

[math]\displaystyle{ p(x; \boldsymbol\eta) = g(\boldsymbol\eta) h(x) e^{\boldsymbol\eta \cdot \mathbf{T}(x)}, }[/math]

the kernel is

[math]\displaystyle{ K(x) = h(x) e^{\boldsymbol\eta \cdot \mathbf{T}(x)} }[/math]

and the partition function is

[math]\displaystyle{ Z = \int_x h(x) e^{\boldsymbol\eta \cdot \mathbf{T}(x)} \,dx. }[/math]

Since the distribution must be normalized, we have

[math]\displaystyle{ 1 = \int_x g(\boldsymbol\eta) h(x) e^{\boldsymbol\eta \cdot \mathbf{T}(x)}\, dx = g(\boldsymbol\eta) \int_x h(x) e^{\boldsymbol\eta \cdot \mathbf{T}(x)} \,dx = g(\boldsymbol\eta) Z. }[/math]

In other words,

[math]\displaystyle{ g(\boldsymbol\eta) = \frac{1}{Z} }[/math]

or equivalently

[math]\displaystyle{ A(\boldsymbol\eta) = - \log g(\boldsymbol\eta) = \log Z. }[/math]

This justifies calling A the log-normalizer or log-partition function.

Moment-generating function of the sufficient statistic

Now, the moment-generating function of T(x) is

[math]\displaystyle{ M_T(u) \equiv E[e^{u^\top T(x)}\mid\eta] = \int_x h(x) e^{(\eta+u)^\top T(x)-A(\eta)} \,dx = e^{A(\eta + u)-A(\eta)} }[/math]

proving the earlier statement that

[math]\displaystyle{ K(u\mid\eta) = A(\eta+u) - A(\eta) }[/math]

is the cumulant generating function for T.

An important subclass of exponential families are the natural exponential families, which have a similar form for the moment-generating function for the distribution of x.

Differential identities for cumulants

In particular, using the properties of the cumulant generating function,

[math]\displaystyle{ \operatorname{E}(T_j) = \frac{ \partial A(\eta) }{ \partial \eta_j } }[/math]

and

[math]\displaystyle{ \operatorname{cov}\left (T_i,\ T_j \right) = \frac{ \partial^2 A(\eta) }{ \partial \eta_i \, \partial \eta_j }. }[/math]

The first two raw moments and all mixed second moments can be recovered from these two identities. Higher-order moments and cumulants are obtained by higher derivatives. This technique is often useful when T is a complicated function of the data, whose moments are difficult to calculate by integration.

Another way to see this that does not rely on the theory of cumulants is to begin from the fact that the distribution of an exponential family must be normalized, and differentiate. We illustrate using the simple case of a one-dimensional parameter, but an analogous derivation holds more generally.

In the one-dimensional case, we have

[math]\displaystyle{ p(x) = g(\eta) h(x) e^{\eta T(x)} . }[/math]

This must be normalized, so

[math]\displaystyle{ 1 = \int_x p(x) \,dx = \int_x g(\eta) h(x) e^{\eta T(x)} \,dx = g(\eta) \int_x h(x) e^{\eta T(x)} \,dx . }[/math]

Take the derivative of both sides with respect to η:

[math]\displaystyle{ \begin{align} 0 &= g(\eta) \frac{d}{d\eta} \int_x h(x) e^{\eta T(x)} \,dx + g'(\eta)\int_x h(x) e^{\eta T(x)} \,dx \\ &= g(\eta) \int_x h(x) \left(\frac{d}{d\eta} e^{\eta T(x)}\right) \,dx + g'(\eta)\int_x h(x) e^{\eta T(x)} \,dx \\ &= g(\eta) \int_x h(x) e^{\eta T(x)} T(x) \,dx + g'(\eta)\int_x h(x) e^{\eta T(x)} \,dx \\ &= \int_x T(x) g(\eta) h(x) e^{\eta T(x)} \,dx + \frac{g'(\eta)}{g(\eta)}\int_x g(\eta) h(x) e^{\eta T(x)} \,dx \\ &= \int_x T(x) p(x) \,dx + \frac{g'(\eta)}{g(\eta)}\int_x p(x) \,dx \\ &= \operatorname{E}[T(x)] + \frac{g'(\eta)}{g(\eta)} \\ &= \operatorname{E}[T(x)] + \frac{d}{d\eta} \log g(\eta) \end{align} }[/math]

Therefore,

[math]\displaystyle{ \operatorname{E}[T(x)] = - \frac{d}{d\eta} \log g(\eta) = \frac{d}{d\eta} A(\eta). }[/math]

Example 1

As an introductory example, consider the gamma distribution, whose distribution is defined by

[math]\displaystyle{ p(x) = \frac{\beta^\alpha}{\Gamma(\alpha)} x^{\alpha-1}e^{-\beta x}. }[/math]

Referring to the above table, we can see that the natural parameter is given by

[math]\displaystyle{ \eta_1 = \alpha-1, }[/math]
[math]\displaystyle{ \eta_2 = -\beta, }[/math]

the reverse substitutions are

[math]\displaystyle{ \alpha = \eta_1+1, }[/math]
[math]\displaystyle{ \beta = -\eta_2, }[/math]

the sufficient statistics are [math]\displaystyle{ (\log x, x), }[/math] and the log-partition function is

[math]\displaystyle{ A(\eta_1,\eta_2) = \log \Gamma(\eta_1+1)-(\eta_1+1)\log(-\eta_2). }[/math]

We can find the mean of the sufficient statistics as follows. First, for η1:

[math]\displaystyle{ \begin{align} \operatorname{E}[\log x] &= \frac{ \partial A(\eta_1,\eta_2) }{ \partial \eta_1 } = \frac{ \partial }{ \partial \eta_1 } \left(\log\Gamma(\eta_1+1) - (\eta_1+1) \log(-\eta_2)\right) \\ &= \psi(\eta_1+1) - \log(-\eta_2) \\ &= \psi(\alpha) - \log \beta, \end{align} }[/math]

Where [math]\displaystyle{ \psi(x) }[/math] is the digamma function (derivative of log gamma), and we used the reverse substitutions in the last step.

Now, for η2:

[math]\displaystyle{ \begin{align} \operatorname{E}[x] &= \frac{ \partial A(\eta_1,\eta_2) }{ \partial \eta_2 } = \frac{ \partial }{ \partial \eta_2 } \left(\log \Gamma(\eta_1+1)-(\eta_1+1)\log(-\eta_2)\right) \\ &= -(\eta_1+1)\frac{1}{-\eta_2}(-1) = \frac{\eta_1+1}{-\eta_2} \\ &= \frac{\alpha}{\beta}, \end{align} }[/math]

again making the reverse substitution in the last step.

To compute the variance of x, we just differentiate again:

[math]\displaystyle{ \begin{align} \operatorname{Var}(x) &= \frac{\partial^2 A\left(\eta_1,\eta_2 \right)}{\partial \eta_2^2} = \frac{\partial}{\partial \eta_2} \frac{\eta_1+1}{-\eta_2} \\ &= \frac{\eta_1+1}{\eta_2^2} \\ &= \frac{\alpha}{\beta^2}. \end{align} }[/math]

All of these calculations can be done using integration, making use of various properties of the gamma function, but this requires significantly more work.

Example 2

As another example consider a real valued random variable X with density

[math]\displaystyle{ p_\theta (x) = \frac{ \theta e^{-x} }{\left(1 + e^{-x} \right)^{\theta + 1} } }[/math]

indexed by shape parameter [math]\displaystyle{ \theta \in (0,\infty) }[/math] (this is called the skew-logistic distribution). The density can be rewritten as

[math]\displaystyle{ \frac{ e^{-x} } { 1 + e^{-x} } \exp( -\theta \log\left(1 + e^{-x} ) + \log(\theta)\right) }[/math]

Notice this is an exponential family with natural parameter

[math]\displaystyle{ \eta = -\theta, }[/math]

sufficient statistic

[math]\displaystyle{ T = \log\left (1 + e^{-x} \right), }[/math]

and log-partition function

[math]\displaystyle{ A(\eta) = -\log(\theta) = -\log(-\eta) }[/math]

So using the first identity,

[math]\displaystyle{ \operatorname{E}(\log(1 + e^{-X})) = \operatorname{E}(T) = \frac{ \partial A(\eta) }{ \partial \eta } = \frac{ \partial }{ \partial \eta } [-\log(-\eta)] = \frac{1}{-\eta} = \frac{1}{\theta}, }[/math]

and using the second identity

[math]\displaystyle{ \operatorname{var}(\log\left(1 + e^{-X} \right)) = \frac{ \partial^2 A(\eta) }{ \partial \eta^2 } = \frac{ \partial }{ \partial \eta } \left[\frac{1}{-\eta}\right] = \frac{1}{(-\eta)^2} = \frac{1}{\theta^2}. }[/math]

This example illustrates a case where using this method is very simple, but the direct calculation would be nearly impossible.

Example 3

The final example is one where integration would be extremely difficult. This is the case of the Wishart distribution, which is defined over matrices. Even taking derivatives is a bit tricky, as it involves matrix calculus, but the respective identities are listed in that article.

From the above table, we can see that the natural parameter is given by

[math]\displaystyle{ \boldsymbol\eta_1 = -\frac12\mathbf{V}^{-1}, }[/math]
[math]\displaystyle{ \eta_2 = \frac{n-p-1}{2}, }[/math]

the reverse substitutions are

[math]\displaystyle{ \mathbf{V} = -\frac12{\boldsymbol\eta_1}^{-1}, }[/math]
[math]\displaystyle{ n = 2\eta_2+p+1, }[/math]

and the sufficient statistics are [math]\displaystyle{ (\mathbf{X}, \log|\mathbf{X}|). }[/math]

The log-partition function is written in various forms in the table, to facilitate differentiation and back-substitution. We use the following forms:

[math]\displaystyle{ A(\boldsymbol\eta_1, n) = -\frac{n}{2}\log\left|-\boldsymbol\eta_1\right| + \log\Gamma_p\left(\frac{n}{2}\right), }[/math]
[math]\displaystyle{ A(\mathbf{V},\eta_2) = \left(\eta_2+\frac{p+1}{2}\right)(p\log 2 + \log|\mathbf{V}|) + \log\Gamma_p\left(\eta_2+\frac{p+1}{2}\right). }[/math]
Expectation of X (associated with η1)

To differentiate with respect to η1, we need the following matrix calculus identity:

[math]\displaystyle{ \frac{\partial \log |a\mathbf{X}|}{\partial \mathbf{X}} =(\mathbf{X}^{-1})^{\rm T} }[/math]

Then:

[math]\displaystyle{ \begin{align} \operatorname{E}[\mathbf{X}] &= \frac{ \partial A\left(\boldsymbol\eta_1,\ldots \right) }{ \partial \boldsymbol\eta_1 } \\ &= \frac{ \partial }{ \partial \boldsymbol\eta_1 } \left[-\frac{n}{2}\log|-\boldsymbol\eta_1| + \log\Gamma_p\left(\frac{n}{2}\right) \right] \\ &= -\frac{n}{2}(\boldsymbol\eta_1^{-1})^{\rm T} \\ &= \frac{n}{2}(-\boldsymbol\eta_1^{-1})^{\rm T} \\ &= n(\mathbf{V})^{\rm T} \\ &= n\mathbf{V} \end{align} }[/math]

The last line uses the fact that V is symmetric, and therefore it is the same when transposed.

Expectation of log |X| (associated with η2)

Now, for η2, we first need to expand the part of the log-partition function that involves the multivariate gamma function:

[math]\displaystyle{ \log \Gamma_p(a)= \log \left(\pi^{\frac{p(p-1)}{4}}\prod_{j=1}^p \Gamma\left(a+\frac{1-j}{2}\right)\right) = \frac{p(p-1)}{4} \log \pi + \sum_{j=1}^p \log \Gamma\left[ a+\frac{1-j}{2}\right] }[/math]

We also need the digamma function:

[math]\displaystyle{ \psi(x) = \frac{d}{dx} \log \Gamma(x). }[/math]

Then:

[math]\displaystyle{ \begin{align} \operatorname{E}[\log |\mathbf{X}|] &= \frac{\partial A\left (\ldots,\eta_2 \right)}{\partial \eta_2} \\ &= \frac{\partial}{\partial \eta_2} \left[-\left(\eta_2+\frac{p+1}{2}\right)(p\log 2 + \log|\mathbf{V}|) + \log\Gamma_p\left(\eta_2+\frac{p+1}{2}\right) \right] \\ &= \frac{\partial}{\partial \eta_2} \left[ \left(\eta_2+\frac{p+1}{2}\right)(p\log 2 + \log|\mathbf{V}|) + \frac{p(p-1)}{4} \log \pi + \sum_{j=1}^p \log \Gamma\left(\eta_2+\frac{p+1}{2}+\frac{1-j}{2}\right) \right] \\ &= p\log 2 + \log|\mathbf{V}| + \sum_{j=1}^p \psi\left(\eta_2+\frac{p+1}{2}+\frac{1-j}{2}\right) \\ &= p\log 2 + \log|\mathbf{V}| + \sum_{j=1}^p \psi\left(\frac{n-p-1}{2}+\frac{p+1}{2}+\frac{1-j}{2}\right) \\ &= p\log 2 + \log|\mathbf{V}| + \sum_{j=1}^p \psi\left(\frac{n+1-j}{2}\right) \end{align} }[/math]

This latter formula is listed in the Wishart distribution article. Both of these expectations are needed when deriving the variational Bayes update equations in a Bayes network involving a Wishart distribution (which is the conjugate prior of the multivariate normal distribution).

Computing these formulas using integration would be much more difficult. The first one, for example, would require matrix integration.

Entropy

Relative entropy

The relative entropy (Kullback–Leibler divergence, KL divergence) of two distributions in an exponential family has a simple expression as the Bregman divergence between the natural parameters with respect to the log-normalizer.[14] The relative entropy is defined in terms of an integral, while the Bregman divergence is defined in terms of a derivative and inner product, and thus is easier to calculate and has a closed-form expression (assuming the derivative has a closed-form expression). Further, the Bregman divergence in terms of the natural parameters and the log-normalizer equals the Bregman divergence of the dual parameters (expectation parameters), in the opposite order, for the convex conjugate function.[15]

Fixing an exponential family with log-normalizer [math]\displaystyle{ A }[/math] (with convex conjugate [math]\displaystyle{ A^* }[/math]), writing [math]\displaystyle{ P_{A,\theta} }[/math] for the distribution in this family corresponding a fixed value of the natural parameter [math]\displaystyle{ \theta }[/math] (writing [math]\displaystyle{ \theta' }[/math] for another value, and with [math]\displaystyle{ \eta, \eta' }[/math] for the corresponding dual expectation/moment parameters), writing KL for the KL divergence, and [math]\displaystyle{ B_A }[/math] for the Bregman divergence, the divergences are related as:

[math]\displaystyle{ \rm{KL}(P_{A,\theta} \parallel P_{A,\theta'}) = B_A(\theta' \parallel \theta) = B_{A^*}(\eta \parallel \eta'). }[/math]

The KL divergence is conventionally written with respect to the first parameter, while the Bregman divergence is conventionally written with respect to the second parameter, and thus this can be read as "the relative entropy is equal to the Bregman divergence defined by the log-normalizer on the swapped natural parameters", or equivalently as "equal to the Bregman divergence defined by the dual to the log-normalizer on the expectation parameters".

Maximum-entropy derivation

Exponential families arise naturally as the answer to the following question: what is the maximum-entropy distribution consistent with given constraints on expected values?

The information entropy of a probability distribution dF(x) can only be computed with respect to some other probability distribution (or, more generally, a positive measure), and both measures must be mutually absolutely continuous. Accordingly, we need to pick a reference measure dH(x) with the same support as dF(x).

The entropy of dF(x) relative to dH(x) is

[math]\displaystyle{ S[dF\mid dH]=-\int \frac{dF}{dH}\log\frac{dF}{dH}\,dH }[/math]

or

[math]\displaystyle{ S[dF\mid dH]=\int\log\frac{dH}{dF}\,dF }[/math]

where dF/dH and dH/dF are Radon–Nikodym derivatives. The ordinary definition of entropy for a discrete distribution supported on a set I, namely

[math]\displaystyle{ S=-\sum_{i\in I} p_i\log p_i }[/math]

assumes, though this is seldom pointed out, that dH is chosen to be the counting measure on I.

Consider now a collection of observable quantities (random variables) Ti. The probability distribution dF whose entropy with respect to dH is greatest, subject to the conditions that the expected value of Ti be equal to ti, is an exponential family with dH as reference measure and (T1, ..., Tn) as sufficient statistic.

The derivation is a simple variational calculation using Lagrange multipliers. Normalization is imposed by letting T0 = 1 be one of the constraints. The natural parameters of the distribution are the Lagrange multipliers, and the normalization factor is the Lagrange multiplier associated to T0.

For examples of such derivations, see Maximum entropy probability distribution.

Role in statistics

Classical estimation: sufficiency

According to the Pitman–KoopmanDarmois theorem, among families of probability distributions whose domain does not vary with the parameter being estimated, only in exponential families is there a sufficient statistic whose dimension remains bounded as sample size increases.

Less tersely, suppose Xk, (where k = 1, 2, 3, ... n) are independent, identically distributed random variables. Only if their distribution is one of the exponential family of distributions is there a sufficient statistic T(X1, ..., Xn) whose number of scalar components does not increase as the sample size n increases; the statistic T may be a vector or a single scalar number, but whatever it is, its size will neither grow nor shrink when more data are obtained.

As a counterexample if these conditions are relaxed, the family of uniform distributions (either discrete or continuous, with either or both bounds unknown) has a sufficient statistic, namely the sample maximum, sample minimum, and sample size, but does not form an exponential family, as the domain varies with the parameters.

Bayesian estimation: conjugate distributions

Exponential families are also important in Bayesian statistics. In Bayesian statistics a prior distribution is multiplied by a likelihood function and then normalised to produce a posterior distribution. In the case of a likelihood which belongs to an exponential family there exists a conjugate prior, which is often also in an exponential family. A conjugate prior π for the parameter [math]\displaystyle{ \boldsymbol\eta }[/math] of an exponential family

[math]\displaystyle{ f(x\mid\boldsymbol\eta) = h(x) \exp \left ( {\boldsymbol\eta}^{\rm T}\mathbf{T}(x) -A(\boldsymbol\eta)\right ) }[/math]

is given by

[math]\displaystyle{ p_\pi(\boldsymbol\eta\mid\boldsymbol\chi,\nu) = f(\boldsymbol\chi,\nu) \exp \left (\boldsymbol\eta^{\rm T} \boldsymbol\chi - \nu A(\boldsymbol\eta) \right ), }[/math]

or equivalently

[math]\displaystyle{ p_\pi(\boldsymbol\eta\mid\boldsymbol\chi,\nu) = f(\boldsymbol\chi,\nu) g(\boldsymbol\eta)^\nu \exp \left (\boldsymbol\eta^{\rm T} \boldsymbol\chi \right ), \qquad \boldsymbol\chi \in \mathbb{R}^s }[/math]

where s is the dimension of [math]\displaystyle{ \boldsymbol\eta }[/math] and [math]\displaystyle{ \nu \gt 0 }[/math] and [math]\displaystyle{ \boldsymbol\chi }[/math] are hyperparameters (parameters controlling parameters). [math]\displaystyle{ \nu }[/math] corresponds to the effective number of observations that the prior distribution contributes, and [math]\displaystyle{ \boldsymbol\chi }[/math] corresponds to the total amount that these pseudo-observations contribute to the sufficient statistic over all observations and pseudo-observations. [math]\displaystyle{ f(\boldsymbol\chi,\nu) }[/math] is a normalization constant that is automatically determined by the remaining functions and serves to ensure that the given function is a probability density function (i.e. it is normalized). [math]\displaystyle{ A(\boldsymbol\eta) }[/math] and equivalently [math]\displaystyle{ g(\boldsymbol\eta) }[/math] are the same functions as in the definition of the distribution over which π is the conjugate prior.

A conjugate prior is one which, when combined with the likelihood and normalised, produces a posterior distribution which is of the same type as the prior. For example, if one is estimating the success probability of a binomial distribution, then if one chooses to use a beta distribution as one's prior, the posterior is another beta distribution. This makes the computation of the posterior particularly simple. Similarly, if one is estimating the parameter of a Poisson distribution the use of a gamma prior will lead to another gamma posterior. Conjugate priors are often very flexible and can be very convenient. However, if one's belief about the likely value of the theta parameter of a binomial is represented by (say) a bimodal (two-humped) prior distribution, then this cannot be represented by a beta distribution. It can however be represented by using a mixture density as the prior, here a combination of two beta distributions; this is a form of hyperprior.

An arbitrary likelihood will not belong to an exponential family, and thus in general no conjugate prior exists. The posterior will then have to be computed by numerical methods.

To show that the above prior distribution is a conjugate prior, we can derive the posterior.

First, assume that the probability of a single observation follows an exponential family, parameterized using its natural parameter:

[math]\displaystyle{ p_F(x\mid\boldsymbol \eta) = h(x) g(\boldsymbol\eta) \exp\left(\boldsymbol\eta^{\rm T} \mathbf{T}(x)\right) }[/math]

Then, for data [math]\displaystyle{ \mathbf{X} = (x_1,\ldots,x_n) }[/math], the likelihood is computed as follows:

[math]\displaystyle{ p(\mathbf{X}\mid\boldsymbol\eta) =\left(\prod_{i=1}^n h(x_i) \right) g(\boldsymbol\eta)^n \exp\left(\boldsymbol\eta^{\rm T}\sum_{i=1}^n \mathbf{T}(x_i) \right) }[/math]

Then, for the above conjugate prior:

[math]\displaystyle{ \begin{align}p_\pi(\boldsymbol\eta\mid\boldsymbol\chi,\nu) &= f(\boldsymbol\chi,\nu) g(\boldsymbol\eta)^\nu \exp(\boldsymbol\eta^{\rm T} \boldsymbol\chi) \propto g(\boldsymbol\eta)^\nu \exp(\boldsymbol\eta^{\rm T} \boldsymbol\chi)\end{align} }[/math]

We can then compute the posterior as follows:

[math]\displaystyle{ \begin{align} p(\boldsymbol\eta\mid\mathbf{X},\boldsymbol\chi,\nu)& \propto p(\mathbf{X}\mid\boldsymbol\eta) p_\pi(\boldsymbol\eta\mid\boldsymbol\chi,\nu) \\ &= \left(\prod_{i=1}^n h(x_i) \right) g(\boldsymbol\eta)^n \exp\left(\boldsymbol\eta^{\rm T} \sum_{i=1}^n \mathbf{T}(x_i)\right) f(\boldsymbol\chi,\nu) g(\boldsymbol\eta)^\nu \exp(\boldsymbol\eta^{\rm T} \boldsymbol\chi) \\ &\propto g(\boldsymbol\eta)^n \exp\left(\boldsymbol\eta^{\rm T}\sum_{i=1}^n \mathbf{T}(x_i)\right) g(\boldsymbol\eta)^\nu \exp(\boldsymbol\eta^{\rm T} \boldsymbol\chi) \\ &\propto g(\boldsymbol\eta)^{\nu + n} \exp\left(\boldsymbol\eta^{\rm T} \left(\boldsymbol\chi + \sum_{i=1}^n \mathbf{T}(x_i)\right)\right) \end{align} }[/math]

The last line is the kernel of the posterior distribution, i.e.

[math]\displaystyle{ p(\boldsymbol\eta\mid\mathbf{X},\boldsymbol\chi,\nu) = p_\pi\left(\boldsymbol\eta\left|~\boldsymbol\chi + \sum_{i=1}^n \mathbf{T}(x_i), \nu + n \right.\right) }[/math]

This shows that the posterior has the same form as the prior.

The data X enters into this equation only in the expression

[math]\displaystyle{ \mathbf{T}(\mathbf{X}) = \sum_{i=1}^n \mathbf{T}(x_i), }[/math]

which is termed the sufficient statistic of the data. That is, the value of the sufficient statistic is sufficient to completely determine the posterior distribution. The actual data points themselves are not needed, and all sets of data points with the same sufficient statistic will have the same distribution. This is important because the dimension of the sufficient statistic does not grow with the data size — it has only as many components as the components of [math]\displaystyle{ \boldsymbol\eta }[/math] (equivalently, the number of parameters of the distribution of a single data point).

The update equations are as follows:

[math]\displaystyle{ \begin{align} \boldsymbol\chi' &= \boldsymbol\chi + \mathbf{T}(\mathbf{X}) \\ &= \boldsymbol\chi + \sum_{i=1}^n \mathbf{T}(x_i) \\ \nu' &= \nu + n \end{align} }[/math]

This shows that the update equations can be written simply in terms of the number of data points and the sufficient statistic of the data. This can be seen clearly in the various examples of update equations shown in the conjugate prior page. Because of the way that the sufficient statistic is computed, it necessarily involves sums of components of the data (in some cases disguised as products or other forms — a product can be written in terms of a sum of logarithms). The cases where the update equations for particular distributions don't exactly match the above forms are cases where the conjugate prior has been expressed using a different parameterization than the one that produces a conjugate prior of the above form — often specifically because the above form is defined over the natural parameter [math]\displaystyle{ \boldsymbol\eta }[/math] while conjugate priors are usually defined over the actual parameter [math]\displaystyle{ \boldsymbol\theta . }[/math]

Unbiased estimation

If the likelihood [math]\displaystyle{ z|\eta \sim e^{\eta z}f_1(\eta)f_0(z) }[/math] is an exponential family, then the unbiased estimator of [math]\displaystyle{ \eta }[/math] is [math]\displaystyle{ -\frac{d}{dz} \ln f_0(z) }[/math].[16]

Hypothesis testing: uniformly most powerful tests

A one-parameter exponential family has a monotone non-decreasing likelihood ratio in the sufficient statistic T(x), provided that η(θ) is non-decreasing. As a consequence, there exists a uniformly most powerful test for testing the hypothesis H0: θθ0 vs. H1: θ < θ0.

Generalized linear models

Exponential families form the basis for the distribution functions used in generalized linear models (GLM), a class of model that encompasses many of the commonly used regression models in statistics. Examples include logistic regression using the binomial family and Poisson regression.

See also

Footnotes

  1. For example, the family of normal distributions includes the standard normal distribution N(0, 1) with mean 0 and variance 1, as well as other normal distributions with different mean and variance.
  2. "Partition function" is often used in statistics as a synonym of "normalization factor".
  3. These distributions are often not themselves exponential families. Common examples of non-exponential families arising from exponential ones are the Student's t-distribution, beta-binomial distribution and Dirichlet-multinomial distribution.

References

Citations

  1. Kupperman, M. (1958). "Probabilities of hypotheses and information-statistics in sampling from exponential-class populations". Annals of Mathematical Statistics 9 (2): 571–575. doi:10.1214/aoms/1177706633. 
  2. Andersen, Erling (September 1970). "Sufficiency and Exponential Families for Discrete Sample Spaces". Journal of the American Statistical Association (Journal of the American Statistical Association) 65 (331): 1248–1255. doi:10.2307/2284291. 
  3. Pitman, E.; Wishart, J. (1936). "Sufficient statistics and intrinsic accuracy". Mathematical Proceedings of the Cambridge Philosophical Society 32 (4): 567–579. doi:10.1017/S0305004100019307. Bibcode1936PCPS...32..567P. 
  4. Darmois, G. (1935). "Sur les lois de probabilites a estimation exhaustive" (in fr). C. R. Acad. Sci. Paris 200: 1265–1266. 
  5. Koopman, B. (1936). "On distribution admitting a sufficient statistic". Transactions of the American Mathematical Society (American Mathematical Society) 39 (3): 399–409. doi:10.2307/1989758. 
  6. "General Exponential Families". https://www.randomservices.org/random/special/GeneralExponential.html. 
  7. Abramovich; Ritov (2013). Statistical Theory: A concise introduction. Chapman & Hall. ISBN 978-1439851845. 
  8. Blei, David. "Variational Inference". Princeton U.. https://www.cs.princeton.edu/courses/archive/fall11/cos597C/lectures/variational-inference-i.pdf. 
  9. Casella, George (2002). Statistical inference. Roger L. Berger (2nd ed.). Australia: Thomson Learning. Theorem 6.2.25. ISBN 0-534-24312-6. OCLC 46538638. https://www.worldcat.org/oclc/46538638. 
  10. Brown, Lawrence D. (1986). Fundamentals of statistical exponential families : with applications in statistical decision theory. Hayward, Calif.: Institute of Mathematical Statistics. Theorem 2.12. ISBN 0-940600-10-2. OCLC 15986663. https://www.worldcat.org/oclc/15986663. 
  11. Keener, Robert W. (2010). Theoretical statistics : topics for a core course. New York. pp. 47, Example 3.12. ISBN 978-0-387-93839-4. OCLC 676700036. https://www.worldcat.org/oclc/676700036. 
  12. Nielsen, Frank; Garcia, Vincent (2009). "Statistical exponential families: A digest with flash cards". arXiv:0911.4863 [cs.LG].
  13. van Garderen, Kees Jan (1997). "Curved Exponential Models in Econometrics". Econometric Theory 13 (6): 771–790. doi:10.1017/S0266466600006253. 
  14. Nielsen & Nock 2010, 4. Bregman Divergences and Relative Entropy of Exponential Families.
  15. Barndorff-Nielsen 1978, 9.1 Convex duality and exponential families.
  16. Efron, Bradley (December 2011). "Tweedie's Formula and Selection Bias" (in en). Journal of the American Statistical Association 106 (496): 1602–1614. doi:10.1198/jasa.2011.tm11181. ISSN 0162-1459. PMID 22505788. 


Sources

Further reading

  • Fahrmeir, Ludwig; Tutz, G. (1994). Multivariate Statistical Modelling based on Generalized Linear Models. Springer. pp. 18–22, 345–349. ISBN 0-387-94233-5. 
  • Keener, Robert W. (2006). Theoretical Statistics: Topics for a Core Course. Springer. pp. 27–28, 32–33. ISBN 978-0-387-93838-7. 
  • Lehmann, E. L.; Casella, G. (1998). Theory of Point Estimation (2nd ed.). sec. 1.5. ISBN 0-387-98502-6. 

External links