2.1 Maximum-Entropy Models
Suppose we want to construct a probability model that constrains the expectations of all and only functions of the random variable:
For reasons that will become clear, we call these functions the sufficient statistics††margin: sufficient statistics for the distribution. Conceptually, we are not (yet) claiming to know ; only that our model constrains the expected values of the sufficient statistics and nothing else. In other words, we seek the distribution that is consistent with these constraints but otherwise makes the no assumptions about the data; that is, the distribution with maximum entropy††margin: maximum-entropy distribution , subject to the constraints.
To solve this constrained optimization problem, we write out the Lagrangian, including the constraint () that the distribution integrate to unity:
This functional is minimized for functions that obey the Euler-Lagrange equation (see Chapter A), which in this case simply prescribes that the derivative of the integrand with respect to must be zero. If we define and , we can write the constraints all together as (the extra 1 will come in handy). Suppressing -dependence wherever possible for brevity:
Since solving for requires enforcing the normalization constraint, it is perhaps more common to see the maximum-entropy distribution written as:
with the partition function defined so as the make the RHS integrate or sum to unity.
2.1.1 A second relationship between parameterizations
Eq. 2.1 is a perfectly valid and complete description of a maximum-entropy distribution. Indeed, we refer to it as the natural parameterization, and the Lagrange multipliers as the natural parameters††margin: natural parameters . Nevertheless, it is equivalent and sometimes more useful to express the distribution in terms of the constraint values, —what we call the moment parameters††margin: moment parameters —rather than the natural parameters. It seems that to do so we must compute expectations of the sufficient statistics, .
It turns out that we do not. In fact, conveniently, rather than computing integrals (expectations), we can compute derivatives. This is a consequence of a special property of the logarithm of the partition function, :
This shows that the moment parameters can be mapped into the natural parameters by the derivative of the log-partition function. To show that the reverse is also true, i.e. that is invertible, we show that its derivative is positive definite (the multivariate equivalent of monotonically increasing):
Covariance matrices are positive definite, so is invertible, and the log-partition function itself is convex.††margin: What about positive semi-definite covariances?
The log-partition function is useful enough in its own right to deserve a symbol, for which we use . In summary, we have
Example: the normal distribution.
Consider the distribution of data on the real line with fixed mean and variance ; or equivalently, mean and expected square . That is, our two constraints are and . From Eq. 2.1, we have
Notice that , otherwise probability would grow without bound with .
In fact, this equation already tells us that is normally distributed, since the Gaussian is the unique distribution on the real line with a second-order log probability. But we will pretend not to know this. To impose the constraint that the distribution integrate to unity, we complete the square (first line) and apply the formula for a Gaussian integral††margin: Exercise LABEL:ex: :
Now we can proceed in either of two ways. The simplest is to differentiate the log-partition function:
Alternatively, we can apply expectations. The constraint on the first moment implies that
where the first integral vanishes by odd symmetry of (recalling again that ), and the second is another Gaussian integral. This is the same relationship obtained from the derivative of the log-partition function. Application of the constraint on the second moment is left as an exercise.††margin: Exercise LABEL:ex:
To express the distribution in the moment parameterization, we invert the relationship between and :
Inserting these into the natural parameterization yields
Conversion into the standard form of the Gaussian is left as an exercise for the reader.††margin: Exercise LABEL:ex:
Example: the categorical distribution.
Consider the distribution of outcomes of the toss of a -sided die, with fixed mean/probability of each side . We represent an outcome (realization) with a one-hot vector , and the collection of means with the vector . Note that this amounts to , rather than , constraints, because the mean vector must sum to 1: one of the constraints is determined by the others. Still, for mathematical convenience, let us introduce an extra parameter but fix its value to zero: . Then by Eq. 2.1, the maximum-entropy distribution is
The normalizer requires
We again consider both methods for computing the mean constraint. The derivative of the log-partition function is
Alternatively, we compute the expectation:
The problem of inverting the softmax might appear ill-posed, but recall that the last natural parameter is fictitious. In particular,
With this relationship we can reparameterize our maximum-entropy distribution:
This is a standard form for the categorical distribution.
| family | |||||
|---|---|---|---|---|---|
| univariate Gaussian | 1 | ||||
| categorical | 1 | ||||
| exponential | 1 |
Example: the exponential distribution.
Consider the distribution of waiting times on the interval , where events occur at a mean rate of . So . Then Eq. 2.1 tells us that
As usual, we could stop here, since it is well known that the unique distribution defined on the non-negative reals with a first-order log probability is the exponential distribution. We can derive this by applying the constraints. The normalizer requires
Since , . Likewise, the constraint on the mean requires
where the final equality follows because . Hence . Alternatively, differentiating the log-partition function,
yields the same result. The moment parameterization of this distribution is therefore
which is indeed the exponential distribution.
Example: the Poisson distribution.
The distribution of counts for exponentially distributed waiting times is Poisson, so we are licensed to conclude that the maximum-entropy distribution for counts is Poisson. But it would be nice to arrive at this conclusion without such foreknowledge.††margin: FINISH THIS CHAPTER