Differential Entropy

What this note builds
  1. 01Differential entropyentropy of a density, which can be negative
  2. 02Continuous AEPthe typical set has volume about 2nh2^{nh}
  3. 03Quantizationbinning at width Δ\Delta costs h+log⁡1Δh + \log \frac{1}{\Delta} bits, which diverges
  4. 04Mutual informationunlike hh, it stays non-negative and scale-free
  5. 05Transformationsshifting leaves hh unchanged, scaling by aa adds log⁡∣a∣\log \lvert a \rvert
  6. 06Gaussian maximizes entropythe largest hh for a given covariance
· 25 min read · 4,953 words

Motivation: the wire carries voltages, not letters

Every quantity so far has assumed a finite alphabet: 26 keys, two symbols, an erasure. But the actual copper wire carries a voltage — a real number — and so does every other physical channel: the amplitude of a radio signal, the position of a needle, the temperature of a sensor. If information theory cannot price a continuous source, it cannot price most of the systems it was invented for.

The obvious move is to replace the sum with an integral and the pmf with a density. That move mostly works, and the resulting quantity — differential entropy — is related to shortest description length and is similar in many ways to discrete entropy. But there are important differences, and there is need for some care in using the concept.

WarningRead this before the definition

The asymptotic-equipartition-property note already flagged the trap: for a continuous XX, plugging into the discrete formula gives H(X)=+∞H(X) = +\infty identically, because every single point has probability zero. Telling someone a real number to infinite precision costs infinite bits, and that is not an artifact — it is true. Differential entropy is therefore not “the entropy of a continuous variable”; it is a different functional that happens to obey many of the same identities. The whole of Relation to discrete entropy exists to say exactly how the two are related and where the missing infinity went.


Definitions

DefinitionContinuous random variable and density

Let XX have cumulative distribution function F(x)=Pr⁡(X≤x)F(x) = \Pr(X \le x). If F(x)F(x) is continuous, XX is said to be continuous. Let f(x)=F′(x)f(x) = F'(x) where the derivative is defined. If ∫−∞∞f(x) dx=1\int_{-\infty}^{\infty} f(x)\,dx = 1, then f(x)f(x) is the probability density function for XX. The set where f(x)>0f(x) > 0 is the support set of XX.

DefinitionDifferential entropy

The differential entropy h(X)h(X) of a continuous random variable XX with density f(x)f(x) is

h(X)=−∫Sf(x)log⁡f(x) dxh(X) = - \int_S f(x) \log f(x) \, dx

where SS is the support set of the random variable.

ComponentDetail
Signatureh:{densities on Rn}→[−∞,∞]h : \{\text{densities on } \mathbb{R}^n\} \rightarrow [-\infty, \infty] — note the negative values are allowed, unlike HH.
DomainThe density ff, not the variable. As in the discrete case it depends only on the probability law, so it is sometimes written h(f)h(f) rather than h(X)h(X).
CodomainAn extended real number. Interpreting it takes work — see Relation to discrete entropy; it is not “average bits of surprise”.

Caution“If it exists”

As in every statement involving an integral, or even a density, we should append if it exists. It is easy to construct random variables for which no density exists, or for which the above integral does not exist. Every theorem below carries this silent hypothesis.

WarningNotation collision

Cover uses lowercase hh for differential entropy, and we used lowercase hh in the first note for the self-information h(p)=−log⁡2ph(p) = -\log_2 p. They are unrelated. From here on hh means differential entropy; where surprise is meant it is written −log⁡p(x)-\log p(x) explicitly.

Two worked densities

ExampleUniform distribution on [0,a][0, a]

The density is 1/a1/a on [0,a][0,a] and 0 elsewhere, so

h(X)=−∫0a1alog⁡1a dx=log⁡ah(X) = - \int_0^a \frac{1}{a} \log \frac{1}{a} \, dx = \log a

ImportantDifferential entropy can be negative

For a<1a < 1 we get log⁡a<0\log a < 0. Unlike discrete entropy, differential entropy can be negative — which immediately kills any reading of it as “a number of bits”. What is always sensible is the exponential: 2h(X)=2log⁡a=a2^{h(X)} = 2^{\log a} = a is the volume of the support set, which is non-negative as we expect. Keep this in mind: throughout this chapter the meaningful object is often 2h2^h rather than hh.

ExampleNormal distribution

Let X∼ϕ(x)=12πσ2e−x2/2σ2X \sim \phi(x) = \frac{1}{\sqrt{2\pi\sigma^2}} e^{-x^2/2\sigma^2}. Computing in nats:

h(ϕ)=−∫ϕln⁡ϕ=−∫ϕ(x)[−x22σ2−ln⁡2πσ2]dxh(\phi) = - \int \phi \ln \phi = - \int \phi(x) \left[ -\frac{x^2}{2\sigma^2} - \ln\sqrt{2\pi\sigma^2} \right] dx

Split the two terms. The first is an expectation of x2x^2, the second a constant pulled out of a density that integrates to 1:

=EX22σ2+12ln⁡2πσ2=12+12ln⁡2πσ2= \frac{\mathbb{E}X^2}{2\sigma^2} + \frac{1}{2}\ln 2\pi\sigma^2 = \frac{1}{2} + \frac{1}{2}\ln 2\pi\sigma^2

using EX2=σ2\mathbb{E}X^2 = \sigma^2. Now absorb the 12\tfrac12 using 12=12ln⁡e\tfrac12 = \tfrac12 \ln e:

=12ln⁡e+12ln⁡2πσ2=12ln⁡2πeσ2 nats= \frac{1}{2}\ln e + \frac{1}{2}\ln 2\pi\sigma^2 = \frac{1}{2} \ln 2\pi e \sigma^2 \text{ nats}

FormulaDifferential entropy of a Gaussian

h(ϕ)=12log⁡2πeσ2 bitsh(\phi) = \frac{1}{2} \log 2\pi e \sigma^2 \text{ bits}

IntuitionReading the Gaussian formula

Entropy depends on σ\sigma but not on the mean — sliding the bell curve along the axis does not change how spread out it is (formalized later as translation invariance). And it grows like log⁡σ\log \sigma: doubling the spread buys exactly one more bit, matching the intuition that you need one extra bit of precision to locate a point in a range twice as wide.


AEP for continuous random variables

One of the important roles of discrete entropy is in the AEP: p(X1,…,Xn)p(X_1, \ldots, X_n) is close to 2−nH2^{-nH} with high probability, which lets us define the typical set. We can do exactly the same for continuous variables — with volume replacing cardinality.

TheoremContinuous AEP

Let X1,X2,…,XnX_1, X_2, \ldots, X_n be drawn i.i.d. according to the density f(x)f(x). Then

−1nlog⁡f(X1,X2,…,Xn)⟶E[−log⁡f(X)]=h(X)in probability-\frac{1}{n} \log f(X_1, X_2, \ldots, X_n) \longrightarrow \mathbb{E}[-\log f(X)] = h(X) \quad \text{in probability}

ProofIdentical to the discrete case

Independence makes −1nlog⁡f(Xn)=−1n∑ilog⁡f(Xi)-\frac1n \log f(X^n) = -\frac1n \sum_i \log f(X_i) a sample mean of i.i.d. terms; the weak law of large numbers sends it to E[−log⁡f(X)]=h(X)\mathbb{E}[-\log f(X)] = h(X). The argument is the same three lines as in the discrete AEP — nothing about the proof cared whether the alphabet was finite.

∎

DefinitionTypical set (continuous)

For ϵ>0\epsilon > 0 and any nn,

Aϵ(n)={(x1,…,xn)∈Sn:∣−1nlog⁡f(x1,…,xn)−h(X)∣≤ϵ}A_\epsilon^{(n)} = \left\{ (x_1, \ldots, x_n) \in S^n : \left\lvert -\frac{1}{n} \log f(x_1, \ldots, x_n) - h(X) \right\rvert \le \epsilon \right\}

where f(x1,…,xn)=∏i=1nf(xi)f(x_1, \ldots, x_n) = \prod_{i=1}^n f(x_i).

DefinitionVolume

The volume of a set A⊂RnA \subset \mathbb{R}^n is

Vol(A)=∫Adx1 dx2⋯dxn\text{Vol}(A) = \int_A dx_1\, dx_2 \cdots dx_n

IntuitionWhat replaces “counting the tapes”

In the discrete case we counted how many typical tapes there were. Here there are uncountably many, so counting is meaningless — but volume is the natural analogue, and every discrete statement about ∣Aϵ(n)∣\lvert A_\epsilon^{(n)} \rvert has a continuous counterpart about Vol(Aϵ(n))\text{Vol}(A_\epsilon^{(n)}) with the same exponent.

TheoremProperties of the continuous typical set

  1. Pr⁡(Aϵ(n))>1−ϵ\Pr\big(A_\epsilon^{(n)}\big) > 1 - \epsilon for nn sufficiently large.
  2. Vol(Aϵ(n))≤2n(h(X)+ϵ)\text{Vol}\big(A_\epsilon^{(n)}\big) \le 2^{n(h(X) + \epsilon)} for all nn.
  3. Vol(Aϵ(n))≥(1−ϵ)2n(h(X)−ϵ)\text{Vol}\big(A_\epsilon^{(n)}\big) \ge (1-\epsilon) 2^{n(h(X) - \epsilon)} for nn sufficiently large.
ProofIntegrate instead of sum; otherwise line-for-line the discrete proof

Property 1 is the continuous AEP restated as a probability, exactly as in the discrete case.

Property 2 — upper bound. Start from total probability and restrict to the typical set:

1=∫Snf(x1,…,xn) dxn≥∫Aϵ(n)f(x1,…,xn) dxn1 = \int_{S^n} f(x_1, \ldots, x_n)\, dx^n \ge \int_{A_\epsilon^{(n)}} f(x_1, \ldots, x_n)\, dx^n

Every typical point has density at least 2−n(h(X)+ϵ)2^{-n(h(X)+\epsilon)}, so

≥∫Aϵ(n)2−n(h(X)+ϵ) dxn=2−n(h(X)+ϵ)∫Aϵ(n)dxn=2−n(h(X)+ϵ)Vol(Aϵ(n))\ge \int_{A_\epsilon^{(n)}} 2^{-n(h(X)+\epsilon)}\, dx^n = 2^{-n(h(X)+\epsilon)} \int_{A_\epsilon^{(n)}} dx^n = 2^{-n(h(X)+\epsilon)} \text{Vol}\big(A_\epsilon^{(n)}\big)

The one substantive change from the discrete proof: pulling the constant out of the integral leaves ∫dxn\int dx^n, which is the volume, where in the discrete case it left a bare sum of 1’s, which was the count. Rearranging gives property 2.

Property 3 — lower bound. For nn large enough that property 1 holds,

1−ϵ≤∫Aϵ(n)f(xn) dxn≤∫Aϵ(n)2−n(h(X)−ϵ)dxn=2−n(h(X)−ϵ)Vol(Aϵ(n))1 - \epsilon \le \int_{A_\epsilon^{(n)}} f(x^n)\, dx^n \le \int_{A_\epsilon^{(n)}} 2^{-n(h(X)-\epsilon)} dx^n = 2^{-n(h(X)-\epsilon)} \text{Vol}\big(A_\epsilon^{(n)}\big)

using the density ceiling this time. Rearranging gives property 3.

Together, for nn sufficiently large:

(1−ϵ)2n(h(X)−ϵ)≤Vol(Aϵ(n))≤2n(h(X)+ϵ)(1-\epsilon) 2^{n(h(X)-\epsilon)} \le \text{Vol}\big(A_\epsilon^{(n)}\big) \le 2^{n(h(X)+\epsilon)}

∎

TheoremMinimality

The set Aϵ(n)A_\epsilon^{(n)} is the smallest volume set with probability ≥1−ϵ\ge 1 - \epsilon, to first order in the exponent. (Proof: same as the discrete case.)

ImportantThe interpretation of differential entropy

The smallest set containing most of the probability has volume about 2nh2^{nh}. That is an nn-dimensional volume, so the corresponding side length is

(2nh)1/n=2h\big(2^{nh}\big)^{1/n} = 2^h

So: differential entropy is the logarithm of the equivalent side length of the smallest set containing most of the probability. Low entropy means the variable is confined to a small effective volume; high entropy means it is widely dispersed. This is the reading that makes negative values unsurprising — a side length below 1 has a negative logarithm, and nothing is wrong.

NoteA related quantity

Just as entropy is related to the volume of the typical set, there is a quantity called Fisher information related to its surface area.


Relation to discrete entropy

The problem. We now have two objects — HH for discrete variables, hh for continuous — that share almost all their algebra but are not the same kind of thing. What exactly is the relationship? The answer comes from quantization: chop the real line into bins and watch what happens as the bins shrink.

Setup. Divide the range of XX into bins of length Δ\Delta, and assume the density is continuous within bins. By the mean value theorem there exists a value xix_i within each bin such that

f(xi)Δ=∫iΔ(i+1)Δf(x) dxf(x_i)\Delta = \int_{i\Delta}^{(i+1)\Delta} f(x)\, dx

Define the quantized random variable

XΔ=xiif iΔ≤X<(i+1)ΔX^\Delta = x_i \quad \text{if } i\Delta \le X < (i+1)\Delta

so that pi=Pr⁡(XΔ=xi)=f(xi)Δp_i = \Pr(X^\Delta = x_i) = f(x_i)\Delta. This is a genuinely discrete variable, so its HH is well defined.

DerivationEntropy of the quantized variable

Step 1: Write the discrete entropy.

H(XΔ)=−∑−∞∞pilog⁡pi=−∑−∞∞f(xi)Δlog⁡(f(xi)Δ)H(X^\Delta) = - \sum_{-\infty}^{\infty} p_i \log p_i = - \sum_{-\infty}^{\infty} f(x_i)\Delta \log\big(f(x_i)\Delta\big)

Step 2: Split the logarithm of the product.

=−∑Δf(xi)log⁡f(xi)−∑Δf(xi)log⁡Δ= - \sum \Delta f(x_i) \log f(x_i) - \sum \Delta f(x_i) \log \Delta

Step 3: Collapse the second sum. Since ∑Δf(xi)=∫f(x) dx=1\sum \Delta f(x_i) = \int f(x)\,dx = 1, the second term is just log⁡Δ\log \Delta:

H(XΔ)=−∑Δf(xi)log⁡f(xi)−log⁡ΔH(X^\Delta) = - \sum \Delta f(x_i) \log f(x_i) - \log \Delta

Step 4: Take Δ→0\Delta \to 0. If f(x)log⁡f(x)f(x)\log f(x) is Riemann integrable — a condition needed to ensure the limit is well defined — the first term approaches −∫f(x)log⁡f(x) dx=h(f)-\int f(x)\log f(x)\,dx = h(f) by the definition of Riemann integrability.

TheoremQuantization relation

If the density f(x)f(x) of XX is Riemann integrable, then

H(XΔ)+log⁡Δ⟶h(f)=h(X)as Δ→0H(X^\Delta) + \log \Delta \longrightarrow h(f) = h(X) \qquad \text{as } \Delta \rightarrow 0

ImportantWhere the infinity went

Rearranged, H(XΔ)≈h(X)−log⁡Δ=h(X)+log⁡1ΔH(X^\Delta) \approx h(X) - \log\Delta = h(X) + \log\frac{1}{\Delta}. As Δ→0\Delta \to 0 the term log⁡1Δ\log\frac1\Delta diverges — that is the infinite cost of specifying a real number exactly, exactly as warned at the top. Differential entropy is what is left over after that divergence is subtracted off. It is a relative quantity, measured against the precision scale, which is why it carries no absolute meaning and can be negative.

Concretely: setting Δ=2−n\Delta = 2^{-n}, the entropy of an nn-bit quantization of XX is approximately h(X)+nh(X) + n.

ExampleThree quantizations

  1. XX uniform on [0,1][0,1], Δ=2−n\Delta = 2^{-n}: here h=0h = 0 and H(XΔ)=nH(X^\Delta) = n, so nn bits suffice to describe XX to nn-bit accuracy — the baseline.
  2. XX uniform on [0,18][0, \tfrac18]: the first 3 bits after the point must be 0, so describing XX to nn-bit accuracy requires only n−3n - 3 bits. This agrees with h(X)=log⁡18=−3h(X) = \log \tfrac18 = -3 — and gives the negative entropy a perfectly concrete meaning: a 3-bit discount.
  3. X∼N(0,σ2)X \sim N(0, \sigma^2) with σ2=100\sigma^2 = 100: describing XX to nn-bit accuracy costs on average n+12log⁡(2πeσ2)=n+5.37n + \tfrac12 \log(2\pi e \sigma^2) = n + 5.37 bits — a surcharge, because the distribution is spread over far more than a unit interval.

In general, h(X)+nh(X) + n is the average number of bits required to describe XX to nn-bit accuracy.

RemarkA discrete variable has h=−∞h = -\infty

Consistently, the differential entropy of a discrete random variable can be considered −∞-\infty: then 2−∞=02^{-\infty} = 0, agreeing with the fact that the support set of a discrete variable has volume zero.


Joint and conditional differential entropy

The extensions are the obvious ones, with integrals in place of sums.

DefinitionJoint differential entropy

h(X1,X2,…,Xn)=−∫f(xn)log⁡f(xn) dxnh(X_1, X_2, \ldots, X_n) = - \int f(x^n) \log f(x^n) \, dx^n

DefinitionConditional differential entropy

If X,YX, Y have joint density f(x,y)f(x,y),

h(X∣Y)=−∫f(x,y)log⁡f(x∣y) dx dyh(X \mid Y) = - \int f(x,y) \log f(x \mid y) \, dx\, dy

Since f(x∣y)=f(x,y)/f(y)f(x \mid y) = f(x,y)/f(y) in general, we can also write

h(X∣Y)=h(X,Y)−h(Y)h(X \mid Y) = h(X, Y) - h(Y)

CautionSubtracting infinities

The identity h(X∣Y)=h(X,Y)−h(Y)h(X \mid Y) = h(X,Y) - h(Y) requires care if any of the differential entropies are infinite — the right-hand side can be ∞−∞\infty - \infty. This is a real hazard here in a way it never was for discrete entropy on a finite alphabet.

IntuitionNote the shape is the same as before

This is the conditional entropy pattern verbatim: joint density as the outside weight, conditional density inside the logarithm. The justification is identical — we average over how often both events co-occur, but measure the surprise of XX given YY already happened.

TheoremEntropy of a multivariate normal

Let X1,…,XnX_1, \ldots, X_n have a multivariate normal distribution with mean μ\mu and covariance matrix KK. Then

h(X1,…,Xn)=h(Nn(μ,K))=12log⁡(2πe)n∣K∣ bitsh(X_1, \ldots, X_n) = h\big(\mathcal{N}_n(\mu, K)\big) = \frac{1}{2} \log (2\pi e)^n \lvert K \rvert \text{ bits}

where ∣K∣\lvert K \rvert is the determinant of KK.

ProofThe quadratic form in the exponent has a trace that collapses

Step 1: Write the density and take −Elog⁡-\mathbb{E}\log. The pdf is

f(x)=12π n∣K∣1/2e−12(x−μ)TK−1(x−μ)f(x) = \frac{1}{\sqrt{2\pi}^{\,n} \lvert K \rvert^{1/2}} e^{-\frac{1}{2}(x-\mu)^T K^{-1} (x-\mu)}

so, in nats,

h(f)=−∫f(x)[−12(x−μ)TK−1(x−μ)−ln⁡2π n∣K∣1/2]dxh(f) = - \int f(x)\left[ -\frac{1}{2}(x-\mu)^T K^{-1}(x-\mu) - \ln \sqrt{2\pi}^{\,n}\lvert K\rvert^{1/2} \right] dx

=12E[∑i,j(Xi−μi)(K−1)ij(Xj−μj)]+12ln⁡(2π)n∣K∣= \frac{1}{2}\mathbb{E}\left[ \sum_{i,j} (X_i - \mu_i)\big(K^{-1}\big)_{ij} (X_j - \mu_j) \right] + \frac{1}{2}\ln(2\pi)^n \lvert K \rvert

Step 2: Push the expectation inside — this is the key move. Expectation is linear and (K−1)ij\big(K^{-1}\big)_{ij} is a constant, so

=12∑i,jE[(Xj−μj)(Xi−μi)](K−1)ij+12ln⁡(2π)n∣K∣= \frac{1}{2}\sum_{i,j} \mathbb{E}\big[(X_j - \mu_j)(X_i - \mu_i)\big] \big(K^{-1}\big)_{ij} + \frac{1}{2}\ln(2\pi)^n \lvert K \rvert

Step 3: Recognize the covariance and contract. The expectation is exactly KjiK_{ji}, so the double sum is a matrix product traced out:

=12∑i,jKji(K−1)ij+⋯=12∑j(KK−1)jj+⋯=12∑jIjj+⋯=n2+12ln⁡(2π)n∣K∣= \frac{1}{2}\sum_{i,j} K_{ji}\big(K^{-1}\big)_{ij} + \cdots = \frac{1}{2}\sum_j \big(KK^{-1}\big)_{jj} + \cdots = \frac{1}{2}\sum_j I_{jj} + \cdots = \frac{n}{2} + \frac{1}{2}\ln(2\pi)^n\lvert K \rvert

Step 4: Absorb n/2n/2 using n2=12ln⁡en\tfrac{n}{2} = \tfrac12 \ln e^n.

=12ln⁡(2πe)n∣K∣ nats=12log⁡(2πe)n∣K∣ bits= \frac{1}{2}\ln (2\pi e)^n \lvert K \rvert \text{ nats} = \frac{1}{2}\log(2\pi e)^n\lvert K\rvert \text{ bits}

∎

IntuitionThe determinant is the volume

∣K∣\lvert K \rvert is the squared volume of the ellipsoid the Gaussian occupies, so this formula is the scalar case 12log⁡2πeσ2\tfrac12\log 2\pi e\sigma^2 with σ2→∣K∣\sigma^2 \to \lvert K \rvert — again entropy is log-volume, consistent with the typical-set reading above.


Relative entropy and mutual information

DefinitionRelative entropy between densities

D(f∥g)=∫flog⁡fgD(f \Vert g) = \int f \log \frac{f}{g}

D(f∥g)D(f \Vert g) is finite only if the support set of ff is contained in the support set of gg. Motivated by continuity, we set 0log⁡00=00\log\frac00 = 0.

IntuitionThe same infinite penalty as before

The support condition is the continuous form of the warning from the discrete case: if your codebook gg assigns zero probability to something reality ff actually produces, the penalty is infinite. Nothing has changed except sums becoming integrals.

DefinitionMutual information between densities

I(X;Y)=∫f(x,y)log⁡f(x,y)f(x)f(y) dx dyI(X;Y) = \int f(x,y) \log \frac{f(x,y)}{f(x)f(y)}\, dx\, dy

FormulaThe familiar identities survive intact

I(X;Y)=h(X)−h(X∣Y)=h(Y)−h(Y∣X)=h(X)+h(Y)−h(X,Y)I(X;Y) = h(X) - h(X \mid Y) = h(Y) - h(Y \mid X) = h(X) + h(Y) - h(X,Y)

I(X;Y)=D(f(x,y) ∥ f(x)f(y))I(X;Y) = D\big(f(x,y) \,\Vert\, f(x)f(y)\big)

ImportantMutual information is the well-behaved one

This is the crucial asymmetry of the chapter. Differential entropy is scale-dependent and can be negative; mutual information is neither. It is the limit of the mutual information between quantized versions:

I(XΔ;YΔ)=H(XΔ)−H(XΔ∣YΔ)≈(h(X)−log⁡Δ)−(h(X∣Y)−log⁡Δ)=I(X;Y)I(X^\Delta; Y^\Delta) = H(X^\Delta) - H(X^\Delta \mid Y^\Delta) \approx \big(h(X) - \log\Delta\big) - \big(h(X\mid Y) - \log \Delta\big) = I(X;Y)

The log⁡Δ\log\Delta terms cancel. The divergence that made hh a relative quantity affects both terms equally and drops out of the difference. This is exactly why the asymptotic-equipartition-property note said differential entropy “is best treated as a term inside invariant expressions such as DKLD_{\mathrm{KL}} or mutual information” — here is the cancellation that makes it so.

The master definition

DefinitionMutual information via partitions

Let X\mathcal{X} be the range of XX. A partition PP of X\mathcal{X} is a finite collection of disjoint sets PiP_i with ∪iPi=X\cup_i P_i = \mathcal{X}. The quantization of XX by PP, denoted [X]P[X]_P, is the discrete random variable with Pr⁡([X]P=i)=Pr⁡(X∈Pi)=∫PidF(x)\Pr([X]_P = i) = \Pr(X \in P_i) = \int_{P_i} dF(x). Then

I(X;Y)=sup⁡P,QI([X]P;[Y]Q)I(X;Y) = \sup_{P, Q} I\big([X]_P ; [Y]_Q\big)

where the supremum is over all finite partitions PP and QQ.

ImportantWhy this is the definition that always works

This is the master definition of mutual information: it applies to any joint distribution — ones with atoms, with densities, and with singular parts — and needs no density to exist. Refining the partitions gives a monotonically increasing sequence I([X]P;[Y]Q)↗II([X]_P; [Y]_Q) \nearrow I, so the supremum is a genuine limit rather than an abstract bound. It reduces to the integral formula for variables with a density, and to the discrete definition for discrete variables.

Note that no such master definition exists for hh — there is no partition-based quantity converging to differential entropy, because the corresponding sequence diverges. Another way of seeing that II is the fundamental object and hh the derived, fragile one.

ExampleMutual information between correlated Gaussians

Let (X,Y)∼N(0,K)(X, Y) \sim \mathcal{N}(0, K) with

K=[σ2ρσ2ρσ2σ2]K = \begin{bmatrix} \sigma^2 & \rho\sigma^2 \\ \rho\sigma^2 & \sigma^2 \end{bmatrix}

Then h(X)=h(Y)=12log⁡(2πe)σ2h(X) = h(Y) = \tfrac12\log(2\pi e)\sigma^2, and since ∣K∣=σ4(1−ρ2)\lvert K \rvert = \sigma^4(1-\rho^2), h(X,Y)=12log⁡(2πe)2σ4(1−ρ2)h(X,Y) = \tfrac12 \log(2\pi e)^2 \sigma^4 (1-\rho^2). So

I(X;Y)=h(X)+h(Y)−h(X,Y)=−12log⁡(1−ρ2)I(X;Y) = h(X) + h(Y) - h(X,Y) = -\frac{1}{2}\log(1 - \rho^2)

Sanity checks: if ρ=0\rho = 0, XX and YY are independent and I=−12log⁡1=0I = -\tfrac12\log 1 = 0. If ρ=±1\rho = \pm 1 they are perfectly correlated and I=∞I = \infty — knowing one pins the other to infinite precision, which is infinitely many bits. Note the individual hh‘s depend on σ\sigma but II does not: rescaling both variables cannot change how much one says about the other.


Properties

TheoremInformation inequality

D(f∥g)≥0D(f \Vert g) \ge 0 with equality iff f=gf = g almost everywhere.

ProofJensen, exactly as in the discrete case

Let SS be the support set of ff:

−D(f∥g)=∫Sflog⁡gf  ≤Jensen  log⁡∫Sfgf=log⁡∫Sg≤log⁡1=0-D(f\Vert g) = \int_S f \log \frac{g}{f} \;\overset{\text{Jensen}}{\le}\; \log \int_S f \frac{g}{f} = \log \int_S g \le \log 1 = 0

The middle step is Jensen’s inequality applied to the concave log⁡\log (pulling it outside the integral), and the last holds because ∫Sg≤1\int_S g \le 1 when SS is only part of gg‘s support. Equality requires equality in Jensen, which occurs iff f=gf = g a.e.

∎

CorollaryNon-negativity and conditioning

  • I(X;Y)≥0I(X;Y) \ge 0, with equality iff XX and YY are independent.
  • h(X∣Y)≤h(X)h(X \mid Y) \le h(X), with equality iff XX and YY are independent.

ImportantWhat did and did not survive the transition

Note carefully: I≥0I \ge 0 survives, but h≥0h \ge 0 does not. Conditioning still reduces entropy, and relative entropy is still non-negative — every inequality between entropies carries over, because the divergent log⁡1Δ\log\frac1\Delta appears on both sides and cancels. Only the statements about the absolute level of hh fail.

TheoremChain rule for differential entropy

h(X1,X2,…,Xn)=∑i=1nh(Xi∣X1,…,Xi−1)h(X_1, X_2, \ldots, X_n) = \sum_{i=1}^n h(X_i \mid X_1, \ldots, X_{i-1})

(Follows directly from the definitions, as in the discrete case.)

CorollaryIndependence bound

h(X1,X2,…,Xn)≤∑i=1nh(Xi)h(X_1, X_2, \ldots, X_n) \le \sum_{i=1}^n h(X_i) with equality iff the XiX_i are independent. (Chain rule plus “conditioning reduces entropy”.)

ExampleApplication — Hadamard’s inequality

Let X∼N(0,K)X \sim \mathcal{N}(0, K) and apply the independence bound. The left side is 12log⁡(2πe)n∣K∣\tfrac12\log(2\pi e)^n\lvert K\rvert and each right-side term is 12log⁡2πeKii\tfrac12\log 2\pi e K_{ii}, so

∣K∣≤∏i=1nKii\lvert K \rvert \le \prod_{i=1}^n K_{ii}

which is Hadamard’s inequality — a purely linear-algebraic fact, obtained for free from an information-theoretic one. A number of determinant inequalities can be derived this way.

Behaviour under transformations

TheoremTranslation invariance

h(X+c)=h(X)h(X + c) = h(X) (Immediate from the definition — shifting the density along the axis changes nothing inside the integral.)

TheoremScaling

h(aX)=h(X)+log⁡∣a∣h(aX) = h(X) + \log \lvert a \rvert

ProofChange of variables

Let Y=aXY = aX, so fY(y)=1∣a∣fX ⁣(ya)f_Y(y) = \frac{1}{\lvert a\rvert} f_X\!\left(\frac{y}{a}\right). Then

h(aX)=−∫1∣a∣fX ⁣(ya)log⁡[1∣a∣fX ⁣(ya)]dyh(aX) = - \int \frac{1}{\lvert a\rvert} f_X\!\left(\frac{y}{a}\right) \log \left[ \frac{1}{\lvert a\rvert} f_X\!\left(\frac{y}{a}\right) \right] dy

Substituting x=y/ax = y/a (so dy=∣a∣dxdy = \lvert a \rvert dx) and splitting the logarithm:

=−∫fX(x)log⁡fX(x) dx+log⁡∣a∣=h(X)+log⁡∣a∣= - \int f_X(x) \log f_X(x)\, dx + \log\lvert a\rvert = h(X) + \log \lvert a \rvert

∎

CorollaryLinear maps

h(AX)=h(X)+log⁡∣det⁡(A)∣h(AX) = h(X) + \log \lvert \det(A) \rvert

WarningThis is the non-invariance the AEP note warned about

Discrete entropy is invariant under any relabelling; differential entropy is not. Stretching the variable by aa adds log⁡∣a∣\log\lvert a\rvert bits, because it stretches the typical volume by the same factor. Switching from volts to millivolts changes hh by log⁡1000\log 1000 without changing a single physical fact — which is the sharpest possible statement that hh is not an intrinsic property of the random variable, only of the variable together with a choice of scale. Once again, I(X;Y)I(X;Y) is immune: the log⁡∣a∣\log\lvert a \rvert cancels in the difference.

The Gaussian maximizes entropy

TheoremMaximum entropy under a covariance constraint

Let X∈RnX \in \mathbb{R}^n have zero mean and covariance K=EXXtK = \mathbb{E}XX^t. Then

h(X)≤12log⁡(2πe)n∣K∣h(X) \le \frac{1}{2}\log(2\pi e)^n \lvert K \rvert

with equality iff X∼N(0,K)X \sim \mathcal{N}(0, K).

ProofA relative-entropy trick: the cross term is blind to which density it sees

Let gg be any density with ∫g(x)xixj dx=Kij\int g(x) x_i x_j\, dx = K_{ij}, and let ϕK\phi_K be the N(0,K)\mathcal{N}(0,K) density. Start from non-negativity:

0≤D(g∥ϕK)=∫glog⁡gϕK=−h(g)−∫glog⁡ϕK0 \le D(g \Vert \phi_K) = \int g \log\frac{g}{\phi_K} = -h(g) - \int g \log \phi_K

The key step: log⁡ϕK(x)\log \phi_K(x) is a quadratic form in xx, so ∫glog⁡ϕK\int g \log\phi_K depends on gg only through its second moments — which by assumption match those of ϕK\phi_K. Hence we may substitute:

∫glog⁡ϕK=∫ϕKlog⁡ϕK\int g \log \phi_K = \int \phi_K \log \phi_K

and the right side is −h(ϕK)-h(\phi_K). Therefore

0≤−h(g)+h(ϕK)⟹h(g)≤h(ϕK)0 \le -h(g) + h(\phi_K) \quad \Longrightarrow \quad h(g) \le h(\phi_K)

∎

IntuitionWhy the Gaussian, and why this proof is slick

The constraint fixes the covariance — the “energy budget” or the spread. Among all densities with that spread, the Gaussian is the most dispersed, hence the most uncertain. The proof works because the Gaussian’s log-density is exactly a quadratic form, so the constraint we imposed is precisely the statistic the comparison term depends on. This pairing of a constraint with an exponential family is the general recipe for maximum-entropy results.

Compare the discrete maximum entropy bound H(X)≤log⁡∣X∣H(X) \le \log\lvert\mathcal{X}\rvert, proved by the same D(p∥u)≥0D(p\Vert u) \ge 0 trick against the uniform. Same argument, different reference distribution: uniform when the constraint is a bounded alphabet, Gaussian when the constraint is a covariance.


Estimation error and differential entropy

The problem. Fano’s inequality bounded the probability of error when guessing a discrete symbol. For a continuous variable, “wrong” is the wrong question — any estimate is wrong with probability 1. The right question is how far off you are, and the natural measure is squared error. Fano’s continuous counterpart therefore bounds variance rather than error probability.

TheoremEstimation counterpart to Fano’s inequality

For any random variable XX and estimator X^\hat{X}, with h(X)h(X) in nats,

E(X−X^)2≥12πee2h(X)\mathbb{E}(X - \hat{X})^2 \ge \frac{1}{2\pi e} e^{2h(X)}

with equality if and only if XX is Gaussian and X^\hat{X} is the mean of XX.

ProofBest estimator, then maximum entropy in reverse

E(X−X^)2  ≥(a)  min⁡X^E(X−X^)2=E(X−E(X))2=var(X)  ≥(b)  12πee2h(X)\mathbb{E}(X-\hat{X})^2 \;\overset{(a)}{\ge}\; \min_{\hat{X}} \mathbb{E}(X-\hat{X})^2 = \mathbb{E}\big(X - \mathbb{E}(X)\big)^2 = \text{var}(X) \;\overset{(b)}{\ge}\; \frac{1}{2\pi e} e^{2h(X)}

where (a) uses that the mean is the best mean-squared estimator, and (b) is the maximum-entropy theorem read backwards: since h(X)≤12ln⁡2πe var(X)h(X) \le \tfrac12\ln 2\pi e\,\text{var}(X), solving for the variance gives var(X)≥12πee2h(X)\text{var}(X) \ge \frac{1}{2\pi e}e^{2h(X)}. Equality in (a) needs X^\hat{X} to be the mean; equality in (b) needs XX Gaussian.

∎

CorollaryWith side information

Given side information YY and estimator X^(Y)\hat{X}(Y),

E(X−X^(Y))2≥12πee2h(X∣Y)\mathbb{E}\big(X - \hat{X}(Y)\big)^2 \ge \frac{1}{2\pi e} e^{2h(X \mid Y)}

IntuitionWhat this says physically

You cannot estimate a variable more accurately than its differential entropy permits. A source with high hh occupies a large effective volume, and no amount of cleverness shrinks your expected squared error below that volume’s scale. The corollary is the useful engineering form: observing YY helps exactly insofar as it reduces h(X∣Y)h(X \mid Y) — which, by the identity I(X;Y)=h(X)−h(X∣Y)I(X;Y) = h(X) - h(X\mid Y), means the estimation gain is governed by the mutual information the observation carries. This is the bridge from information theory to estimation theory.


Quick reference

ObjectFormulaNote
Differential entropyh(X)=−∫Sflog⁡fh(X) = -\int_S f\log fCan be negative; not “bits of surprise”.
Uniform on [0,a][0,a]h=log⁡ah = \log a2h=a2^h = a, the support volume.
Gaussianh=12log⁡2πeσ2h = \tfrac12\log 2\pi e\sigma^2Mean-independent.
Multivariate normalh=12log⁡(2πe)n∣K∣h = \tfrac12\log(2\pi e)^n\lvert K\rvertDeterminant == volume.
Continuous AEP−1nlog⁡f(Xn)→h(X)-\tfrac1n\log f(X^n) \to h(X) in prob.Same weak-law proof.
Typical volume(1−ϵ)2n(h−ϵ)≤Vol≤2n(h+ϵ)(1-\epsilon)2^{n(h-\epsilon)} \le \text{Vol} \le 2^{n(h+\epsilon)}Volume replaces cardinality.
Interpretationside length =2h= 2^{h}Log of the effective side length.
QuantizationH(XΔ)+log⁡Δ→h(X)H(X^\Delta) + \log\Delta \to h(X)nn-bit description costs ≈h(X)+n\approx h(X) + n.
Relative entropyD(f∥g)=∫flog⁡fgD(f\Vert g) = \int f\log\frac fg≥0\ge 0; needs supp(f)⊆supp(g)\text{supp}(f) \subseteq \text{supp}(g).
Mutual informationI=h(X)−h(X∣Y)=D(fXY∥fXfY)I = h(X) - h(X\mid Y) = D(f_{XY}\Vert f_Xf_Y)≥0\ge 0, scale-invariant, has a master definition.
Correlated GaussiansI=−12log⁡(1−ρ2)I = -\tfrac12\log(1-\rho^2)00 at ρ=0\rho=0, ∞\infty at ρ=±1\rho=\pm1.
Translationh(X+c)=h(X)h(X+c) = h(X)—
Scalingh(aX)=h(X)+log⁡∣a∣h(aX) = h(X) + \log\lvert a\rvert; h(AX)=h(X)+log⁡∣det⁡A∣h(AX) = h(X) + \log\lvert\det A\rvertNot relabelling-invariant.
Max entropyh(X)≤12log⁡(2πe)n∣K∣h(X) \le \tfrac12\log(2\pi e)^n\lvert K\rvertGaussian is extremal at fixed covariance.
Estimation boundE(X−X^)2≥12πee2h(X)\mathbb{E}(X-\hat X)^2 \ge \frac{1}{2\pi e}e^{2h(X)}Fano’s continuous counterpart.

What carries over from the discrete theory, and what does not:

SurvivesFails
D≥0D \ge 0, I≥0I \ge 0h≥0h \ge 0 — differential entropy can be negative
Chain rules for hh, II, DDRelabelling invariance — hh shifts by log⁡∣det⁡A∣\log\lvert\det A\rvert
Conditioning reduces entropyAbsolute interpretation as “bits” — only hh differences mean anything
Independence bound, max-entropy argumentsA partition-based master definition of hh (exists for II only)
The AEP and typical-set machinery, with volume for cardinalityFiniteness — ∞−∞\infty - \infty is a real hazard in h(X∣Y)=h(X,Y)−h(Y)h(X\mid Y) = h(X,Y) - h(Y)

The one-line summary: hh is discrete entropy minus the divergent log⁡1Δ\log\frac{1}{\Delta} cost of infinite precision, so it is a quantity relative to a scale. Every identity in which that divergence cancels — every difference of entropies — survives intact; every statement about the absolute level of hh does not.

References

← All notes