# 相对熵

In mathematical statistics, the Kullback–Leibler divergence (also called relative entropy) is a measure of how one probability distribution is different from a second, reference probability distribution.[1][2] Applications include characterizing the relative (Shannon) entropy in information systems, randomness in continuous time-series, and information gain when comparing statistical models of inference. In contrast to variation of information, it is a distribution-wise asymmetric measure and thus does not qualify as a statistical metric of spread - it also does not satisfy the triangle inequality. In the simple case, a Kullback–Leibler divergence of 0 indicates that the two distributions in question are identical. In simplified terms, it is a measure of surprise, with diverse applications such as applied statistics, fluid mechanics, neuroscience and machine learning.

which is equivalent to

## Introduction and context

Let's consider two distributions of probability $\displaystyle{ P }$ and $\displaystyle{ Q }$. Usually, $\displaystyle{ P }$ represents the data, the observations, or a probability distribution precisely measured. Distribution $\displaystyle{ Q }$ represents instead a theory, a model, a description or an approximation of $\displaystyle{ P }$. The Kullback–Leibler divergence is then interpreted as the average difference of the number of bits required for encoding samples of $\displaystyle{ P }$ using a code optimized for $\displaystyle{ Q }$ rather than one optimized for $\displaystyle{ P }$.

$\displaystyle{ D_\text{KL}(P \parallel Q) = -\sum_{x\in\mathcal{X}} P(x) \log\left(\frac{Q(x)}{P(x)}\right) }$

< math > d _ text { KL }(p 并行 q) =-sum _ { x in mathcal { x } p (x) log left (frac { q (x)}{ p (x)}右) </math >

## Etymology

In other words, it is the expectation of the logarithmic difference between the probabilities $\displaystyle{ P }$ and $\displaystyle{ Q }$, where the expectation is taken using the probabilities $\displaystyle{ P }$. The Kullback–Leibler divergence is defined only if for all $\displaystyle{ x }$, $\displaystyle{ Q(x) = 0 }$ implies $\displaystyle{ P(x) = 0 }$ (absolute continuity). Whenever $\displaystyle{ P(x) }$ is zero the contribution of the corresponding term is interpreted as zero because

The Kullback–Leibler divergence was introduced by Solomon Kullback and Richard Leibler in 1951 as the directed divergence between two distributions; Kullback preferred the term discrimination information.[3] The divergence is discussed in Kullback's 1959 book, Information Theory and Statistics.[2]

More generally, if $\displaystyle{ P }$ and $\displaystyle{ Q }$ are probability measures over a set $\displaystyle{ {\mathcal{X}} }$, and $\displaystyle{ P }$ is absolutely continuous with respect to $\displaystyle{ Q }$, then the Kullback–Leibler divergence from $\displaystyle{ Q }$ to $\displaystyle{ P }$ is defined as

## Definition

For discrete probability distributions $\displaystyle{ P }$ and $\displaystyle{ Q }$ defined on the same probability space, $\displaystyle{ \mathcal{X} }$, the Kullback–Leibler divergence from $\displaystyle{ Q }$ to $\displaystyle{ P }$ is defined[4] to be

$\displaystyle{ D_\text{KL}(P \parallel Q) = \int_{\mathcal{X}} \log\left(\frac{dP}{dQ}\right)\, dP, }$

(p 并行 q) = int _ { mathcal { x } log left (frac { dP }{ dQ } right) ，dP，</math >

$\displaystyle{ D_\text{KL}(P \parallel Q) = \sum_{x\in\mathcal{X}} P(x) \log\left(\frac{P(x)}{Q(x)}\right). }$

where $\displaystyle{ \frac{dP}{dQ} }$ is the Radon–Nikodym derivative of $\displaystyle{ P }$ with respect to $\displaystyle{ Q }$, and provided the expression on the right-hand side exists. Equivalently (by the chain rule), this can be written as

which is equivalent to

$\displaystyle{ D_\text{KL}(P \parallel Q) = \int_{\mathcal{X}} \log\left(\frac{dP}{dQ}\right) \frac{dP}{dQ}\, dQ, }$

(p 并行 q) = int _ { mathcal { x } log left (frac { dP }{ dQ } right) frac { dP }{ dQ } ，dQ，</math >

$\displaystyle{ D_\text{KL}(P \parallel Q) = -\sum_{x\in\mathcal{X}} P(x) \log\left(\frac{Q(x)}{P(x)}\right) }$

which is the entropy of $\displaystyle{ Q }$ relative to $\displaystyle{ P }$. Continuing in this case, if $\displaystyle{ \mu }$ is any measure on $\displaystyle{ \mathcal{X} }$ for which $\displaystyle{ p = \frac{dP}{d\mu} }$ and $\displaystyle{ q = \frac{dQ}{d\mu} }$ exist (meaning that $\displaystyle{ p }$ and $\displaystyle{ q }$ are absolutely continuous with respect to $\displaystyle{ \mu }$), then the Kullback–Leibler divergence from $\displaystyle{ Q }$ to $\displaystyle{ P }$ is given as

In other words, it is the expectation of the logarithmic difference between the probabilities $\displaystyle{ P }$ and $\displaystyle{ Q }$, where the expectation is taken using the probabilities $\displaystyle{ P }$. The Kullback–Leibler divergence is defined only if for all $\displaystyle{ x }$, $\displaystyle{ Q(x) = 0 }$ implies $\displaystyle{ P(x) = 0 }$ (absolute continuity). Whenever $\displaystyle{ P(x) }$ is zero the contribution of the corresponding term is interpreted as zero because

$\displaystyle{ D_\text{KL}(P \parallel Q) = \int_{\mathcal{X}} p \log\left(\frac{p}{q}\right)\, d\mu. }$

(p 并行 q) = int _ { mathcal { x } p log left (frac { p }{ q } right) ，d mu. </math >

$\displaystyle{ \lim_{x \to 0^{+}} x \log(x) = 0. }$

The logarithms in these formulae are taken to base 2 if information is measured in units of bits, or to base $\displaystyle{ e }$ if information is measured in nats. Most formulas involving the Kullback–Leibler divergence hold regardless of the base of the logarithm.

For distributions $\displaystyle{ P }$ and $\displaystyle{ Q }$ of a continuous random variable, the Kullback–Leibler divergence is defined to be the integral:[5]:p. 55

Various conventions exist for referring to $\displaystyle{ D_\text{KL}(P \parallel Q) }$ in words. Often it is referred to as the divergence between $\displaystyle{ P }$ and $\displaystyle{ Q }$, but this fails to convey the fundamental asymmetry in the relation. Sometimes, as in this article, it may be described as the divergence of $\displaystyle{ P }$ from $\displaystyle{ Q }$ or as the divergence from $\displaystyle{ Q }$ to $\displaystyle{ P }$. This reflects the asymmetry in Bayesian inference, which starts from a prior $\displaystyle{ Q }$ and updates to the posterior $\displaystyle{ P }$. Another common way to refer to $\displaystyle{ D_\text{KL}(P \parallel Q) }$ is as the relative entropy of $\displaystyle{ P }$ with respect to $\displaystyle{ Q }$.

$\displaystyle{ D_\text{KL}(P \parallel Q) = \int_{-\infty}^\infty p(x) \log\left(\frac{p(x)}{q(x)}\right)\, dx }$

where $\displaystyle{ p }$ and $\displaystyle{ q }$ denote the probability densities of $\displaystyle{ P }$ and $\displaystyle{ Q }$.

Kullback In applications, $\displaystyle{ P }$ typically represents the "true" distribution of data, observations, or a precisely calculated theoretical distribution, while $\displaystyle{ Q }$ typically represents a theory, model, description, or approximation of $\displaystyle{ P }$. In order to find a distribution $\displaystyle{ Q }$ that is closest to $\displaystyle{ P }$, we can minimize KL divergence and compute an information projection.

More generally, if $\displaystyle{ P }$ and $\displaystyle{ Q }$ are probability measures over a set $\displaystyle{ {\mathcal{X}} }$, and $\displaystyle{ P }$ is absolutely continuous with respect to $\displaystyle{ Q }$, then the Kullback–Leibler divergence from $\displaystyle{ Q }$ to $\displaystyle{ P }$ is defined as

The Kullback–Leibler divergence is a special case of a broader class of statistical divergences called f-divergences as well as the class of Bregman divergences. It is the only such divergence over probabilities that is a member of both classes. Although it is often intuited as a way of measuring the distance between probability distributions, the Kullback–Leibler divergence is not a true metric. It does not obey the Triangle Inequality, and in general $\displaystyle{ D_\text{KL}(P \parallel Q) }$ does not equal $\displaystyle{ D_\text{KL}(Q \parallel P) }$. However, its infinitesimal form, specifically its Hessian, gives a metric tensor known as the Fisher information metric.

Kullback-Leibler 散度是一类更广泛的统计散度的特例，称为 f- 散度和 Bregman 散度。这是唯一的这样的分歧概率，是一个成员的两个类。虽然人们通常凭直觉来判断概率分布之间的距离，但 Kullback 散度并不是一个真正的度量标准。它不服从三角不等式，一般情况下不等于。然而，它的无穷小的形式，特别是它的 Hessian，给出了一个度量张量，称为费雪资讯度量。

$\displaystyle{ D_\text{KL}(P \parallel Q) = \int_{\mathcal{X}} \log\left(\frac{dP}{dQ}\right)\, dP, }$

Arthur Hobson proved that the Kullback–Leibler divergence is the only measure of difference between probability distributions that satisfies some desired properties, which are the canonical extension to those appearing in a commonly used characterization of entropy. Consequently, mutual information is the only measure of mutual dependence that obeys certain related conditions, since it can be defined in terms of Kullback–Leibler divergence.

where $\displaystyle{ \frac{dP}{dQ} }$ is the Radon–Nikodym derivative of $\displaystyle{ P }$ with respect to $\displaystyle{ Q }$, and provided the expression on the right-hand side exists. Equivalently (by the chain rule), this can be written as

$\displaystyle{ D_\text{KL}(P \parallel Q) = \int_{\mathcal{X}} \log\left(\frac{dP}{dQ}\right) \frac{dP}{dQ}\, dQ, }$

Illustration of the Kullback–Leibler (KL) divergence for two normal distributions. The typical asymmetry for the Kullback–Leibler divergence is clearly visible.

which is the entropy of $\displaystyle{ Q }$ relative to $\displaystyle{ P }$. Continuing in this case, if $\displaystyle{ \mu }$ is any measure on $\displaystyle{ \mathcal{X} }$ for which $\displaystyle{ p = \frac{dP}{d\mu} }$ and $\displaystyle{ q = \frac{dQ}{d\mu} }$ exist (meaning that $\displaystyle{ p }$ and $\displaystyle{ q }$ are absolutely continuous with respect to $\displaystyle{ \mu }$), then the Kullback–Leibler divergence from $\displaystyle{ Q }$ to $\displaystyle{ P }$ is given as

In information theory, the Kraft–McMillan theorem establishes that any directly decodable coding scheme for coding a message to identify one value $\displaystyle{ x_i }$ out of a set of possibilities $\displaystyle{ X }$ can be seen as representing an implicit probability distribution $\displaystyle{ q(x_i)=2^{-\ell_i} }$ over $\displaystyle{ X }$, where $\displaystyle{ \ell_i }$ is the length of the code for $\displaystyle{ x_i }$ in bits. Therefore, the Kullback–Leibler divergence can be interpreted as the expected extra message-length per datum that must be communicated if a code that is optimal for a given (wrong) distribution $\displaystyle{ Q }$ is used, compared to using a code based on the true distribution $\displaystyle{ P }$.

$\displaystyle{ D_\text{KL}(P \parallel Q) = \int_{\mathcal{X}} p \log\left(\frac{p}{q}\right)\, d\mu. }$

\displaystyle{ \begin{align} 1.1.1.2.2.2.2.2.2.3.3.3.3.3.3.3.3.3.3.3.3.3.3.3.3.3.3.3.3.3.3.3.3.3.3.3.3.3.3.3.3.3.3.3.3.3.3.3.3.3.3.3.3.3.3.3.3.3.3.3.3.3.3.3.3.3.3.3.3.3.3.3.3.3.3.3.3.3.3.3.3.3.3.3.3 D_\text{KL}(P\parallel Q) &= -\sum_{x\in\mathcal{X}} p(x) \log q(x) + \sum_{x\in\mathcal{X}} p(x) \log p(x) \\ D _ text { KL }(p 并行 q) & =-sum _ { x in mathcal { x } p (x) log q (x) + sum _ { x in mathcal { x } p (x) log p (x)) The logarithms in these formulae are taken to [[Base (exponentiation)|base]] 2 if information is measured in units of [[bit]]s, or to base \lt math\gt e } if information is measured in nats. Most formulas involving the Kullback–Leibler divergence hold regardless of the base of the logarithm.

&= \Eta(P, Q) - \Eta(P)


& = Eta (p，q)-Eta (p)

\end{align}[/itex]

Various conventions exist for referring to $\displaystyle{ D_\text{KL}(P \parallel Q) }$ in words. Often it is referred to as the divergence between $\displaystyle{ P }$ and $\displaystyle{ Q }$, but this fails to convey the fundamental asymmetry in the relation. Sometimes, as in this article, it may be described as the divergence of $\displaystyle{ P }$ from $\displaystyle{ Q }$ or as the divergence from $\displaystyle{ Q }$ to $\displaystyle{ P }$. This reflects the asymmetry in Bayesian inference, which starts from a prior $\displaystyle{ Q }$ and updates to the posterior $\displaystyle{ P }$. Another common way to refer to $\displaystyle{ D_\text{KL}(P \parallel Q) }$ is as the relative entropy of $\displaystyle{ P }$ with respect to $\displaystyle{ Q }$.

where $\displaystyle{ \Eta(P,Q) }$ is the cross entropy of $\displaystyle{ P }$ and $\displaystyle{ Q }$, and $\displaystyle{ \Eta(P) }$ is the entropy of $\displaystyle{ P }$ (which is the same as the cross-entropy of P with itself).

## Basic example

The KL divergence $\displaystyle{ KL(P \parallel Q) }$ can be thought of as something like a measurement of how far the distribution Q is from the distribution P. The cross-entropy $\displaystyle{ H(P,Q) }$ is itself such a measurement, but it has the defect that $\displaystyle{ H(P,P)=:H(P) }$ isn't zero, so we subtract $\displaystyle{ H(P) }$ to make $\displaystyle{ KL(P \parallel Q) }$ agree more closely with our notion of distance. (Unfortunately it still isn't symmetric.)

KL 散度 < math > KL (p 平行 q) </math > 可以被认为是类似于测量分布 q 离分布 p 有多远。交叉熵 h (p，q) </math > 本身就是这样一种度量，但它有一个缺陷，即 h (p，p) = : h (p) </math > 不是零，所以我们用减法 h (p) </math > 使 KL (p 平行 q) </math > 更接近我们的距离概念。(不幸的是，它仍然不对称。)

Kullback[2] gives the following example (Table 2.1, Example 2.1). Let $\displaystyle{ P }$ and $\displaystyle{ Q }$ be the distributions shown in the table and figure. $\displaystyle{ P }$ is the distribution on the left side of the figure, a binomial distribution with $\displaystyle{ N = 2 }$ and $\displaystyle{ p = 0.4 }$. $\displaystyle{ Q }$ is the distribution on the right side of the figure, a discrete uniform distribution with the three possible outcomes $\displaystyle{ x = 0 }$, $\displaystyle{ 1 }$, or $\displaystyle{ 2 }$ (i.e. $\displaystyle{ \mathcal{X}=\{0,1,2\} }$), each with probability $\displaystyle{ p = 1/3 }$.

There is a relation between the Kullback–Leibler divergence and the "rate function" in the theory of large deviations.

$\displaystyle{ D_\text{KL}(P\parallel Q) \geq 0, }$ (p 并行 q) geq 0，</math > \displaystyle{ \begin{align} 1.1.1.2.2.2.2.2.3.3.3.3.3.3.3.3.3.3.3.3.3.3.3.3.3.3.3.3.3.3.3.3.3.3.3.3.3.3.3.3.3.3.3.3.3.3.3.3.3.3.3.3.3.3.3.3.3.3 | Distribution ''Q''(x) || \lt math\gt 1/3 } || $\displaystyle{ 1/3 }$ || $\displaystyle{ 1/3 }$ D_\text{KL}(P \parallel Q) D _ text { KL }(p 并行 q)
x 0 1 2
a result known as Gibbs' inequality, with $\displaystyle{ D_\text{KL}(P\parallel Q) }$ zero if and only if $\displaystyle{ P = Q }$ almost everywhere. The entropy $\displaystyle{ \Eta(P) }$ thus sets a minimum value for the cross-entropy $\displaystyle{ \Eta(P, Q) }$, the expected number of bits required when using a code based on $\displaystyle{ Q }$ rather than $\displaystyle{ P }$; and the Kullback–Leibler divergence therefore represents the expected number of extra bits that must be transmitted to identify a value $\displaystyle{ x }$ drawn from $\displaystyle{ X }$, if a code is used corresponding to the probability distribution $\displaystyle{ Q }$, rather than the "true" distribution $\displaystyle{ P }$.


Distribution P(x) $\displaystyle{ 9/25 }$ $\displaystyle{ 12/25 }$ $\displaystyle{ 4/25 }$
&= \int_{x_a}^{x_b} P(x)\log\left(\frac{P(x)}{Q(x)}\right)\, dx \\[6pt]


& = int _ { x _ a } ^ { x _ b } p (x) log left (frac { p (x)}{ q (x)} right) ，dx [6 pt ]

&= \int_{y_a}^{y_b} P(y)\log\left(\frac{P(y)\, \frac{dy}{dx}}{Q(y)\, \frac{dy}{dx}}\right)\, dy


& = int _ { y _ a } ^ { y _ b } p (y) log left (frac { p (y) ，frac { dy }{ dx }{ q (y) ，frac { dy }{ dx }右) ，dy

The KL divergences $\displaystyle{ D_\text{KL}(P \parallel Q) }$ and $\displaystyle{ D_\text{KL}(Q \parallel P) }$ are calculated as follows. This example uses the natural log with base e, designated $\displaystyle{ \operatorname{ln} }$ to get results in nats (see units of information).

= \int_{y_a}^{y_b} P(y)\log\left(\frac{P(y)}{Q(y)}\right)\, dy


= int _ { y _ a } ^ { y _ b } p (y) log left (frac { p (y)}{ q (y)} right) ，dy

\end{align}[/itex]

\displaystyle{ \begin{align} where \lt math\gt y_a = y(x_a) } and $\displaystyle{ y_b = y(x_b) }$. Although it was assumed that the transformation was continuous, this need not be the case. This also shows that the Kullback–Leibler divergence produces a dimensionally consistent quantity, since if $\displaystyle{ x }$ is a dimensioned variable, $\displaystyle{ P(x) }$ and $\displaystyle{ Q(x) }$ are also dimensioned, since e.g. $\displaystyle{ P(x) dx }$ is dimensionless. The argument of the logarithmic term is and remains dimensionless, as it must. It can therefore be seen as in some ways a more fundamental quantity than some other properties in information theory (such as self-information or Shannon entropy), which can become undefined or negative for non-discrete probabilities.

D_\text{KL}(P \parallel Q) &= \sum_{x\in\mathcal{X}} P(x) \ln\left(\frac{P(x)}{Q(x)}\right) \\

&= \frac{9}{25} \ln\left(\frac{9/25}{1/3}\right)


+ \frac{12}{25} \ln\left(\frac{12/25}{1/3}\right)

$\displaystyle{ D_\text{KL}(P \parallel Q) = D_\text{KL}(P_1 \parallel Q_1) + D_\text{KL}(P_2 \parallel Q_2). }$

(p 并行 q) = d _ text { KL }(p _ 1并行 q _ 1) + d _ text { KL }(p _ 2并行 q _ 2) . </math >

+ \frac{4}{25} \ln\left(\frac{4/25}{1/3}\right) \\

& = \frac{1}{25} \left(32 \ln(2) + 55 \ln(3) - 50 \ln(5) \right) \approx 0.0852996

\end{align}[/itex]

\lambda D_\text{KL}(p_1 \parallel q_1) + (1 - \lambda)D_\text{KL}(p_2 \parallel q_2) \text{ for } 0 \le \lambda \le 1.[/itex]

\displaystyle{ \begin{align} D_\text{KL}(Q \parallel P) &= \sum_{x\in\mathcal{X}} Q(x) \ln\left(\frac{Q(x)}{P(x)}\right) \\ &= \frac{1}{3} \ln\left(\frac{1/3}{9/25}\right) + \frac{1}{3} \ln\left(\frac{1/3}{12/25}\right) + \frac{1}{3} \ln\left(\frac{1/3}{4/25}\right) \\ Suppose that we have two multivariate normal distributions, with means \lt math\gt \mu_0, \mu_1 } and with (non-singular) covariance matrices $\displaystyle{ \Sigma_0, \Sigma_1. }$ If the two distributions have the same dimension, $\displaystyle{ k }$, then the Kullback–Leibler divergence between the distributions is as follows:

&= \frac{1}{3} \left(-4 \ln(2) - 6 \ln(3) + 6 \ln(5) \right) \approx 0.097455


\end{align}[/itex]

$\displaystyle{ 《数学》 D_\text{KL}\left(\mathcal{N}_0 \parallel \mathcal{N}_1\right) = 左(数学{ n } _ 0并行数学{ n } _ 1右) = ==Interpretations== \frac{1}{2}\left( 1}{2} left ( \operatorname{tr}\left(\Sigma_1^{-1}\Sigma_0\right) + 操作符名称{ tr }左(Sigma _ 1 ^ {-1} Sigma _ 0右) + The Kullback–Leibler divergence from \lt math\gt Q }$ to $\displaystyle{ P }$ is often denoted $\displaystyle{ D_\text{KL}(P \parallel Q) }$.

   \left(\mu_1 - \mu_0\right)^\mathsf{T} \Sigma_1^{-1}\left(\mu_1 - \mu_0\right) - k +


   \ln\left(\frac{\det\Sigma_1}{\det\Sigma_0}\right)


In the context of machine learning, $\displaystyle{ D_\text{KL}(P \parallel Q) }$ is often called the information gain achieved if $\displaystyle{ Q }$ is used instead of $\displaystyle{ P }$. By analogy with information theory, it is also called the relative entropy of $\displaystyle{ P }$ with respect to $\displaystyle{ Q }$. In the context of coding theory, $\displaystyle{ D_\text{KL}(P \parallel Q) }$ can be constructed by measuring the expected number of extra bits required to code samples from $\displaystyle{ P }$ using a code optimized for $\displaystyle{ Q }$ rather than the code optimized for $\displaystyle{ P }$.

 \right).


[/itex]

Expressed in the language of Bayesian inference, $\displaystyle{ D_\text{KL}(P \parallel Q) }$ is a measure of the information gained by revising one's beliefs from the prior probability distribution $\displaystyle{ Q }$ to the posterior probability distribution $\displaystyle{ P }$. In other words, it is the amount of information lost when $\displaystyle{ Q }$ is used to approximate $\displaystyle{ P }$.[6] In applications, $\displaystyle{ P }$ typically represents the "true" distribution of data, observations, or a precisely calculated theoretical distribution, while $\displaystyle{ Q }$ typically represents a theory, model, description, or approximation of $\displaystyle{ P }$. In order to find a distribution $\displaystyle{ Q }$ that is closest to $\displaystyle{ P }$, we can minimize KL divergence and compute an information projection.

The logarithm in the last term must be taken to base e since all terms apart from the last are base-e logarithms of expressions that are either factors of the density function or otherwise arise naturally. The equation therefore gives a result measured in nats. Dividing the entire expression above by $\displaystyle{ \ln(2) }$ yields the divergence in bits.

The Kullback–Leibler divergence is a special case of a broader class of statistical divergences called f-divergences as well as the class of Bregman divergences. It is the only such divergence over probabilities that is a member of both classes. Although it is often intuited as a way of measuring the distance between probability distributions, the Kullback–Leibler divergence is not a true metric. It does not obey the Triangle Inequality, and in general $\displaystyle{ D_\text{KL}(P \parallel Q) }$ does not equal $\displaystyle{ D_\text{KL}(Q \parallel P) }$. However, its infinitesimal form, specifically its Hessian, gives a metric tensor known as the Fisher information metric.

A special case, and a common quantity in variational inference, is the KL-divergence between a diagonal multivariate normal, and a standard normal distribution (with zero mean and unit variance):

Arthur Hobson proved that the Kullback–Leibler divergence is the only measure of difference between probability distributions that satisfies some desired properties, which are the canonical extension to those appearing in a commonly used characterization of entropy.[7] Consequently, mutual information is the only measure of mutual dependence that obeys certain related conditions, since it can be defined in terms of Kullback–Leibler divergence.

$\displaystyle{ 《数学》 ==Motivation== D_\text{KL}\left( 文本{ KL }左( \mathcal{N}\left(\left(\mu_1, \ldots, \mu_k\right)^\mathsf{T}, \operatorname{diag} \left(\sigma_1^2, \ldots, \sigma_k^2\right)\right) \parallel 数学{ n }左(左(mu _ 1，ldots，mu _ k 右) ^ sf { t } ，运算符名称{ diag }左(sigma _ 1 ^ 2，ldots，sigma _ k ^ 2右)平行 [[File:KL-Gauss-Example.png|thumb|right|320px|Illustration of the Kullback–Leibler (KL) divergence for two [[normal distribution]]s. The typical asymmetry for the Kullback–Leibler divergence is clearly visible.]] \mathcal{N}\left(\mathbf{0}, \mathbf{I}\right) 数学{ n }左(mathbf {0} ，mathbf { i }右) \right) = 右) = In information theory, the [[Kraft–McMillan inequality|Kraft–McMillan theorem]] establishes that any directly decodable coding scheme for coding a message to identify one value \lt math\gt x_i }$ out of a set of possibilities $\displaystyle{ X }$ can be seen as representing an implicit probability distribution $\displaystyle{ q(x_i)=2^{-\ell_i} }$ over $\displaystyle{ X }$, where $\displaystyle{ \ell_i }$ is the length of the code for $\displaystyle{ x_i }$ in bits. Therefore, the Kullback–Leibler divergence can be interpreted as the expected extra message-length per datum that must be communicated if a code that is optimal for a given (wrong) distribution $\displaystyle{ Q }$ is used, compared to using a code based on the true distribution $\displaystyle{ P }$.

 {1 \over 2} \sum_{i=1}^k \left(\sigma_i^2 + \mu_i^2 - 1 - \ln\left(\sigma_i^2\right)\right).


{1/2} sum _ { i = 1} ^ k left (sigma _ i ^ 2 + mu _ i ^ 2-1-ln left (sigma _ i ^ 2 right)).

[/itex]

\displaystyle{ \begin{align} D_\text{KL}(P\parallel Q) &= -\sum_{x\in\mathcal{X}} p(x) \log q(x) + \sum_{x\in\mathcal{X}} p(x) \log p(x) \\ &= \Eta(P, Q) - \Eta(P) \end{align} }

One might be tempted to call the Kullback–Leibler divergence a "distance metric" on the space of probability distributions, but this would not be correct as it is not symmetric – that is, $\displaystyle{ D_\text{KL}(P\parallel Q) \neq D_\text{KL}(Q\parallel P) }$ – nor does it satisfy the triangle inequality. Even so, being a premetric, it generates a topology on the space of probability distributions. More concretely, if $\displaystyle{ \{P_1,P_2,\ldots\} }$ is a sequence of distributions such that

where $\displaystyle{ \Eta(P,Q) }$ is the cross entropy of $\displaystyle{ P }$ and $\displaystyle{ Q }$, and $\displaystyle{ \Eta(P) }$ is the entropy of $\displaystyle{ P }$ (which is the same as the cross-entropy of P with itself).

$\displaystyle{ \lim_{n \to \infty} D_\text{KL}(P_n\parallel Q) = 0 }$


< math > lim { n to infty } d text { KL }(p _ n parallel q) = 0 </math >

The KL divergence $\displaystyle{ KL(P \parallel Q) }$ can be thought of as something like a measurement of how far the distribution Q is from the distribution P. The cross-entropy $\displaystyle{ H(P,Q) }$ is itself such a measurement, but it has the defect that $\displaystyle{ H(P,P)=:H(P) }$ isn't zero, so we subtract $\displaystyle{ H(P) }$ to make $\displaystyle{ KL(P \parallel Q) }$ agree more closely with our notion of distance. (Unfortunately it still isn't symmetric.)

then it is said that

There is a relation between the Kullback–Leibler divergence and the "rate function" in the theory of large deviations.[8][9]

## Properties

$\displaystyle{ P_n \xrightarrow{D} Q . }$


[数学][数学][数学]

Pinsker's inequality entails that

$\displaystyle{ D_\text{KL}(P\parallel Q) \geq 0, }$
a result known as Gibbs' inequality, with $\displaystyle{ D_\text{KL}(P\parallel Q) }$ zero if and only if $\displaystyle{ P = Q }$ almost everywhere. The entropy $\displaystyle{ \Eta(P) }$ thus sets a minimum value for the cross-entropy $\displaystyle{ \Eta(P, Q) }$, the expected number of bits required when using a code based on $\displaystyle{ Q }$ rather than $\displaystyle{ P }$; and the Kullback–Leibler divergence therefore represents the expected number of extra bits that must be transmitted to identify a value $\displaystyle{ x }$ drawn from $\displaystyle{ X }$, if a code is used corresponding to the probability distribution $\displaystyle{ Q }$, rather than the "true" distribution $\displaystyle{ P }$.
$\displaystyle{ P_n \xrightarrow{D} P \Rightarrow P_n \xrightarrow{TV} P, }$


[数学] ，[数学]

• The Kullback–Leibler divergence remains well-defined for continuous distributions, and furthermore is invariant under parameter transformations. For example, if a transformation is made from variable $\displaystyle{ x }$ to variable $\displaystyle{ y(x) }$, then, since $\displaystyle{ P(x) dx = P(y) dy }$ and $\displaystyle{ Q(x) dx = Q(y) dy }$ the Kullback–Leibler divergence may be rewritten:

where the latter stands for the usual convergence in total variation.

\displaystyle{ \begin{align} D_\text{KL}(P \parallel Q) &= \int_{x_a}^{x_b} P(x)\log\left(\frac{P(x)}{Q(x)}\right)\, dx \\[6pt] The Kullback–Leibler divergence is directly related to the Fisher information metric. This can be made explicit as follows. Assume that the probability distributions \lt math\gt P } and $\displaystyle{ Q }$ are both parameterized by some (possibly multi-dimensional) parameter $\displaystyle{ \theta }$. Consider then two close-by values of $\displaystyle{ P = P(\theta) }$ and $\displaystyle{ Q = P(\theta_0) }$ so that the parameter $\displaystyle{ \theta }$ differs by only a small amount from the parameter value $\displaystyle{ \theta_0 }$. Specifically, up to first order one has (using the Einstein summation convention)

Kullback-Leibler 散度与费雪资讯度量直接相关。这一点可以明确如下。假设概率分布 < math > p </math > 和 < math > q </math > 都由一些(可能是多维的)参数参数 < math > theta </math > 参数化。然后考虑两个相近的值: < math > p = p (theta) </math > 和 < math > q = p (theta _ 0) </math > ，因此参数 < math > theta </math > 与参数 < math > theta _ 0 </math > 相差很小。具体地说，最多有一阶(使用爱因斯坦求和约定)

&= \int_{y_a}^{y_b} P(y)\log\left(\frac{P(y)\, \frac{dy}{dx}}{Q(y)\, \frac{dy}{dx}}\right)\, dy


$\displaystyle{ P(\theta) = P(\theta_0) + \Delta\theta_j P_j(\theta_0) + \cdots }$

< math > p (theta) = p (theta _ 0) + Delta theta _ j p _ j (theta _ 0) + cdots </math >

= \int_{y_a}^{y_b} P(y)\log\left(\frac{P(y)}{Q(y)}\right)\, dy


\end{align}[/itex]

with $\displaystyle{ \Delta\theta_j = (\theta - \theta_0)_j }$ a small change of $\displaystyle{ \theta }$ in the $\displaystyle{ j }$ direction, and $\displaystyle{ P_j\left(\theta_0\right) = \frac{\partial P}{\partial \theta_j}(\theta_0) }$ the corresponding rate of change in the probability distribution. Since the Kullback–Leibler divergence has an absolute minimum 0 for $\displaystyle{ P = Q }$, i.e. $\displaystyle{ \theta = \theta_0 }$, it changes only to second order in the small parameters $\displaystyle{ \Delta\theta_j }$. More formally, as for any minimum, the first derivatives of the divergence vanish

where $\displaystyle{ y_a = y(x_a) }$ and $\displaystyle{ y_b = y(x_b) }$. Although it was assumed that the transformation was continuous, this need not be the case. This also shows that the Kullback–Leibler divergence produces a dimensionally consistent quantity, since if $\displaystyle{ x }$ is a dimensioned variable, $\displaystyle{ P(x) }$ and $\displaystyle{ Q(x) }$ are also dimensioned, since e.g. $\displaystyle{ P(x) dx }$ is dimensionless. The argument of the logarithmic term is and remains dimensionless, as it must. It can therefore be seen as in some ways a more fundamental quantity than some other properties in information theory[10] (such as self-information or Shannon entropy), which can become undefined or negative for non-discrete probabilities.

$\displaystyle{ \left.\frac{\partial}{\partial\theta_j}\right|_{\theta = \theta_0} D_\text{KL}(P(\theta) \parallel P(\theta_0)) = 0, }$

(p (theta) parallel p (theta _ 0)) = 0，</math >

• The Kullback–Leibler divergence is additive for independent distributions in much the same way as Shannon entropy. If $\displaystyle{ P_1, P_2 }$ are independent distributions, with the joint distribution $\displaystyle{ P(x, y) = P_1(x)P_2(y) }$, and $\displaystyle{ Q, Q_1, Q_2 }$ likewise, then
$\displaystyle{ D_\text{KL}(P \parallel Q) = D_\text{KL}(P_1 \parallel Q_1) + D_\text{KL}(P_2 \parallel Q_2). }$

and by the Taylor expansion one has up to second order

• The Kullback–Leibler divergence $\displaystyle{ D_\text{KL}(P \parallel Q) }$ is convex in the pair of probability mass functions $\displaystyle{ (p,q) }$, i.e. if $\displaystyle{ (p_1,q_1) }$ and $\displaystyle{ (p_2,q_2) }$ are two pairs of probability mass functions, then

$\displaystyle{ D_\text{KL}(P(\theta) \parallel P(\theta_0)) = \frac{1}{2} \Delta\theta_j\Delta\theta_k g_{jk}(\theta_0) + \cdots }$

(p (theta) parallel p (theta _ 0)) = frac {1}{2} Delta theta _ j Delta theta _ g _ (jk _ 0) + cdots </math >

• $\displaystyle{ D_\text{KL}(\lambda p_1 + (1 - \lambda) p_2 \parallel \lambda q_1 + (1 - \lambda) q_2) \le \lambda D_\text{KL}(p_1 \parallel q_1) + (1 - \lambda)D_\text{KL}(p_2 \parallel q_2) \text{ for } 0 \le \lambda \le 1. }$

where the Hessian matrix of the divergence

## Examples

$\displaystyle{ g_{jk}(\theta_0) = \left.\frac{\partial^2}{\partial\theta_j\, \partial\theta_k} \right|_{\theta = \theta_0} D_\text{KL}(P(\theta) \parallel P(\theta_0)) }$

(theta _ 0) = left. frac { partial ^ 2}{ partial theta _ j，partial theta _ k } right | { theta = theta _ 0} d text { KL }(p (theta) parallel p (theta _ 0)) </math >

### Multivariate normal distributions

must be positive semidefinite. Letting $\displaystyle{ \theta_0 }$ vary (and dropping the subindex 0) the Hessian $\displaystyle{ g_{jk}(\theta) }$ defines a (possibly degenerate) Riemannian metric on the parameter space, called the Fisher information metric.

Suppose that we have two multivariate normal distributions, with means $\displaystyle{ \mu_0, \mu_1 }$ and with (non-singular) covariance matrices $\displaystyle{ \Sigma_0, \Sigma_1. }$ If the two distributions have the same dimension, $\displaystyle{ k }$, then the Kullback–Leibler divergence between the distributions is as follows:[11]:p. 13

$\displaystyle{ When \lt math\gt p_{(x, \rho)} }$ satisfies the following regularity conditions:

 D_\text{KL}\left(\mathcal{N}_0 \parallel \mathcal{N}_1\right) =

 \frac{1}{2}\left(


$\displaystyle{ \tfrac{\partial \log(p)}{\partial \rho}, \tfrac{\partial^2 \log(p)}{\partial \rho^2}, \tfrac{\partial^3 \log(p)}{\partial \rho^3} }$ exist,

{ partial log (p)} ，tfrac { partial ^ 2 log (p)}{ partial rho ^ 3 log (p)}{ partial rho ^ 3} </math > exist,

   \operatorname{tr}\left(\Sigma_1^{-1}\Sigma_0\right) +


\displaystyle{ \begin{align} 1.1.1.2.2.2.2.2.2.3.3.3.3.3.3.3.3.3.3.3.3.3.3.3.3.3.3.3.3.3.3.3.3.3.3.3.3.3.3.3.3.3.3.3.3.3.3.3.3.3.3.3.3.3.3.3.3.3.3.3.3.3.3.3.3.3.3.3.3.3.3.3.3.3.3.3.3.3.3.3.3.3.3.3.3.3.3.3.3.3.3.3.3.3.3 \left(\mu_1 - \mu_0\right)^\mathsf{T} \Sigma_1^{-1}\left(\mu_1 - \mu_0\right) - k + \left|\frac{\partial p}{\partial \rho}\right| &\lt F(x): \int_{x=0}^\infty F(x)\,dx \lt \infty, \\ 左 | frac { partial p }{ partial rho } right | & \lt f (x) : int _ { x = 0} ^ infty f (x) ，dx \lt infty, \ln\left(\frac{\det\Sigma_1}{\det\Sigma_0}\right) \left|\frac{\partial^2 p}{\partial \rho^2}\right| &\lt G(x): \int_{x=0}^\infty G(x)\,dx \lt \infty \\ 左 | frac { partial ^ 2 p }{ partial rho ^ 2} right | & \lt g (x) : int _ { x = 0} ^ infty g (x) ，dx \lt infty \right). \left|\frac{\partial^3 \log(p)}{\partial \rho^3}\right| &\lt H(x): \int_{x=0}^\infty p(x, 0)H(x)\,dx \lt \xi \lt \infty 左 | frac { partial ^ 3 log (p)}{ partial rho ^ 3} right | & \lt h (x) : int _ { x = 0} ^ infty p (x，0) h (x) ，dx \lt xi \lt infty }

\end{align}[/itex]

The logarithm in the last term must be taken to base e since all terms apart from the last are base-e logarithms of expressions that are either factors of the density function or otherwise arise naturally. The equation therefore gives a result measured in nats. Dividing the entire expression above by $\displaystyle{ \ln(2) }$ yields the divergence in bits.

where is independent of

$\displaystyle{ 《数学》 A special case, and a common quantity in [[variational inference]], is the KL-divergence between a diagonal multivariate normal, and a standard normal distribution (with zero mean and unit variance): \left.\int_{x=0}^\infty \frac{\partial p(x, \rho)}{\partial \rho}\right|_{\rho=0}\, dx = 左边. int { x = 0} ^ infty frac { partial p (x，rho)}{ partial rho } right | { rho = 0} ，dx = \left.\int_{x=0}^\infty \frac{\partial^2 p(x, \rho)}{\partial \rho^2}\right|_{\rho=0}\, dx = 0 2} right | { rho = 0} ，dx = 0 :\lt math\gt }$


 D_\text{KL}\left(

   \mathcal{N}\left(\left(\mu_1, \ldots, \mu_k\right)^\mathsf{T}, \operatorname{diag} \left(\sigma_1^2, \ldots, \sigma_k^2\right)\right) \parallel


then:

   \mathcal{N}\left(\mathbf{0}, \mathbf{I}\right)

$\displaystyle{ \mathcal{D}(p(x, 0) \parallel p(x, \rho)) = \frac{c\rho^2}{2} + \mathcal{O}\left(\rho^3\right) \text{ as } \rho \to 0. }$


(p (x，0) parallel p (x，rho)) = frac { c rho ^ 2}{2} + mathcal { o } left (rho ^ 3 right) text { as } rho to 0. </math >

 \right) =

 {1 \over 2} \sum_{i=1}^k \left(\sigma_i^2 + \mu_i^2 - 1 - \ln\left(\sigma_i^2\right)\right).


[/itex]

Another information-theoretic metric is Variation of information, which is roughly a symmetrization of conditional entropy. It is a metric on the set of partitions of a discrete probability space.

## Relation to metrics

Many of the other quantities of information theory can be interpreted as applications of the Kullback–Leibler divergence to specific cases.

One might be tempted to call the Kullback–Leibler divergence a "distance metric" on the space of probability distributions, but this would not be correct as it is not symmetric – that is, $\displaystyle{ D_\text{KL}(P\parallel Q) \neq D_\text{KL}(Q\parallel P) }$ – nor does it satisfy the triangle inequality. Even so, being a premetric, it generates a topology on the space of probability distributions. More concretely, if $\displaystyle{ \{P_1,P_2,\ldots\} }$ is a sequence of distributions such that

$\displaystyle{ \lim_{n \to \infty} D_\text{KL}(P_n\parallel Q) = 0 }$

The self-information, also known as the information content of a signal, random variable, or event is defined as the negative logarithm of the probability of the given outcome occurring.

then it is said that

When applied to a discrete random variable, the self-information can be represented as

$\displaystyle{ P_n \xrightarrow{D} Q . }$

$\displaystyle{ \operatorname \operatorname{I}(m) = D_\text{KL}\left(\delta_\text{im} \parallel \{p_i\}\right), }$

(m) = d _ text { KL } left (delta _ text { im } parallel { p _ i } right) ，</math >

Pinsker's inequality entails that

is the Kullback–Leibler divergence of the probability distribution $\displaystyle{ P(i) }$ from a Kronecker delta representing certainty that $\displaystyle{ i = m }$ — i.e. the number of extra bits that must be transmitted to identify $\displaystyle{ i }$ if only the probability distribution $\displaystyle{ P(i) }$ is available to the receiver, not the fact that $\displaystyle{ i = m }$.

$\displaystyle{ P_n \xrightarrow{D} P \Rightarrow P_n \xrightarrow{TV} P, }$

where the latter stands for the usual convergence in total variation.

The mutual information,

### Fisher information metric

\displaystyle{ \begin{align} 1.1.1.2.2.2.2.2.2.3.3.3.3.3.3.3.3.3.3.3.3.3.3.3.3.3.3.3.3.3.3.3.3.3.3.3.3.3.3.3.3.3.3.3.3.3.3.3.3.3.3.3.3.3.3.3.3.3.3.3.3.3.3.3.3.3.3.3.3.3.3.3.3.3.3.3.3.3.3.3.3.3.3.3.3.3 The Kullback–Leibler divergence is directly related to the [[Fisher information metric]]. This can be made explicit as follows. Assume that the probability distributions \lt math\gt P } and $\displaystyle{ Q }$ are both parameterized by some (possibly multi-dimensional) parameter $\displaystyle{ \theta }$. Consider then two close-by values of $\displaystyle{ P = P(\theta) }$ and $\displaystyle{ Q = P(\theta_0) }$ so that the parameter $\displaystyle{ \theta }$ differs by only a small amount from the parameter value $\displaystyle{ \theta_0 }$. Specifically, up to first order one has (using the Einstein summation convention)

\operatorname{I}(X; Y)


$\displaystyle{ P(\theta) = P(\theta_0) + \Delta\theta_j P_j(\theta_0) + \cdots }$
  &= D_\text{KL}(P(X, Y) \parallel P(X)P(Y)) \\


& = d _ text { KL }(p (x，y)并行 p (x) p (y))

  &= \operatorname{E}_X \{D_\text{KL}(P(Y \mid X) \parallel P(Y))\} \\


& = 操作者名{ e } _ x { d _ text { KL }(p (y mid x) parallel p (y))}

with $\displaystyle{ \Delta\theta_j = (\theta - \theta_0)_j }$ a small change of $\displaystyle{ \theta }$ in the $\displaystyle{ j }$ direction, and $\displaystyle{ P_j\left(\theta_0\right) = \frac{\partial P}{\partial \theta_j}(\theta_0) }$ the corresponding rate of change in the probability distribution. Since the Kullback–Leibler divergence has an absolute minimum 0 for $\displaystyle{ P = Q }$, i.e. $\displaystyle{ \theta = \theta_0 }$, it changes only to second order in the small parameters $\displaystyle{ \Delta\theta_j }$. More formally, as for any minimum, the first derivatives of the divergence vanish

  &= \operatorname{E}_Y \{D_\text{KL}(P(X \mid Y) \parallel P(X))\}


& = 操作数名{ e } _ y { d _ text { KL }(p (x mid y) parallel p (x))}

\end{align}[/itex]

$\displaystyle{ \left.\frac{\partial}{\partial\theta_j}\right|_{\theta = \theta_0} D_\text{KL}(P(\theta) \parallel P(\theta_0)) = 0, }$

is the Kullback–Leibler divergence of the product $\displaystyle{ P(X)P(Y) }$ of the two marginal probability distributions from the joint probability distribution $\displaystyle{ P(X,Y) }$ — i.e. the expected number of extra bits that must be transmitted to identify $\displaystyle{ X }$ and $\displaystyle{ Y }$ if they are coded using only their marginal distributions instead of the joint distribution. Equivalently, if the joint probability $\displaystyle{ P(X,Y) }$ is known, it is the expected number of extra bits that must on average be sent to identify $\displaystyle{ Y }$ if the value of $\displaystyle{ X }$ is not already known to the receiver.

P (x) p (y) </math > p (x) p (y) </math > p (y) </math > p (x，y) </math > p (x，y) </math > .如果只使用它们的边际分布而不是联合分布来编码，那么为了识别 < math > x </math > 和 < math > y </math > 而必须传输的预期额外位数。等价地，如果联合概率 < math > p (x，y) </math > 是已知的，那么如果 < math > x </math > 的值对于接收者来说还不知道，那么它就是平均来说为了识别 < math > y </math > 而必须发送的预期额外位数。

and by the Taylor expansion one has up to second order

$\displaystyle{ D_\text{KL}(P(\theta) \parallel P(\theta_0)) = \frac{1}{2} \Delta\theta_j\Delta\theta_k g_{jk}(\theta_0) + \cdots }$

The Shannon entropy,

where the Hessian matrix of the divergence

\displaystyle{ \begin{align} 1.1.1.2.2.2.2.2.2.3.3.3.3.3.3.3.3.3.3.3.3.3.3.3.3.3.3.3.3.3.3.3.3.3.3.3.3.3.3.3.3.3.3.3.3.3.3.3.3.3.3.3.3.3.3.3.3.3.3.3.3.3.3.3.3.3.3.3.3.3.3.3.3.3.3.3.3.3.3.3.3.3.3.3.3.3.3.3.3.3.3.3.3.3.3 \Eta(X) &= \operatorname{E}\left[\operatorname{I}_X(x)\right] \\ Eta (x) & = operatorname { e }左[ operatorname { i } _ x (x)右] :\lt math\gt g_{jk}(\theta_0) = \left.\frac{\partial^2}{\partial\theta_j\, \partial\theta_k} \right|_{\theta = \theta_0} D_\text{KL}(P(\theta) \parallel P(\theta_0)) }

        &= \log(N) - D_\text{KL}\left(p_X(x) \parallel P_U(X)\right)


& = log (n)-d _ text { KL }左(p _ x (x)并行 p _ u (x)右)

\end{align}[/itex]

must be positive semidefinite. Letting $\displaystyle{ \theta_0 }$ vary (and dropping the subindex 0) the Hessian $\displaystyle{ g_{jk}(\theta) }$ defines a (possibly degenerate) Riemannian metric on the θ parameter space, called the Fisher information metric.

is the number of bits which would have to be transmitted to identify $\displaystyle{ X }$ from $\displaystyle{ N }$ equally likely possibilities, less the Kullback–Leibler divergence of the uniform distribution on the random variates of $\displaystyle{ X }$, $\displaystyle{ P_U(X) }$, from the true distribution $\displaystyle{ P(X) }$ — i.e. less the expected number of bits saved, which would have had to be sent if the value of $\displaystyle{ X }$ were coded according to the uniform distribution $\displaystyle{ P_U(X) }$ rather than the true distribution $\displaystyle{ P(X) }$.

#### Fisher information metric theorem

When $\displaystyle{ p_{(x, \rho)} }$ satisfies the following regularity conditions:

The conditional entropy,

$\displaystyle{ \tfrac{\partial \log(p)}{\partial \rho}, \tfrac{\partial^2 \log(p)}{\partial \rho^2}, \tfrac{\partial^3 \log(p)}{\partial \rho^3} }$ exist,
\displaystyle{ \begin{align} \lt math\gt \begin{align} 1.1.1.2.2.2.2.2.2.3.3.3.3.3.3.3.3.3.3.3.3.3.3.3.3.3.3.3.3.3.3.3.3.3.3.3.3.3.3.3.3.3.3.3.3.3.3.3.3.3.3.3.3.3.3.3.3.3.3.3.3.3.3.3.3.3.3.3.3.3.3.3.3.3.3.3.3.3.3.3.3.3.3.3.3.3 \left|\frac{\partial p}{\partial \rho}\right| &\lt F(x): \int_{x=0}^\infty F(x)\,dx \lt \infty, \\ \Eta(X \mid Y) 预计抵达时间(x 中 y) \left|\frac{\partial^2 p}{\partial \rho^2}\right| &\lt G(x): \int_{x=0}^\infty G(x)\,dx \lt \infty \\ &= \log(N) - D_\text{KL}(P(X, Y) \parallel P_U(X) P(Y)) \\ & = log (n)-d _ text { KL }(p (x，y)并行 p _ u (x) p (y)) \left|\frac{\partial^3 \log(p)}{\partial \rho^3}\right| &\lt H(x): \int_{x=0}^\infty p(x, 0)H(x)\,dx \lt \xi \lt \infty &= \log(N) - D_\text{KL}(P(X, Y) \parallel P(X) P(Y)) - D_\text{KL}(P(X) \parallel P_U(X)) \\ & = log (n)-dtext { KL }(p (x，y)并行 p (x) p (y))-dtext { KL }(p (x)并行 p _ u (x))) \end{align} }
   &= \Eta(X) - \operatorname{I}(X; Y) \\


& = Eta (x)-操作者名{ i }(x; y)

   &= \log(N) - \operatorname{E}_Y \left[D_\text{KL}\left(P\left(X \mid Y\right) \parallel P_U(X)\right)\right]


& = log (n)-operatorname { e } _ y left [ d _ text { KL } left (p left (x mid y right) parallel p _ u (x) right)]

where ξ is independent of ρ

\end{align}[/itex]

$\displaystyle{ \left.\int_{x=0}^\infty \frac{\partial p(x, \rho)}{\partial \rho}\right|_{\rho=0}\, dx = is the number of bits which would have to be transmitted to identify \lt math\gt X }$ from $\displaystyle{ N }$ equally likely possibilities, less the Kullback–Leibler divergence of the product distribution $\displaystyle{ P_U(X) P(Y) }$ from the true joint distribution $\displaystyle{ P(X,Y) }$ — i.e. less the expected number of bits saved which would have had to be sent if the value of $\displaystyle{ X }$ were coded according to the uniform distribution $\displaystyle{ P_U(X) }$ rather than the conditional distribution $\displaystyle{ P(X|Y) }$ of $\displaystyle{ X }$ given $\displaystyle{ Y }$.

\left.\int_{x=0}^\infty \frac{\partial^2 p(x, \rho)}{\partial \rho^2}\right|_{\rho=0}\, dx = 0


[/itex]

When we have a set of possible events, coming from the distribution , we can encode them (with a lossless data compression) using entropy encoding. This compresses the data by replacing each fixed-length input symbol with a corresponding unique, variable-length, prefix-free code (e.g.: the events (A, B, C) with probabilities p = (1/2, 1/4, 1/4) can be encoded as the bits (0, 10, 11)). If we know the distribution in advance, we can devise an encoding that would be optimal (e.g.: using Huffman coding). Meaning the messages we encode will have the shortest length on average (assuming the encoded events are sampled from ), which will be equal to Shannon's Entropy of (denoted as $\displaystyle{ \Eta(p) }$). However, if we use a different probability distribution () when creating the entropy encoding scheme, then a larger number of bits will be used (on average) to identify an event from a set of possibilities. This new (larger) number is measured by the cross entropy between and .

then:

$\displaystyle{ \mathcal{D}(p(x, 0) \parallel p(x, \rho)) = \frac{c\rho^2}{2} + \mathcal{O}\left(\rho^3\right) \text{ as } \rho \to 0. }$

The cross entropy between two probability distributions ( and ) measures the average number of bits needed to identify an event from a set of possibilities, if a coding scheme is used based on a given probability distribution , rather than the "true" distribution . The cross entropy for two distributions and over the same probability space is thus defined as follows:

### Variation of information

$\displaystyle{ \Eta(p, q) = \operatorname{E}_p[-\log(q)] = \Eta(p) + D_\text{KL}(p \parallel q). }$

< math > Eta (p，q) = 操作者名{ e } _ p [-log (q)] = Eta (p) + d _ text { KL }(p 并行 q)。 </math >

Another information-theoretic metric is Variation of information, which is roughly a symmetrization of conditional entropy. It is a metric on the set of partitions of a discrete probability space.

Under this scenario, the KL divergences can be interpreted as the extra number of bits, on average, that are needed (beyond $\displaystyle{ \Eta(p) }$) for encoding the events because of using for constructing the encoding scheme instead of .

## Relation to other quantities of information theory

Many of the other quantities of information theory can be interpreted as applications of the Kullback–Leibler divergence to specific cases.

In Bayesian statistics the Kullback–Leibler divergence can be used as a measure of the information gain in moving from a prior distribution to a posterior distribution: $\displaystyle{ p(x) \to p(x\mid I) }$. If some new fact $\displaystyle{ Y = y }$ is discovered, it can be used to update the posterior distribution for $\displaystyle{ X }$ from $\displaystyle{ p(x\mid I) }$ to a new posterior distribution $\displaystyle{ p(x\mid y,I) }$ using Bayes' theorem:

20世纪贝叶斯统计，Kullback-Leibler 分歧可以用来衡量从先前分布到后验概率分布的信息增益:。如果发现了一些新的事实，它可以用来更新数学后验概率，从数学公式 p (x mid i)到一个新的后验概率公式 p (x mid y，i):

### Self-information

$\displaystyle{ p(x \mid y, I) = \frac{p(y \mid x, I) p(x \mid I)}{p(y \mid I)} }$

P (x mid y，i) = frac { p (y mid x，i) p (x mid i)}{ p (y mid i)}} </math >

The self-information, also known as the information content of a signal, random variable, or event is defined as the negative logarithm of the probability of the given outcome occurring.

This distribution has a new entropy:

When applied to a discrete random variable, the self-information can be represented as[citation needed]

$\displaystyle{ \Eta\big(p(x \mid y, I)\big) = -\sum_x p(x \mid y, I) \log p(x \mid y, I), }$

Eta big (p (x mid y，i) big) =-sum _ xp (x mid y，i) log p (x mid y，i) ，</math >

$\displaystyle{ \operatorname \operatorname{I}(m) = D_\text{KL}\left(\delta_\text{im} \parallel \{p_i\}\right), }$

which may be less than or greater than the original entropy $\displaystyle{ \Eta(p(x\mid I)) }$. However, from the standpoint of the new probability distribution one can estimate that to have used the original code based on $\displaystyle{ p(x\mid I) }$ instead of a new code based on $\displaystyle{ p(x\mid y, I) }$ would have added an expected number of bits:

is the Kullback–Leibler divergence of the probability distribution $\displaystyle{ P(i) }$ from a Kronecker delta representing certainty that $\displaystyle{ i = m }$ — i.e. the number of extra bits that must be transmitted to identify $\displaystyle{ i }$ if only the probability distribution $\displaystyle{ P(i) }$ is available to the receiver, not the fact that $\displaystyle{ i = m }$.

$\displaystyle{ D_\text{KL}\big(p(x \mid y, I) \parallel p(x \mid I) \big) = \sum_x p(x \mid y, I) \log\left(\frac{p(x \mid y, I)}{p(x \mid I)}\right) }$

(p (x mid y，i) parallel p (x mid i) big) = sum _ xp (x mid y，i) log left (frac { p (x mid y，i)}{ p (x mid i)} right) </math >

### Mutual information

to the message length. This therefore represents the amount of useful information, or information gain, about $\displaystyle{ X }$, that we can estimate has been learned by discovering $\displaystyle{ Y = y }$.

\displaystyle{ \begin{align} If a further piece of data, \lt math\gt Y_2 = y_2 }, subsequently comes in, the probability distribution for $\displaystyle{ x }$ can be updated further, to give a new best guess $\displaystyle{ p(x \mid y_1, y_2, I) }$. If one reinvestigates the information gain for using $\displaystyle{ p(x \mid y_1,I) }$ rather than $\displaystyle{ p(x \mid I) }$, it turns out that it may be either greater or less than previously estimated:

\operatorname{I}(X; Y)

  &= D_\text{KL}(P(X, Y) \parallel P(X)P(Y)) \\


$\displaystyle{ \sum_x p(x \mid y_1, y_2, I) \log\left(\frac{p(x \mid y_1, y_2, I)}{p(x \mid I)}\right) }$ may be ≤ or > than $\displaystyle{ \displaystyle \sum_x p(x \mid y_1, I) \log\left(\frac{p(x \mid y_1, I)}{p(x \mid I)}\right) }$

(x mid y _ 1，y _ 2，i) log left (frac { p (x mid y _ 1，y _ 2，i)}{ p (x mid i)}右) </math > 可能≤或 > 于 < math > 显式 sum _ p (x mid y _ 1，i) log left (frac { p (x mid y _ 1，i)}{ p (x mid i)}右) </math >

  &= \operatorname{E}_X \{D_\text{KL}(P(Y \mid X) \parallel P(Y))\} \\

  &= \operatorname{E}_Y \{D_\text{KL}(P(X \mid Y) \parallel P(X))\}


and so the combined information gain does not obey the triangle inequality:

\end{align}[/itex]

$\displaystyle{ D_\text{KL} \big( p(x \mid y_1, y_2, I) \parallel p(x \mid I) \big) }$ may be <, = or > than $\displaystyle{ D_\text{KL}\big( p(x \mid y_1, y_2, I) \parallel p(x \mid y_1, I)\big) + D_\text{KL}\big(p(x \mid y_1, I) \parallel p(x \mid I)\big) }$

Big (p (x mid y _ 1，y _ 2，i) parallal p (x mid i) big) </math > 可能比 < ，= 或 > < d text { KL } big (p (x mid y _ 1，y _ 2，i) parallal p (x mid y _ 1，i) big) + d text { KL } big (p (x mid y _ 1，i) parallal p (x mid i) big) </math >

is the Kullback–Leibler divergence of the product $\displaystyle{ P(X)P(Y) }$ of the two marginal probability distributions from the joint probability distribution $\displaystyle{ P(X,Y) }$ — i.e. the expected number of extra bits that must be transmitted to identify $\displaystyle{ X }$ and $\displaystyle{ Y }$ if they are coded using only their marginal distributions instead of the joint distribution. Equivalently, if the joint probability $\displaystyle{ P(X,Y) }$ is known, it is the expected number of extra bits that must on average be sent to identify $\displaystyle{ Y }$ if the value of $\displaystyle{ X }$ is not already known to the receiver.

All one can say is that on average, averaging using $\displaystyle{ p(y_2 \mid y_1, x, I) }$, the two sides will average out.

### Shannon entropy

A common goal in Bayesian experimental design is to maximise the expected Kullback–Leibler divergence between the prior and the posterior. When posteriors are approximated to be Gaussian distributions, a design maximising the expected Kullback–Leibler divergence is called Bayes d-optimal.

\displaystyle{ \begin{align} \Eta(X) &= \operatorname{E}\left[\operatorname{I}_X(x)\right] \\ &= \log(N) - D_\text{KL}\left(p_X(x) \parallel P_U(X)\right) The Kullback–Leibler divergence \lt math display="inline"\gt D_\text{KL}\bigl(p(x \mid H_1) \parallel p(x \mid H_0)\bigr) } can also be interpreted as the expected discrimination information for $\displaystyle{ H_1 }$ over $\displaystyle{ H_0 }$: the mean information per sample for discriminating in favor of a hypothesis $\displaystyle{ H_1 }$ against a hypothesis $\displaystyle{ H_0 }$, when hypothesis $\displaystyle{ H_1 }$ is true. Another name for this quantity, given to it by I. J. Good, is the expected weight of evidence for $\displaystyle{ H_1 }$ over $\displaystyle{ H_0 }$ to be expected from each sample.

\end{align}[/itex]

The expected weight of evidence for $\displaystyle{ H_1 }$ over $\displaystyle{ H_0 }$ is not the same as the information gain expected per sample about the probability distribution $\displaystyle{ p(H) }$ of the hypotheses,

is the number of bits which would have to be transmitted to identify $\displaystyle{ X }$ from $\displaystyle{ N }$ equally likely possibilities, less the Kullback–Leibler divergence of the uniform distribution on the random variates of $\displaystyle{ X }$, $\displaystyle{ P_U(X) }$, from the true distribution $\displaystyle{ P(X) }$ — i.e. less the expected number of bits saved, which would have had to be sent if the value of $\displaystyle{ X }$ were coded according to the uniform distribution $\displaystyle{ P_U(X) }$ rather than the true distribution $\displaystyle{ P(X) }$.

$\displaystyle{ D_\text{KL}(p(x \mid H_1) \parallel p(x \mid H_0)) \neq IG = D_\text{KL}(p(H \mid x) \parallel p(H \mid I)). }$

(p (x mid h _ 1) parallel p (x mid h _ 0)) neq IG = d _ text { KL }(p (h mid x) parallel p (h mid i)) </math >

### Conditional entropy

Either of the two quantities can be used as a utility function in Bayesian experimental design, to choose an optimal next question to investigate: but they will in general lead to rather different experimental strategies.

\displaystyle{ \begin{align} On the entropy scale of information gain there is very little difference between near certainty and absolute certainty—coding according to a near certainty requires hardly any more bits than coding according to an absolute certainty. On the other hand, on the logit scale implied by weight of evidence, the difference between the two is enormous – infinite perhaps; this might reflect the difference between being almost sure (on a probabilistic level) that, say, the Riemann hypothesis is correct, compared to being certain that it is correct because one has a mathematical proof. These two different scales of loss function for uncertainty are both useful, according to how well each reflects the particular circumstances of the problem in question. 在信息增益的熵尺度上，接近确定性和绝对确定性之间的差别很小ーー基于接近确定性的编码几乎不需要比基于绝对确定性的编码多任何比特。另一方面，从证据权重所暗示的逻辑尺度来看，两者之间的差别是巨大的——也许是无限的; 这可能反映了几乎肯定(在概率层面上) ，比如说，黎曼猜想是正确的与确定它是正确的之间的差别，因为一个人有数学证明。这两种不同尺度的不确定性损失函数都是有用的，取决于它们如何很好地反映有关问题的特定情况。 \Eta(X \mid Y) &= \log(N) - D_\text{KL}(P(X, Y) \parallel P_U(X) P(Y)) \\ &= \log(N) - D_\text{KL}(P(X, Y) \parallel P(X) P(Y)) - D_\text{KL}(P(X) \parallel P_U(X)) \\ The idea of Kullback–Leibler divergence as discrimination information led Kullback to propose the Principle of (MDI): given new facts, a new distribution \lt math\gt f } should be chosen which is as hard to discriminate from the original distribution $\displaystyle{ f_0 }$ as possible; so that the new data produces as small an information gain $\displaystyle{ D_\text{KL}(f \parallel f_0) }$ as possible.

Kullback-Leibler 分歧作为歧视信息的想法促使 Kullback 提出了(MDI)原则: 给定新的事实，应该选择一个新的分布，这个分布尽可能难以与原始分布区分开来，这样新的数据就能产生尽可能小的信息增益。

   &= \Eta(X) - \operatorname{I}(X; Y) \\

   &= \log(N) - \operatorname{E}_Y \left[D_\text{KL}\left(P\left(X \mid Y\right) \parallel P_U(X)\right)\right]


For example, if one had a prior distribution $\displaystyle{ p(x,a) }$ over $\displaystyle{ x }$ and $\displaystyle{ a }$, and subsequently learnt the true distribution of $\displaystyle{ a }$ was $\displaystyle{ u(a) }$, then the Kullback–Leibler divergence between the new joint distribution for $\displaystyle{ x }$ and $\displaystyle{ a }$, $\displaystyle{ q(x\mid a)u(a) }$, and the earlier prior distribution would be:

\end{align}[/itex]

$\displaystyle{ D_\text{KL}(q(x \mid a)u(a) \parallel p(x, a)) = \operatorname{E}_{u(a)}\left\{D_\text{KL}(q(x \mid a) \parallel p(x \mid a))\right\} + D_\text{KL}(u(a) \parallel p(a)), }$

D text { KL }(q (x mid a) u (a) parallel p (x，a)) = operatorname { e }{ u (a)}左{ d text { KL }(q (x mid a) parallel p (x mid a))右} + d text { KL }(u (a) parallel p (a)) ，</math >

is the number of bits which would have to be transmitted to identify $\displaystyle{ X }$ from $\displaystyle{ N }$ equally likely possibilities, less the Kullback–Leibler divergence of the product distribution $\displaystyle{ P_U(X) P(Y) }$ from the true joint distribution $\displaystyle{ P(X,Y) }$ — i.e. less the expected number of bits saved which would have had to be sent if the value of $\displaystyle{ X }$ were coded according to the uniform distribution $\displaystyle{ P_U(X) }$ rather than the conditional distribution $\displaystyle{ P(X|Y) }$ of $\displaystyle{ X }$ given $\displaystyle{ Y }$.

i.e. the sum of the Kullback–Leibler divergence of $\displaystyle{ p(a) }$ the prior distribution for $\displaystyle{ a }$ from the updated distribution $\displaystyle{ u(a) }$, plus the expected value (using the probability distribution $\displaystyle{ u(a) }$) of the Kullback–Leibler divergence of the prior conditional distribution $\displaystyle{ p(x\mid a) }$ from the new conditional distribution $\displaystyle{ q(x\mid a) }$. (Note that often the later expected value is called the conditional Kullback–Leibler divergence (or conditional relative entropy) and denoted by $\displaystyle{ D_\text{KL}(q(x\mid a) \parallel p(x\mid a)) }$

### Cross entropy

) This is minimized if $\displaystyle{ q(x\mid a)=p(x\mid a) }$ over the whole support of $\displaystyle{ u(a) }$; and we note that this result incorporates Bayes' theorem, if the new distribution $\displaystyle{ u(a) }$ is in fact a δ function representing certainty that $\displaystyle{ a }$ has one particular value.

When we have a set of possible events, coming from the distribution p, we can encode them (with a lossless data compression) using entropy encoding. This compresses the data by replacing each fixed-length input symbol with a corresponding unique, variable-length, prefix-free code (e.g.: the events (A, B, C) with probabilities p = (1/2, 1/4, 1/4) can be encoded as the bits (0, 10, 11)). If we know the distribution p in advance, we can devise an encoding that would be optimal (e.g.: using Huffman coding). Meaning the messages we encode will have the shortest length on average (assuming the encoded events are sampled from p), which will be equal to Shannon's Entropy of p (denoted as $\displaystyle{ \Eta(p) }$). However, if we use a different probability distribution (q) when creating the entropy encoding scheme, then a larger number of bits will be used (on average) to identify an event from a set of possibilities. This new (larger) number is measured by the cross entropy between p and q.

MDI can be seen as an extension of Laplace's Principle of Insufficient Reason, and the Principle of Maximum Entropy of E.T. Jaynes. In particular, it is the natural extension of the principle of maximum entropy from discrete to continuous distributions, for which Shannon entropy ceases to be so useful (see differential entropy), but the Kullback–Leibler divergence continues to be just as relevant.

MDI 可以看作是拉普拉斯不充分理性原则的延伸，也可以看作是 e.t. 的最大熵原理。女名女子名。特别是，它是最大熵原理从离散分布到连续分布的自然延伸，对此，香农熵不再那么有用了(见微分熵) ，但 Kullback-Leibler 散度仍然是相关的。

The cross entropy between two probability distributions (p and q) measures the average number of bits needed to identify an event from a set of possibilities, if a coding scheme is used based on a given probability distribution q, rather than the "true" distribution p. The cross entropy for two distributions p and q over the same probability space is thus defined as follows:[citation needed]

In the engineering literature, MDI is sometimes called the Principle of Minimum Cross-Entropy (MCE) or Minxent for short. Minimising the Kullback–Leibler divergence from $\displaystyle{ m }$ to $\displaystyle{ p }$ with respect to $\displaystyle{ m }$ is equivalent to minimizing the cross-entropy of $\displaystyle{ p }$ and $\displaystyle{ m }$, since

$\displaystyle{ \Eta(p, q) = \operatorname{E}_p[-\log(q)] = \Eta(p) + D_\text{KL}(p \parallel q). }$

$\displaystyle{ \Eta(p, m) = \Eta(p) + D_\text{KL}(p \parallel m), }$

[ math ] Eta (p，m) = Eta (p) + d _ text { KL }(p parallel m) ，[/math ]

Under this scenario, the KL divergences can be interpreted as the extra number of bits, on average, that are needed (beyond $\displaystyle{ \Eta(p) }$) for encoding the events because of using q for constructing the encoding scheme instead of p.

which is appropriate if one is trying to choose an adequate approximation to $\displaystyle{ p }$. However, this is just as often not the task one is trying to achieve. Instead, just as often it is $\displaystyle{ m }$ that is some fixed prior reference measure, and $\displaystyle{ p }$ that one is attempting to optimise by minimising $\displaystyle{ D_\text{KL}(p \parallel m) }$ subject to some constraint. This has led to some ambiguity in the literature, with some authors attempting to resolve the inconsistency by redefining cross-entropy to be $\displaystyle{ D_\text{KL}(p \parallel m) }$, rather than $\displaystyle{ \Eta(p,m) }$.

## Bayesian updating

In Bayesian statistics the Kullback–Leibler divergence can be used as a measure of the information gain in moving from a prior distribution to a posterior distribution: $\displaystyle{ p(x) \to p(x\mid I) }$. If some new fact $\displaystyle{ Y = y }$ is discovered, it can be used to update the posterior distribution for $\displaystyle{ X }$ from $\displaystyle{ p(x\mid I) }$ to a new posterior distribution $\displaystyle{ p(x\mid y,I) }$ using Bayes' theorem:

Pressure versus volume plot of available work from a mole of argon gas relative to ambient, calculated as $\displaystyle{ T_o }$ times the Kullback–Leibler divergence.

$\displaystyle{ p(x \mid y, I) = \frac{p(y \mid x, I) p(x \mid I)}{p(y \mid I)} }$

Surprisals add where probabilities multiply. The surprisal for an event of probability $\displaystyle{ p }$ is defined as $\displaystyle{ s = k \ln(1 / p) }$. If $\displaystyle{ k }$ is $\displaystyle{ \left\{1, 1/\ln 2, 1.38 \times 10^{-23}\right\} }$ then surprisal is in $\displaystyle{ \{ }$nats, bits, or $\displaystyle{ J/K\} }$ so that, for instance, there are $\displaystyle{ N }$ bits of surprisal for landing all "heads" on a toss of $\displaystyle{ N }$ coins.

This distribution has a new entropy:

Best-guess states (e.g. for atoms in a gas) are inferred by maximizing the average surprisal $\displaystyle{ S }$ (entropy) for a given set of control parameters (like pressure $\displaystyle{ P }$ or volume $\displaystyle{ V }$). This constrained entropy maximization, both classically and quantum mechanically, minimizes Gibbs availability in entropy units $\displaystyle{ A \equiv -k\ln(Z) }$ where $\displaystyle{ Z }$ is a constrained multiplicity or partition function.

$\displaystyle{ \Eta\big(p(x \mid y, I)\big) = -\sum_x p(x \mid y, I) \log p(x \mid y, I), }$

When temperature $\displaystyle{ T }$ is fixed, free energy ($\displaystyle{ T \times A }$) is also minimized. Thus if $\displaystyle{ T, V }$ and number of molecules $\displaystyle{ N }$ are constant, the Helmholtz free energy $\displaystyle{ F \equiv U - TS }$ (where $\displaystyle{ U }$ is energy) is minimized as a system "equilibrates." If $\displaystyle{ T }$ and $\displaystyle{ P }$ are held constant (say during processes in your body), the Gibbs free energy $\displaystyle{ G = U + PV - TS }$ is minimized instead. The change in free energy under these conditions is a measure of available work that might be done in the process. Thus available work for an ideal gas at constant temperature $\displaystyle{ T_o }$ and pressure $\displaystyle{ P_o }$ is $\displaystyle{ W = \Delta G = NkT_o\Theta(V/V_o) }$ where $\displaystyle{ V_o = NkT_o/P_o }$ and $\displaystyle{ \Theta(x) = x - 1 - \ln x \ge 0 }$ (see also Gibbs inequality).

which may be less than or greater than the original entropy $\displaystyle{ \Eta(p(x\mid I)) }$. However, from the standpoint of the new probability distribution one can estimate that to have used the original code based on $\displaystyle{ p(x\mid I) }$ instead of a new code based on $\displaystyle{ p(x\mid y, I) }$ would have added an expected number of bits:

More generally the work available relative to some ambient is obtained by multiplying ambient temperature $\displaystyle{ T_o }$ by Kullback–Leibler divergence or net surprisal $\displaystyle{ \Delta I \ge 0, }$ defined as the average value of $\displaystyle{ k\ln(p/p_o) }$ where $\displaystyle{ p_o }$ is the probability of a given state under ambient conditions. For instance, the work available in equilibrating a monatomic ideal gas to ambient values of $\displaystyle{ V_o }$ and $\displaystyle{ T_o }$ is thus $\displaystyle{ W = T_o \Delta I }$, where Kullback–Leibler divergence

$\displaystyle{ D_\text{KL}\big(p(x \mid y, I) \parallel p(x \mid I) \big) = \sum_x p(x \mid y, I) \log\left(\frac{p(x \mid y, I)}{p(x \mid I)}\right) }$

$\displaystyle{ \Delta I = Nk\left[\Theta\left(\frac{V}{V_o}\right) + \frac{3}{2}\Theta\left(\frac{T}{T_o}\right)\right]. }$

[数学] Delta i = Nk left [ Theta left (frac { v }{ v _ o } right) + frac {3} Theta left (frac { t _ o } right)] . </math >

to the message length. This therefore represents the amount of useful information, or information gain, about $\displaystyle{ X }$, that we can estimate has been learned by discovering $\displaystyle{ Y = y }$.

The resulting contours of constant Kullback–Leibler divergence, shown at right for a mole of Argon at standard temperature and pressure, for example put limits on the conversion of hot to cold as in flame-powered air-conditioning or in the unpowered device to convert boiling-water to ice-water discussed here. Thus Kullback–Leibler divergence measures thermodynamic availability in bits.

If a further piece of data, $\displaystyle{ Y_2 = y_2 }$, subsequently comes in, the probability distribution for $\displaystyle{ x }$ can be updated further, to give a new best guess $\displaystyle{ p(x \mid y_1, y_2, I) }$. If one reinvestigates the information gain for using $\displaystyle{ p(x \mid y_1,I) }$ rather than $\displaystyle{ p(x \mid I) }$, it turns out that it may be either greater or less than previously estimated:

For density matrices $\displaystyle{ P }$ and $\displaystyle{ Q }$ on a Hilbert space, the K–L divergence (or quantum relative entropy as it is often called in this case) from $\displaystyle{ Q }$ to $\displaystyle{ P }$ is defined to be

$\displaystyle{ \sum_x p(x \mid y_1, y_2, I) \log\left(\frac{p(x \mid y_1, y_2, I)}{p(x \mid I)}\right) }$ may be ≤ or > than $\displaystyle{ \displaystyle \sum_x p(x \mid y_1, I) \log\left(\frac{p(x \mid y_1, I)}{p(x \mid I)}\right) }$

$\displaystyle{ D_\text{KL}(P \parallel Q) = \operatorname{Tr}(P(\log(P) - \log(Q))). }$

(p 并行 q) = 操作者名{ Tr }(p (log (p)-log (q)))

and so the combined information gain does not obey the triangle inequality:

In quantum information science the minimum of $\displaystyle{ D_\text{KL}(P\parallel Q) }$ over all separable states $\displaystyle{ Q }$ can also be used as a measure of entanglement in the state $\displaystyle{ P }$.

$\displaystyle{ D_\text{KL} \big( p(x \mid y_1, y_2, I) \parallel p(x \mid I) \big) }$ may be <, = or > than $\displaystyle{ D_\text{KL}\big( p(x \mid y_1, y_2, I) \parallel p(x \mid y_1, I)\big) + D_\text{KL}\big(p(x \mid y_1, I) \parallel p(x \mid I)\big) }$

All one can say is that on average, averaging using $\displaystyle{ p(y_2 \mid y_1, x, I) }$, the two sides will average out.

### Bayesian experimental design

A common goal in Bayesian experimental design is to maximise the expected Kullback–Leibler divergence between the prior and the posterior.[12] When posteriors are approximated to be Gaussian distributions, a design maximising the expected Kullback–Leibler divergence is called Bayes d-optimal.

Just as Kullback–Leibler divergence of "actual from ambient" measures thermodynamic availability, Kullback–Leibler divergence of "reality from a model" is also useful even if the only clues we have about reality are some experimental measurements. In the former case Kullback–Leibler divergence describes distance to equilibrium or (when multiplied by ambient temperature) the amount of available work, while in the latter case it tells you about surprises that reality has up its sleeve or, in other words, how much the model has yet to learn.

## Discrimination information

Although this tool for evaluating models against systems that are accessible experimentally may be applied in any field, its application to selecting a statistical model via Akaike information criterion are particularly well described in papers and a book by Burnham and Anderson. In a nutshell the Kullback–Leibler divergence of reality from a model may be estimated, to within a constant additive term, by a function of the deviations observed between data and the model's predictions (like the mean squared deviation) . Estimates of such divergence for models that share the same additive term can in turn be used to select among models.

The Kullback–Leibler divergence $\displaystyle{ D_\text{KL}\bigl(p(x \mid H_1) \parallel p(x \mid H_0)\bigr) }$ can also be interpreted as the expected discrimination information for $\displaystyle{ H_1 }$ over $\displaystyle{ H_0 }$: the mean information per sample for discriminating in favor of a hypothesis $\displaystyle{ H_1 }$ against a hypothesis $\displaystyle{ H_0 }$, when hypothesis $\displaystyle{ H_1 }$ is true.[13] Another name for this quantity, given to it by I. J. Good, is the expected weight of evidence for $\displaystyle{ H_1 }$ over $\displaystyle{ H_0 }$ to be expected from each sample.

When trying to fit parametrized models to data there are various estimators which attempt to minimize Kullback–Leibler divergence, such as maximum likelihood and maximum spacing estimators.

The expected weight of evidence for $\displaystyle{ H_1 }$ over $\displaystyle{ H_0 }$ is not the same as the information gain expected per sample about the probability distribution $\displaystyle{ p(H) }$ of the hypotheses,

$\displaystyle{ D_\text{KL}(p(x \mid H_1) \parallel p(x \mid H_0)) \neq IG = D_\text{KL}(p(H \mid x) \parallel p(H \mid I)). }$

Kullback and Leibler themselves actually defined the divergence as:

Either of the two quantities can be used as a utility function in Bayesian experimental design, to choose an optimal next question to investigate: but they will in general lead to rather different experimental strategies.

$\displaystyle{ D_\text{KL}(P \parallel Q) + D_\text{KL}(Q \parallel P) }$

(p 并行 q) + d _ text { KL }(q 并行 p) </math >

On the entropy scale of information gain there is very little difference between near certainty and absolute certainty—coding according to a near certainty requires hardly any more bits than coding according to an absolute certainty. On the other hand, on the logit scale implied by weight of evidence, the difference between the two is enormous – infinite perhaps; this might reflect the difference between being almost sure (on a probabilistic level) that, say, the Riemann hypothesis is correct, compared to being certain that it is correct because one has a mathematical proof. These two different scales of loss function for uncertainty are both useful, according to how well each reflects the particular circumstances of the problem in question.

which is symmetric and nonnegative. This quantity has sometimes been used for feature selection in classification problems, where $\displaystyle{ P }$ and $\displaystyle{ Q }$ are the conditional pdfs of a feature under two different classes. In the Banking and Finance industries, this quantity is referred to as Population Stability Index, and is used to assess distributional shifts in model features through time.

### Principle of minimum discrimination information

An alternative is given via the $\displaystyle{ \lambda }$ divergence,

The idea of Kullback–Leibler divergence as discrimination information led Kullback to propose the Principle of 模板:Visible anchor (MDI): given new facts, a new distribution $\displaystyle{ f }$ should be chosen which is as hard to discriminate from the original distribution $\displaystyle{ f_0 }$ as possible; so that the new data produces as small an information gain $\displaystyle{ D_\text{KL}(f \parallel f_0) }$ as possible.

$\displaystyle{ D_\lambda(P \parallel Q) = \lambda D_\text{KL}(P \parallel \lambda P + (1 - \lambda)Q) + (1 - \lambda) D_\text{KL}(Q \parallel \lambda P + (1 - \lambda)Q), }$

< math > d _ lambda (p 并行 q) = lambda d _ text { KL }(p 并行 lambda p + (1-lambda) q) + (1-lambda) d _ text { KL }(q 并行 lambda p + (1-lambda) q) ，</math >

For example, if one had a prior distribution $\displaystyle{ p(x,a) }$ over $\displaystyle{ x }$ and $\displaystyle{ a }$, and subsequently learnt the true distribution of $\displaystyle{ a }$ was $\displaystyle{ u(a) }$, then the Kullback–Leibler divergence between the new joint distribution for $\displaystyle{ x }$ and $\displaystyle{ a }$, $\displaystyle{ q(x\mid a)u(a) }$, and the earlier prior distribution would be:

which can be interpreted as the expected information gain about $\displaystyle{ X }$ from discovering which probability distribution $\displaystyle{ X }$ is drawn from, $\displaystyle{ P }$ or $\displaystyle{ Q }$, if they currently have probabilities $\displaystyle{ \lambda }$ and $\displaystyle{ 1-\lambda }$ respectively.

$\displaystyle{ D_\text{KL}(q(x \mid a)u(a) \parallel p(x, a)) = \operatorname{E}_{u(a)}\left\{D_\text{KL}(q(x \mid a) \parallel p(x \mid a))\right\} + D_\text{KL}(u(a) \parallel p(a)), }$

The value $\displaystyle{ \lambda = 0.5 }$ gives the Jensen–Shannon divergence, defined by

i.e. the sum of the Kullback–Leibler divergence of $\displaystyle{ p(a) }$ the prior distribution for $\displaystyle{ a }$ from the updated distribution $\displaystyle{ u(a) }$, plus the expected value (using the probability distribution $\displaystyle{ u(a) }$) of the Kullback–Leibler divergence of the prior conditional distribution $\displaystyle{ p(x\mid a) }$ from the new conditional distribution $\displaystyle{ q(x\mid a) }$. (Note that often the later expected value is called the conditional Kullback–Leibler divergence (or conditional relative entropy) and denoted by $\displaystyle{ D_\text{KL}(q(x\mid a) \parallel p(x\mid a)) }$

$\displaystyle{ M = \frac{1}{2}(P + Q). }$

< math > m = frac {1}{2}(p + q) </math >

MDI can be seen as an extension of Laplace's Principle of Insufficient Reason, and the Principle of Maximum Entropy of E.T. Jaynes. In particular, it is the natural extension of the principle of maximum entropy from discrete to continuous distributions, for which Shannon entropy ceases to be so useful (see differential entropy), but the Kullback–Leibler divergence continues to be just as relevant.

$\displaystyle{ D_{JS} }$ can also be interpreted as the capacity of a noisy information channel with two inputs giving the output distributions $\displaystyle{ P }$ and $\displaystyle{ Q }$. The Jensen–Shannon divergence, like all f-divergences, is locally proportional to the Fisher information metric. It is similar to the Hellinger metric (in the sense that induces the same affine connection on a statistical manifold).

In the engineering literature, MDI is sometimes called the Principle of Minimum Cross-Entropy (MCE) or Minxent for short. Minimising the Kullback–Leibler divergence from $\displaystyle{ m }$ to $\displaystyle{ p }$ with respect to $\displaystyle{ m }$ is equivalent to minimizing the cross-entropy of $\displaystyle{ p }$ and $\displaystyle{ m }$, since

$\displaystyle{ \Eta(p, m) = \Eta(p) + D_\text{KL}(p \parallel m), }$

There are many other important measures of probability distance. Some of these are particularly connected with the Kullback–Leibler divergence. For example:

which is appropriate if one is trying to choose an adequate approximation to $\displaystyle{ p }$. However, this is just as often not the task one is trying to achieve. Instead, just as often it is $\displaystyle{ m }$ that is some fixed prior reference measure, and $\displaystyle{ p }$ that one is attempting to optimise by minimising $\displaystyle{ D_\text{KL}(p \parallel m) }$ subject to some constraint. This has led to some ambiguity in the literature, with some authors attempting to resolve the inconsistency by redefining cross-entropy to be $\displaystyle{ D_\text{KL}(p \parallel m) }$, rather than $\displaystyle{ \Eta(p,m) }$.

## Relationship to available work

Other notable measures of distance include the Hellinger distance, histogram intersection, Chi-squared statistic, quadratic form distance, match distance, Kolmogorov–Smirnov distance, and earth mover's distance.

Pressure versus volume plot of available work from a mole of argon gas relative to ambient, calculated as $\displaystyle{ T_o }$ times the Kullback–Leibler divergence.

Surprisals[15] add where probabilities multiply. The surprisal for an event of probability $\displaystyle{ p }$ is defined as $\displaystyle{ s = k \ln(1 / p) }$. If $\displaystyle{ k }$ is $\displaystyle{ \left\{1, 1/\ln 2, 1.38 \times 10^{-23}\right\} }$ then surprisal is in $\displaystyle{ \{ }$nats, bits, or $\displaystyle{ J/K\} }$ so that, for instance, there are $\displaystyle{ N }$ bits of surprisal for landing all "heads" on a toss of $\displaystyle{ N }$ coins.

Best-guess states (e.g. for atoms in a gas) are inferred by maximizing the average surprisal $\displaystyle{ S }$ (entropy) for a given set of control parameters (like pressure $\displaystyle{ P }$ or volume $\displaystyle{ V }$). This constrained entropy maximization, both classically[16] and quantum mechanically,[17] minimizes Gibbs availability in entropy units[18] $\displaystyle{ A \equiv -k\ln(Z) }$ where $\displaystyle{ Z }$ is a constrained multiplicity or partition function.

Just as absolute entropy serves as theoretical background for data compression, relative entropy serves as theoretical background for data differencing – the absolute entropy of a set of data in this sense being the data required to reconstruct it (minimum compressed size), while the relative entropy of a target set of data, given a source set of data, is the data required to reconstruct the target given the source (minimum size of a patch).

When temperature $\displaystyle{ T }$ is fixed, free energy ($\displaystyle{ T \times A }$) is also minimized. Thus if $\displaystyle{ T, V }$ and number of molecules $\displaystyle{ N }$ are constant, the Helmholtz free energy $\displaystyle{ F \equiv U - TS }$ (where $\displaystyle{ U }$ is energy) is minimized as a system "equilibrates." If $\displaystyle{ T }$ and $\displaystyle{ P }$ are held constant (say during processes in your body), the Gibbs free energy $\displaystyle{ G = U + PV - TS }$ is minimized instead. The change in free energy under these conditions is a measure of available work that might be done in the process. Thus available work for an ideal gas at constant temperature $\displaystyle{ T_o }$ and pressure $\displaystyle{ P_o }$ is $\displaystyle{ W = \Delta G = NkT_o\Theta(V/V_o) }$ where $\displaystyle{ V_o = NkT_o/P_o }$ and $\displaystyle{ \Theta(x) = x - 1 - \ln x \ge 0 }$ (see also Gibbs inequality).

More generally[19] the work available relative to some ambient is obtained by multiplying ambient temperature $\displaystyle{ T_o }$ by Kullback–Leibler divergence or net surprisal $\displaystyle{ \Delta I \ge 0, }$ defined as the average value of $\displaystyle{ k\ln(p/p_o) }$ where $\displaystyle{ p_o }$ is the probability of a given state under ambient conditions. For instance, the work available in equilibrating a monatomic ideal gas to ambient values of $\displaystyle{ V_o }$ and $\displaystyle{ T_o }$ is thus $\displaystyle{ W = T_o \Delta I }$, where Kullback–Leibler divergence

$\displaystyle{ \Delta I = Nk\left[\Theta\left(\frac{V}{V_o}\right) + \frac{3}{2}\Theta\left(\frac{T}{T_o}\right)\right]. }$

The resulting contours of constant Kullback–Leibler divergence, shown at right for a mole of Argon at standard temperature and pressure, for example put limits on the conversion of hot to cold as in flame-powered air-conditioning or in the unpowered device to convert boiling-water to ice-water discussed here.[20] Thus Kullback–Leibler divergence measures thermodynamic availability in bits.

## Quantum information theory

For density matrices $\displaystyle{ P }$ and $\displaystyle{ Q }$ on a Hilbert space, the K–L divergence (or quantum relative entropy as it is often called in this case) from $\displaystyle{ Q }$ to $\displaystyle{ P }$ is defined to be

$\displaystyle{ D_\text{KL}(P \parallel Q) = \operatorname{Tr}(P(\log(P) - \log(Q))). }$

In quantum information science the minimum of $\displaystyle{ D_\text{KL}(P\parallel Q) }$ over all separable states $\displaystyle{ Q }$ can also be used as a measure of entanglement in the state $\displaystyle{ P }$.

## Relationship between models and reality

Just as Kullback–Leibler divergence of "actual from ambient" measures thermodynamic availability, Kullback–Leibler divergence of "reality from a model" is also useful even if the only clues we have about reality are some experimental measurements. In the former case Kullback–Leibler divergence describes distance to equilibrium or (when multiplied by ambient temperature) the amount of available work, while in the latter case it tells you about surprises that reality has up its sleeve or, in other words, how much the model has yet to learn.

Although this tool for evaluating models against systems that are accessible experimentally may be applied in any field, its application to selecting a statistical model via Akaike information criterion are particularly well described in papers[21] and a book[22] by Burnham and Anderson. In a nutshell the Kullback–Leibler divergence of reality from a model may be estimated, to within a constant additive term, by a function of the deviations observed between data and the model's predictions (like the mean squared deviation) . Estimates of such divergence for models that share the same additive term can in turn be used to select among models.

When trying to fit parametrized models to data there are various estimators which attempt to minimize Kullback–Leibler divergence, such as maximum likelihood and maximum spacing estimators.[citation needed]

## Symmetrised divergence

Kullback and Leibler themselves actually defined the divergence as:

$\displaystyle{ D_\text{KL}(P \parallel Q) + D_\text{KL}(Q \parallel P) }$

which is symmetric and nonnegative. This quantity has sometimes been used for feature selection in classification problems, where $\displaystyle{ P }$ and $\displaystyle{ Q }$ are the conditional pdfs of a feature under two different classes. In the Banking and Finance industries, this quantity is referred to as Population Stability Index, and is used to assess distributional shifts in model features through time.

Category:Entropy and information

Category:F-divergences

An alternative is given via the $\displaystyle{ \lambda }$ divergence,

Category:Information geometry

Category:Thermodynamics

This page was moved from wikipedia:en:Kullback–Leibler divergence. Its edit history can be viewed at 相对熵/edithistory

1. {{cite journal In mathematical statistics, the Kullback–Leibler divergence (also called relative entropy) is a measure of how one probability distribution is different from a second, reference probability distribution. Applications include characterizing the relative (Shannon) entropy in information systems, randomness in continuous time-series, and information gain when comparing statistical models of inference. In contrast to variation of information, it is a distribution-wise asymmetric measure and thus does not qualify as a statistical metric of spread - it also does not satisfy the triangle inequality. In the simple case, a Kullback–Leibler divergence of 0 indicates that the two distributions in question are identical. In simplified terms, it is a measure of surprise, with diverse applications such as applied statistics, fluid mechanics, neuroscience and machine learning. 在数理统计学中，Kullback-Leibler 差异(也称为相对熵差异)是对一个概率分布和另一个参考概率分布差异的度量。应用包括描述信息系统中的相对(香农)熵，连续时间序列中的随机性，以及比较统计推断模型时的信息增益。与信息的变化不同，它是一个分布式的不对称度量，因此不能作为一个传播的统计度量——它也不能满足三角不等式。在简单的情况下，Kullback-Leibler 散度为0表明这两种分布是相同的。简而言之，它是一种出人意料的测量方法，应用广泛，如应用统计学、流体力学、神经科学和机器学习。 |last1=Kullback |first1=S. |authorlink1=Solomon Kullback |last2=Leibler |first2=R.A. |authorlink2=Richard Leibler |year = 1951 Let's consider two distributions of probability $\displaystyle{ P }$ and $\displaystyle{ Q }$. Usually, $\displaystyle{ P }$ represents the data, the observations, or a probability distribution precisely measured. Distribution $\displaystyle{ Q }$ represents instead a theory, a model, a description or an approximation of $\displaystyle{ P }$. The Kullback–Leibler divergence is then interpreted as the average difference of the number of bits required for encoding samples of $\displaystyle{ P }$ using a code optimized for $\displaystyle{ Q }$ rather than one optimized for $\displaystyle{ P }$. 让我们考虑两个概率分布: p </math > 和 < math > q </math > 。通常，p 代表的是数据、观测值或精确测量的概率分布。分布 < math > q </math > 代表的是一个理论，一个模型，一个描述或者是 < math > p </math > 的近似值。然后，Kullback-Leibler 分歧被解释为使用为 < math > q </math > 而不是为 < math > p </math > 优化的代码对 < math > p </math > 样本进行编码所需的位数的平均差异。 |title = On information and sufficiency |journal = Annals of Mathematical Statistics |volume = 22 |issue=1 The Kullback–Leibler divergence was introduced by Solomon Kullback and Richard Leibler in 1951 as the directed divergence between two distributions; Kullback preferred the term discrimination information. The divergence is discussed in Kullback's 1959 book, Information Theory and Statistics. to be Kullback-Leibler 分歧是由 Solomon Kullback 和 Richard Leibler 于1951年提出的，作为两种分布之间的定向分歧; Kullback 倾向于使用歧视信息这一术语。Kullback 在1959年出版的《信息理论与统计学》(Information Theory and Statistics)一书中讨论了这种分歧。将来 |pages=79–86 |doi=10.1214/aoms/1177729694 |mr=39968 $\displaystyle{ D_\text{KL}(P \parallel Q) = \sum_{x\in\mathcal{X}} P(x) \log\left(\frac{P(x)}{Q(x)}\right). }$ < math > d text { KL }(p 并行 q) = sum _ { x in mathcal { x } p (x) log left (frac { p (x)}{ q (x)} right) . </math > |jstor=2236703 |doi-access=free}}
2. Kullback, S. (1959), Information Theory and Statistics, John Wiley & Sons. Republished by Dover Publications in 1968; reprinted in 1978: .
3. [[Solomon Kullback $\displaystyle{ \lim_{x \to 0^{+}} x \log(x) = 0. }$ < math > lim _ { x to 0 ^ { + } x log (x) = 0. </math >|Kullback, S.]] (1987). "Letter to the Editor: The Kullback–Leibler distance For distributions $\displaystyle{ P }$ and $\displaystyle{ Q }$ of a continuous random variable, the Kullback–Leibler divergence is defined to be the integral: 对于连续型随机变量的分布 < math > p </math > 和 < math > q </math > ，Kullback-Leibler 散度被定义为整数:". The American Statistician. 41 (4): 340–341 $\displaystyle{ D_\text{KL}(P \parallel Q) = \int_{-\infty}^\infty p(x) \log\left(\frac{p(x)}{q(x)}\right)\, dx }$ (p 并行 q) = int _ {-infty } ^ infty p (x) log left (frac { p (x)}{ q (x)} right) ，dx </math >. doi:[//doi.org/10.1080%2F00031305.1987.10475510%0A%0Awhere+%7F%27%22%60UNIQ--math-0000029F-QINU%60%22%27%7F+and+%7F%27%22%60UNIQ--math-000002A0-QINU%60%22%27%7F+denote+the+probability+densities+of+%7F%27%22%60UNIQ--math-000002A1-QINU%60%22%27%7F+and+%7F%27%22%60UNIQ--math-000002A2-QINU%60%22%27%7F.%0A%0A%E8%BF%99%E9%87%8C+%3C+math+%3E+%E5%92%8C+%3C+math+%3E+q+%3C%2Fmath+%3E+%E8%A1%A8%E7%A4%BA+%3C+math+%3E+p+%3C%2Fmath+%3E+%E5%92%8C+%3C+math+%3E+q+%3C%2Fmath+%3E+%E7%9A%84%E6%A6%82%E7%8E%87%E5%AF%86%E5%BA%A6%E3%80%82 10.1080/00031305.1987.10475510 where '"UNIQ--math-0000029F-QINU"' and '"UNIQ--math-000002A0-QINU"' denote the probability densities of '"UNIQ--math-000002A1-QINU"' and '"UNIQ--math-000002A2-QINU"'. 这里 < math > 和 < math > q </math > 表示 < math > p </math > 和 < math > q </math > 的概率密度。] Check |doi= value (help). JSTOR 2684769. line feed character in |doi= at position 31 (help); line feed character in |title= at position 52 (help); line feed character in |pages= at position 8 (help); line feed character in |authorlink= at position 17 (help); Check |author-link1= value (help)
4. MacKay, David J.C. (2003). Information Theory, Inference, and Learning Algorithms (First ed.). Cambridge University Press. p. 34. ISBN 9780521642989.
5. Bishop C. (2006). Pattern Recognition and Machine Learning
6. Burnham, K. P.; Anderson, D. R. (2002). Model Selection and Multi-Model Inference (2nd ed.). Springer. p. 51. ISBN 9780387953649.
7. Hobson, Arthur (1971). Concepts in statistical mechanics.. New York: Gordon and Breach. ISBN 978-0677032405.
8. Sanov, I.N. (1957). "On the probability of large deviations of random magnitudes". Mat. Sbornik. 42 (84): 11–44.
9. Novak S.Y. (2011), Extreme Value Methods with Applications to Finance ch. 14.5 (Chapman & Hall). .
10. See the section "differential entropy – 4" in Relative Entropy video lecture by Sergio Verdú NIPS 2009
11. Duchi J., "Derivations for Linear Algebra and Optimization".
12. Chaloner, K.; Verdinelli, I. (1995). "Bayesian experimental design: a review". Statistical Science. 10 (3): 273–304. doi:10.1214/ss/1177009939.
13. Press, W.H.; Teukolsky, S.A.; Vetterling, W.T.; Flannery, B.P. (2007). "Section 14.7.2. Kullback–Leibler Distance". Numerical Recipes: The Art of Scientific Computing (3rd ed.). Cambridge University Press. ISBN 978-0-521-88068-8.
14. Thomas, Joy A. (1991), Elements of Information Theory where $\displaystyle{ M }$ is the average of the two distributions, 其中 m 是两个分布的平均值, John Wiley & Sons Unknown parameter |$\displaystyle{ D_\text{JS} = \frac{1}{2} D_\text{KL} (P \parallel M) + \frac{1}{2} D_\text{KL}(Q \parallel M) }$ {2} d text {1}{2} d text { KL }(p 并行 m) + frac {1}{2} d text { KL }(q 并行 m) </math > last1= ignored (help); line feed character in |title= at position 31 (help); |first1= missing |last1= (help)
15. Myron Tribus (1961), Thermodynamics and Thermostatics (D. Van Nostrand, New York)
16. Jaynes, E. T. (1957). "Information theory and statistical mechanics" (PDF). Physical Review. 106 (4): 620–630. Bibcode:1957PhRv..106..620J. doi:10.1103/physrev.106.620.
17. Jaynes, E. T. (1957). "Information theory and statistical mechanics II" (PDF). Physical Review. 108 (2): 171–190. Bibcode:1957PhRv..108..171J. doi:10.1103/physrev.108.171.
18. J.W. Gibbs (1873), "A method of geometrical representation of thermodynamic properties of substances by means of surfaces", reprinted in The Collected Works of J. W. Gibbs, Volume I Thermodynamics, ed. W. R. Longley and R. G. Van Name (New York: Longmans, Green, 1931) footnote page 52.
19. Tribus, M.; McIrvine, E. C. (1971). "Energy and information". Scientific American. 224 (3): 179–186. Bibcode:1971SciAm.225c.179T. doi:10.1038/scientificamerican0971-179.
20. Fraundorf, P. (2007). "Thermal roots of correlation-based complexity". Complexity. 13 (3): 18–26. arXiv:1103.2481. Bibcode:2008Cmplx..13c..18F. doi:10.1002/cplx.20195. Archived from the original on 2011-08-13.
21. Burnham, K.P.; Anderson, D.R. (2001). "Kullback–Leibler information as a basis for strong inference in ecological studies". Wildlife Research. 28 (2): 111–119. doi:10.1071/WR99107.
22. Burnham, K. P. and Anderson D. R. (2002), Model Selection and Multimodel Inference: A Practical Information-Theoretic Approach, Second Edition (Springer Science) .