Maximal Cross Entropy
The maximal cross entropy [YT20a] of a pair of marginals \(p_X, p_Y\) relative to a joint distribution \(q(x, y)\) is the largest cross entropy, relative to \(q\), of any joint distribution with those marginals:
where \(\mathcal{C}(p_X, p_Y)\) is the set of couplings of \(p_X\) and \(p_Y\). It is an optimal transport problem with cost \(\log_2 q(x, y)\) (compare the Earth Mover’s Distance), and it is infinite when some coupling places mass where \(q\) vanishes.
It measures how unlikely, under \(q\), the least likely pairs with the given marginal statistics are. This is what makes exact simulation expensive: when \(X^n\) and \(Y^n\) are generated separately from shared information, every pair of sequences compatible with it gets generated, including the least likely ones, and each must be generated with exactly the right probability. Yu and Tan [YT20a, YT20b] use it to bound the Exact Common Information Rate and the rate of exact Channel Synthesis, and Yu [Yu26] shows that their achievable rates are optimal, so it gives both rates exactly.
For the doubly symmetric binary source, uniform marginals can be coupled so that all of the mass sits on the two unlikely pairs, each of probability \(0.1\), so the maximal cross entropy is \(\log_2 10\), well above the joint entropy:
In [1]: from dit.divergences import maximal_cross_entropy
In [2]: d = dit.Distribution(['00', '01', '10', '11'], [0.4, 0.1, 0.1, 0.4])
In [3]: maximal_cross_entropy(d)
Out[3]: 3.321928094887362
In [4]: dit.shannon.entropy(d)
Out[4]: 1.721928094887362
With \(q\)’s own marginals the maximal cross entropy is always at least the joint entropy of \(q\), exceeding it by at least \(\DKL{q || q_X q_Y} + \DKL{q_X q_Y || q}\), so the two are equal exactly when \(X\) and \(Y\) are independent. Other marginals are taken from the first argument:
In [5]: p = dit.Distribution(['00', '01', '10', '11'], [0.36, 0.24, 0.24, 0.16])
In [6]: maximal_cross_entropy(p, d)
Out[6]: 2.9219280948873623
API
- maximal_cross_entropy(dist1, dist2=None, rvs=None)[source]
The maximal cross entropy [YT20a]: the largest cross entropy, relative to dist2, of any joint distribution whose marginals on the two groups of variables in rvs match those of dist1,
\[\mathbb{H}(p_X, p_Y \| q) = \max_{r \in \mathcal{C}(p_X, p_Y)} -\sum_{x, y} r(x, y) \log_2 q(x, y).\]It is at least the cross entropy of any particular coupling, such as \(p_X p_Y\), and it is infinite when some coupling places mass where \(q\) vanishes, that is, when the product of the supports of \(p_X\) and \(p_Y\) is not contained in the support of \(q\). With dist2 equal to dist1 it is at least the joint entropy, with equality exactly when the two groups are independent.
- Parameters:
dist1 (Distribution) – The distribution whose marginals \(p_X\) and \(p_Y\) are coupled.
dist2 (Distribution, None) – The target distribution \(q\). If None, dist1 is used.
rvs (list, None) – Two lists of indexes, the variables of \(X\) and of \(Y\). If None, the distributions must have exactly two variables.
- Returns:
xh – The maximal cross entropy.
- Return type:
- Raises:
ditException – Raised if rvs does not specify exactly two groups of variables, or if a distribution is symbolic.