F-divergence

In probability theory, an f-divergence is a certain type of function Df(P‖Q) that measures the difference between two probability distributions P and Q. Many common divergences, such as KL-divergence, Hellinger distance, and total variation distance, are special cases of f-divergence.

History

These divergences were introduced by Alfréd Rényi in the same paper where he introduced the well-known Rényi entropy. He proved that these divergences decrease in Markov processes. f-divergences were studied further independently by Csiszár (1963), Morimoto (1963) and Ali & Silvey (1966) and are sometimes known as Csiszár f-divergences, Csiszár–Morimoto divergences, or Ali–Silvey distances.

Definition

Non-singular case

Let P and Q be two probability distributions over a space Ω, such that P≪Q, that is, P is absolutely continuous with respect to Q (meaning Q>0 wherever P>0). Then, for a convex function f:[0,+∞)→(−∞,+∞] such that f(x) is finite for all x>0, f(1)=0, and f(0)=limt→0+f(t) (which could be infinite), the f-divergence of P from Q is defined as

Df(P∥Q)≡∫Ωf(dPdQ)dQ.

We call f the generator of Df.

In concrete applications, there is usually a reference distribution μ on Ω (for example, when Ω=ℝn, the reference distribution is the Lebesgue measure), such that P,Q≪μ, then we can use Radon–Nikodym theorem to take their probability densities p and q, giving

Df(P∥Q)=∫Ωf(p(x)q(x))q(x)dμ(x).

When there is no such reference distribution ready at hand, we can simply define μ=P+Q, and proceed as above. This is a useful technique in more abstract proofs.

Extension to singular measures

The above definition can be extended to cases where P≪Q is no longer satisfied (Definition 7.1 of ).

Since f is convex, and f(1)=0 , the function f(x)x−1 must be nondecreasing, so there exists f′(∞):=limx→∞f(x)/x, taking value in (−∞,+∞].

Since for any p(x)>0, we have limq(x)→0q(x)f(p(x)q(x))=p(x)f′(∞) , we can extend f-divergence to the P≪̸Q.

Properties

Basic relations between f-divergences

  • Linearity: D∑iaifi=∑iaiDfi given a finite sequence of nonnegative real numbers ai and generators fi.
  • Df=Dg iff f(x)=g(x)+c(x−1) for some c∈ℝ.
Proof

If f(x)=g(x)+c(x−1), then Df=Dg by definition.

Conversely, if Df−Dg=0, then let h=f−g. For any two probability measures P,Q on the set {0,1}, since Df(P‖Q)−Dg(P‖Q)=0, we get h(P1/Q1)=−Q0Q1h(P0/Q0)

Since each probability measure P,Q has one degree of freedom, we can solve P0Q0=a,P1Q1=x for every choice of 0<a<1<x.

Linear algebra yields Q0=x−1x−a,Q1=1−ax−a, which is a valid probability measure. Then we obtain h(x)=h(a)a−1(x−1),h(a)=h(x)x−1(a−1).

Thus h(x)={c1(x−1)if x>1,c0(x−1)if 0<x<1, for some constants c0,c1. Plugging the formula into h(x)=h(a)a−1(x−1) yields c0=c1.

Basic properties of f-divergences

  • Non-negativity: the ƒ-divergence is always positive; it is zero if the measures P and Q coincide. This follows immediately from Jensen’s inequality:
    Df(P∥Q)=∫f(dPdQ)dQ≥f(∫dPdQdQ)=f(1)=0.
  • Data-processing inequality: if κ is an arbitrary transition probability that transforms measures P and Q into Pκ and Qκ correspondingly, then
    Df(P∥Q)≥Df(Pκ∥Qκ).
    The equality here holds if and only if the transition is induced from a sufficient statistic with respect to {P, Q}.
  • Joint convexity: for any 0 ≤ λ ≤ 1,
    Df(λP1+(1−λ)P2∥λQ1+(1−λ)Q2)≤λDf(P1∥Q1)+(1−λ)Df(P2∥Q2).
    This follows from the convexity of the mapping (p,q)↦qf(p/q) on ℝ+2.
  • Reversal by convex inversion: for any function f, its convex inversion is defined as g(t):=tf(1/t). When f satisfies the defining features of a f-divergence generator (f(x) is finite for all x>0, f(1)=0, and f(0)=limt→0+f(t)), then g satisfies the same features, and thus defines a f-divergence Dg. This is the "reverse" of Df, in the sense that Dg(P‖Q)=Df(Q‖P) for all P,Q that are absolutely continuous with respect to each other. In this way, every f-divergence Df can be turned symmetric by D12(f+g). For example, performing this symmetrization turns KL-divergence into Jeffreys divergence.

In particular, the monotonicity implies that if a Markov process has a positive equilibrium probability distribution P∗ then Df(P(t)∥P∗) is a monotonic (non-increasing) function of time, where the probability distribution P(t) is a solution of the Kolmogorov forward equations (or Master equation), used to describe the time evolution of the probability distribution in the Markov process. This means that all f-divergences Df(P(t)∥P∗) are the Lyapunov functions of the Kolmogorov forward equations. The converse statement is also true: If H(P) is a Lyapunov function for all Markov chains with positive equilibrium P∗ and is of the trace-form (H(P)=∑if(Pi,Pi∗)) then H(P)=Df(P(t)∥P∗), for some convex function f. For example, Bregman divergences in general do not have such property and can increase in Markov processes.

Analytic properties

The f-divergences can be expressed using Taylor series and rewritten using a weighted sum of chi-type distances (Nielsen & Nock (2013)).

Basic variational representation

Let f∗ be the convex conjugate of f. Let effdom(f∗) be the effective domain of f∗, that is, effdom(f∗)={y:f∗(y)<∞}. Then we have two variational representations of Df, which we describe below.

Under the above setup,

Theorem—Df(P;Q)=supg:Ω→effdom(f∗)EP[g]−EQ[f∗∘g].

This is Theorem 7.24 in.

Example applications

Using this theorem on total variation distance, with generator f(x)=12|x−1|, its convex conjugate is f∗(x∗)={x∗ on [−1/2,1/2],+∞ else., and we obtain TV(P‖Q)=sup|g|≤1/2EP[g(X)]−EQ[g(X)]. For chi-squared divergence, defined by f(x)=(x−1)2,f∗(y)=y2/4+y, we obtain χ2(P;Q)=supgEP[g(X)]−EQ[g(X)2/4+g(X)]. Since the variation term is not affine-invariant in g, even though the domain over which g varies is affine-invariant, we can use up the affine-invariance to obtain a leaner expression.

Replacing g by ag+b and taking the maximum over a,b∈ℝ, we obtain χ2(P;Q)=supg(EP[g(X)]−EQ[g(X)])2VarQ[g(X)], which is just a few steps away from the Hammersley–Chapman–Robbins bound and the Cramér–Rao bound (Theorem 29.1 and its corollary in ).

For α-divergence with α∈(−∞,0)∪(0,1), we have fα(x)=xα−αx−(1−α)α(α−1), with range x∈[0,∞). Its convex conjugate is fα∗(y)=1α(x(y)α−1) with range y∈(−∞,(1−α)−1), where x(y)=((α−1)y+1)1α−1.

Applying this theorem yields, after substitution with h=((α−1)g+1)1α−1, Dα(P‖Q)=1α(1−α)−infh:Ω→(0,∞)(EQ[hαα]+EP[hα−11−α]), or, releasing the constraint on h, Dα(P‖Q)=1α(1−α)−infh:Ω→ℝ(EQ[|h|αα]+EP[|h|α−11−α]). Setting α=−1 yields the variational representation of χ2-divergence obtained above.

The domain over which h varies is not affine-invariant in general, unlike the χ2-divergence case. The χ2-divergence is special, since in that case, we can remove the |⋅| from |h|.

For general α∈(−∞,0)∪(0,1), the domain over which h varies is merely scale invariant. Similar to above, we can replace h by ah, and take minimum over a>0 to obtain Dα(P‖Q)=suph>0[1α(1−α)(1−EP[hα−1]αEQ[hα]α−1)]. Setting α=12, and performing another substitution by g=h, yields two variational representations of the squared Hellinger distance: H2(P‖Q)=12D1/2(P‖Q)=2−infh>0(EQ[h(X)]+EP[h(X)−1]), H2(P‖Q)=2suph>0(1−EP[h−1]EQ[h]). Applying this theorem to the KL-divergence, defined by f(x)=xln⁡x,f∗(y)=ey−1, yields DKL(P;Q)=supgEP[g(X)]−e−1EQ[eg(X)]. This is strictly less efficient than the Donsker–Varadhan representation DKL(P;Q)=supgEP[g(X)]−ln⁡EQ[eg(X)]. This defect is fixed by the next theorem.

Improved variational representation

Assume the setup in the beginning of this section ("Variational representations").

Theorem—If f(x)=+∞ on x<0 (redefine f if necessary), then

Df(P‖Q)=f′(∞)P[Sc]+supg𝔼P[g1S]−ΨQ,P∗(g),

where ΨQ,P∗(g):=infa∈ℝ𝔼Q[f∗(g(X)−a)]+aP[S] and S:={q>0}, where q is the probability density function of Q with respect to some underlying measure.

In the special case of f′(∞)=+∞, we have

Df(P‖Q)=supg𝔼P[g]−ΨQ∗(g),ΨQ∗(g):=infa∈ℝ𝔼Q[f∗(g(X)−a)]+a.

This is Theorem 7.25 in.

Example applications

Applying this theorem to KL-divergence yields the Donsker–Varadhan representation.

Attempting to apply this theorem to the general α-divergence with α∈(−∞,0)∪(0,1) does not yield a closed-form solution.

Common examples of f-divergences

The following table lists many of the common divergences between probability distributions and the possible generating functions to which they correspond. Notably, except for total variation distance, all others are special cases of α-divergence, or linear sums of α-divergences.

For each f-divergence Df, its generating function is not uniquely defined, but only up to c⋅(t−1), where c is any real constant. That is, for any f that generates an f-divergence, we have Df(t)=Df(t)+c⋅(t−1). This freedom is not only convenient, but actually necessary.

Divergence Corresponding f(t) Discrete Form
χα-divergence, α≥1 12|t−1|α 12∑i|pi−qiqi|αqi
Total variation distance (α=1) 12|t−1| 12∑i|pi−qi|
α-divergence {tα−αt−(1−α)α(α−1)if α≠0,α≠1,tln⁡t−t+1,if α=1,−ln⁡t+t−1,if α=0
KL-divergence (α=1) tln⁡t ∑ipiln⁡piqi
reverse KL-divergence (α=0) −ln⁡t ∑iqiln⁡qipi
Jensen–Shannon divergence 12(tln⁡t−(t+1)ln⁡(t+12)) 12∑i(piln⁡pi(pi+qi)/2+qiln⁡qi(pi+qi)/2)
Jeffreys divergence (KL + reverse KL) (t−1)ln⁡(t) ∑i(pi−qi)ln⁡piqi
squared Hellinger distance (α=12) 12(t−1)2,1−t 12∑i(pi−qi)2;1−∑ipiqi
Neyman χ2-divergence (t−1)2 ∑i(pi−qi)2qi
Pearson χ2-divergence (t−1)2t ∑i(pi−qi)2pi
Comparison between the generators of alpha-divergences, as alpha varies from -1 to 2.

Let fα be the generator of α-divergence, then fα and f1−α are convex inversions of each other, so Dα(P‖Q)=D1−α(Q‖P). In particular, this shows that the squared Hellinger distance and Jensen-Shannon divergence are symmetric.

In the literature, the α-divergences are sometimes parametrized as

{41−α2(1−t(1+α)/2),if α≠±1,tln⁡t,if α=1,−ln⁡t,if α=−1

which is equivalent to the parametrization in this page by substituting α←α+12.

Relations to other statistical divergences

Here, we compare f-divergences with other statistical divergences.

Rényi divergence

The Rényi divergences is a family of divergences defined by

Rα(P‖Q)=1α−1log⁡(EQ[(dPdQ)α])

when α∈(0,1)∪(1,+∞). It is extended to the cases of α=0,1,+∞ by taking the limit.

Simple algebra shows that Rα(P‖Q)=1α−1ln⁡(1+α(α−1)Dα(P‖Q)), where Dα is the α-divergence defined above.

Bregman divergence

The only f-divergence that is also a Bregman divergence is the KL divergence.

Integral probability metrics

The only f-divergence that is also an integral probability metric is the total variation.

Financial interpretation

A pair of probability distributions can be viewed as a game of chance in which one of the distributions defines the official odds and the other contains the actual probabilities. Knowledge of the actual probabilities allows a player to profit from the game. For a large class of rational players the expected profit rate has the same general form as the ƒ-divergence.

See also

References

  1. ↑ Rényi, Alfréd (1961). On measures of entropy and information (PDF). The 4th Berkeley Symposium on Mathematics, Statistics and Probability, 1960. Berkeley, CA: University of California Press. pp. 547–561. Eq. (4.20)
  2. 1 2 3 4 Polyanskiy, Yury; Yihong, Wu (2022). Information Theory: From Coding to Learning (draft of October 20, 2022) (PDF). Cambridge University Press. Archived from the original (PDF) on 2023-02-01.
  3. ↑ Gorban, Pavel A. (15 October 2003). "Monotonically equivalent entropies and solution of additivity equation". Physica A. 328 (3–4): 380–390. arXiv:cond-mat/0304131. Bibcode:2003PhyA..328..380G. doi:10.1016/S0378-4371(03)00578-8. S2CID 14975501.
  4. ↑ Amari, Shun'ichi (2009). Leung, C.S.; Lee, M.; Chan, J.H. (eds.). Divergence, Optimization, Geometry. The 16th International Conference on Neural Information Processing (ICONIP 20009), Bangkok, Thailand, 1--5 December 2009. Lecture Notes in Computer Science, vol 5863. Berlin, Heidelberg: Springer. pp. 185–193. doi:10.1007/978-3-642-10677-4_21.
  5. ↑ Gorban, Alexander N. (29 April 2014). "General H-theorem and Entropies that Violate the Second Law". Entropy. 16 (5): 2408–2432. arXiv:1212.6767. Bibcode:2014Entrp..16.2408G. doi:10.3390/e16052408.
  6. ↑ Jiao, Jiantao; Courtade, Thomas; No, Albert; Venkat, Kartik; Weissman, Tsachy (December 2014). "Information Measures: the Curious Case of the Binary Alphabet". IEEE Transactions on Information Theory. 60 (12): 7616–7626. arXiv:1404.6810. Bibcode:2014ITIT...60.7616J. doi:10.1109/TIT.2014.2360184. ISSN 0018-9448. S2CID 13108908.
  7. ↑ Sriperumbudur, Bharath K.; Fukumizu, Kenji; Gretton, Arthur; Schölkopf, Bernhard; Lanckriet, Gert R. G. (2009). "On integral probability metrics, φ-divergences and binary classification". arXiv:0901.2698 [cs.IT].
  8. ↑ Soklakov, Andrei N. (2020). "Economics of Disagreement—Financial Intuition for the Rényi Divergence". Entropy. 22 (8): 860. arXiv:1811.08308. Bibcode:2020Entrp..22..860S. doi:10.3390/e22080860. PMC 7517462. PMID 33286632.