For a convex function satisfying , the f-divergence between probability distributions and is
where , , and the integrand uses the lower-semicontinuous perspective convention at .
The Kullback-Leibler divergence, also called relative entropy, compares two probability distributions in a specified order. In , observations follow and the comparison probability distribution is : the first argument supplies the averaging weights. For probability mass functions on a finite alphabet,
Here is a random variable with probability distribution . For probability density functions relative to the same measure , replace the sum by . These formulas use natural logarithms unless stated otherwise. The expected value is under , even though appears in the denominator. [ref]
Take and on two outcomes. Direct calculation gives
The second outcome contributes negatively to the first sum: assigning it more probability than does makes its individual contribution negative. Nevertheless, relative entropy nonnegativity guarantees a nonnegative total. Reversing the arguments changes both the likelihood ratio and the averaging probabilities; taking an absolute value inside the logarithm would define a different quantity.
Figure 1.
Direction changes the averaging weights; a missing outcome can make relative entropy infinite
. Details.
The units depend on the logarithm: natural logarithms give nats, whereas base-two logarithms give bits. Divide a value in nats by to obtain bits; the forward example is approximately bits. Changing the base rescales every Kullback-Leibler divergence by the same positive factor. Since the two calculated directions differ, Kullback-Leibler divergence is asymmetric and cannot be a metric. It also need not satisfy the triangle inequality. [ref]
The operational meaning is an expected penalty for using the wrong probability distribution. A prediction incurs log-loss when outcome occurs, the negative of the logarithmic scoring rule. Under , its expected value is the cross-entropy . Predicting with itself incurs information entropy , so
Thus Kullback-Leibler divergence is exactly excess expected log-loss, whenever these separate quantities are finite. [ref]
For lossless source coding, ideal codeword lengths similarly give excess expected length in bits per symbol. Actual prefix codes require integer codeword lengths; Shannon's source coding theorem explains how long blocks approach ideal per-symbol lengths. The interpretation concerns an average, not a fractional physical bit attached to every outcome. In our example, ideal coding with costs one bit per symbol, while bits; the difference is exactly the computed bits. [ref]
Zeros require explicit conventions. An outcome with contributes zero, including when ; the convention agrees with the relevant limit. If but , the Kullback-Leibler divergence is infinite: the predictor has declared impossible an outcome that can occur. On a finite alphabet, the probability support of must therefore be contained in the probability support of for a finite answer. For example, and give , but . For general probability measures, failure of absolute continuity of measures likewise gives infinity. Even does not guarantee a finite integral. [ref]
To see how confidently wrong predictions are punished, hold the true Bernoulli distribution parameter at and vary the predicted parameter . Its binary relative entropy is
It vanishes at , equals approximately nats at , and equals nats at . Both endpoints give infinity because both outcomes remain possible under . Predicting almost no successes is especially costly because successes actually occur three quarters of the time. The reversed binary relative entropy stays finite at the endpoints: its averaging probability distribution concentrates on just one outcome, and assigns positive probability to both.
Figure 2.
Bernoulli relative entropy with true success probability 0.75 and varying predicted probability
. Details.
For model selection, minimizing expected log-loss ranks candidate statistical models by , since is common to them. The true probability distribution is usually unknown, so one estimates predictive performance using fresh observations or cross-validation. Fitting and assessing on the same data can reward overfitting; a small fitted Kullback-Leibler divergence alone does not establish useful prediction.
In variational inference, a tractable trial probability distribution commonly minimizes against a target posterior distribution . Maximizing the evidence lower bound accomplishes this without evaluating the target's normalization constant. The averaging now follows : placing trial probability where the posterior distribution assigns almost none is strongly penalized. The chosen direction and trial family therefore matter. [ref]
These comparisons do not by themselves establish causal inference. Two statistical models can reproduce the same observed probability distribution while predicting different responses to an intervention. Choosing the smaller Kullback-Leibler divergence therefore needs additional assumptions or experimental evidence before supporting a causal claim. [ref]
The original reference is S. Kullback and R. A. Leibler's 1951 paper [ref], published in The Annals of Mathematical Statistics 22(1), pages 79–86. Its title connects this comparison with sufficient statistics: the historical setting was statistical information, before today's widespread applications in prediction and variational inference.
For a measurable event , applying Jensen inequality to separately on and its complement shows that the Kullback-Leibler divergence between two probability measures is at least the divergence between the two event indicators. This reduces a general probability measure comparison to a binary one and is the key step in a proof of Pinsker's inequality.
For , the second derivative with respect to is . Its value and first derivative at vanish, so . Boundary values follow by continuity or the infinite-divergence convention. Together with the binary partition bound for relative entropy, this gives Pinsker's inequality with the natural-logarithm constant.
For sufficiently regular positive probability densities, this compares their spatial logarithmic derivatives. It is the dissipation functional for relative entropy under suitable diffusion equations. For standard Gaussian , it becomes , and in one dimension equals at unit mass.
The differential estimate gives the displayed exponential bound by an integrating factor. Start at any time with finite information. Combining this with a zero limiting entropy yields .
For probability distributions , relative entropy satisfies , with equality exactly when . Thus truthful prediction uniquely minimizes expected log-loss whenever the comparison is well defined, explaining the strictly proper scoring rule property of the logarithmic scoring rule.
For a short proof with probability density functions and , set . Their integrals both equal one, giving
The strictly convex function is minimized only at , so equality means almost everywhere. Its value at zero is one by . Where , relative entropy is infinite; where both vanish, the contribution is zero. These conventions extend the argument beyond positive reference probability density functions.
For nonnegative densities of possibly different total masses, this divergence includes the mass correction as well as the logarithmic term. It is the Bregman distance of the maximum-entropy regularization functional at a positive reference . Convexity of proves nonnegativity. For equal masses the correction integrates to zero, recovering the Kullback-Leibler divergence; for probability density functions both masses are one. Use the usual extended-value conventions at zero reference density.
For probability mass functions with compatible supports,
When the final term vanishes, this is the Pythagorean identity for relative entropy.
The Pythagorean identity is
whenever the residual term in the three-point identity for relative entropy is zero. Convex information projections replace equality by the corresponding Pythagorean inequality.
The binary relative entropy is the Kullback-Leibler divergence between Bernoulli distributions:
It is the exact exponent obtained by optimizing the Chernoff bound for a Bernoulli mean.
For probability distributions and on the same finite set,
with equality exactly when on the support of .
For independent outcomes with positive probability distribution , allocations summing to one and return multipliers , the strong law of large numbers gives asymptotic logarithmic fortune growth . Gibbs inequality gives , so the unique optimum is . Writing gives . Thus guarantees positive optimal growth, whereas allows the house to force negative growth by choosing , but does not guarantee decline for every choice of .
For probability distributions and on a product space, the Kullback-Leibler divergence decomposes into the divergence of a marginal and the expected divergence of the corresponding conditional distributions. Iteration gives
For nonnegative , with and , the log-sum inequality is
It proves both Gibbs inequality and the data processing inequality for relative entropy.
For a probability mass function of full support on a finite alphabet and a real function ,
where uses natural logarithms. The unique maximizing probability mass function is the exponential tilt .
For univariate normal distributions,
If is a product measure, is any probability measure, and omits coordinate , then
For a random vector ,
This is equivalent to Han's inequality for relative entropy after expansion against a product reference measure.
For a discrete random vector with coordinates, this is the average information entropy per coordinate over all subsets of size . Independent coordinates give the same average for every , even when their individual entropies differ. If all coordinates are copies of one random variable , the average is .
For discrete random variables, normalized subset entropy decreases with subset size. For finite entropies, the chain rule for information entropy and conditioning reduces entropy give . Sum this over all -subsets . Every -subset occurs times, and cancels the normalization factors. This proves . If a marginal entropy is infinite, every one of these subset averages is infinite; otherwise all entropies used in the proof are finite.
The strong form
follows by iterating entropy submodularity.
For a product reference and arbitrary ,
It follows from the chain rule for relative entropy and convexity of relative entropy in its first argument.
For probability mass functions with absolutely continuous with respect to ,
If , independence gives . Since , this proves the displayed identity. The Cauchy-Schwarz inequality also gives . Thus perturbations of size have a uniformly bounded joint total variation distance, a useful input to a metric squared-loss two-point bound.
If and the nonnegative mixture weights sum to one, the likelihood ratio of the mixture model is . Expanding proves the displayed chi-squared divergence identity. For independent random variables sampled from a fixed component, one-observation cross moments multiply across observations. The component is drawn once for the whole sample; redrawing it per observation gives a different mixture model.
For a measurable function , every f-divergence contracts under pushforward:
This follows from conditional Jensen inequality applied to the jointly convex perspective .
This is the data processing inequality for f-divergences specialized to relative entropy. Passing two probability distributions through the same Markov kernel cannot increase their relative entropy. For a kernel ,
The squared Hellinger distance is
where and are densities with respect to any common dominating measure .
The Hellinger distance is the square root of a constant multiple of . Common conventions use either the factor or .
The scalar inequality , applied to and integrated against , gives . The right side is the unnormalized squared Hellinger distance. Infinite divergence and zero density regions are handled by the usual extended-integral conventions.
The Hellinger affinity of dominated probability measures is the integral of the geometric mean of their probability density functions. It lies in by Cauchy-Schwarz inequality. The unnormalized squared Hellinger distance is times this affinity; this identity makes the relation with relative entropy particularly simple.
For the unnormalized Hellinger distance, . Factor and use the Cauchy-Schwarz inequality to bound the total variation distance. For the other bound, gives , whose integral is the squared unnormalized Hellinger distance. Infinite Kullback-Leibler divergence is allowed.
The Hellinger distance convention , with no factor , for densities under a common dominating measure. Its range is . This convention makes hold with the displayed constants.
If is a measurable function into a separable Banach space and has finite second moments under probability measures , then their Bochner integral expected values satisfy
Here the Hellinger distance includes the factor in its square. For a proof, use , , and . Apply the norm bound for a Bochner integral and the Cauchy-Schwarz inequality to , then use . This explains why stability of a Bayesian posterior in Hellinger distance controls posterior expected values when the relevant second moments remain bounded.
With the convention , the Hellinger distance between two normal distributions with is
To prove it, integrate the geometric mean of their probability density functions. Completing the square makes that geometric mean the density of a normal distribution times the displayed prefactor and exponential. For example, writing , that normal distribution has mean and variance . The identity then proves the formula.
For equal unit variances, this becomes . More generally, put and . Then , , and , proving

Articles by others on the same topic (0)

There are currently no matching articles.