Differential Entropy
Entropy of continuous random variables, the continuous AEP and volume of the typical set, the quantization relation, the Gaussian as maximum-entropy distribution, and the estimation counterpart to Fano
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 , plugging into the discrete formula gives 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 exists to say exactly how the two are related and where the missing infinity went.
Definitions
DefinitionContinuous random variable and density
Let have cumulative distribution function . If is continuous, is said to be continuous. Let where the derivative is defined. If , then is the probability density function for . The set where is the support set of .
DefinitionDifferential entropy
The differential entropy of a continuous random variable with density is
where is the support set of the random variable.
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 for differential entropy, and we used lowercase in the first note for the self-information . They are unrelated. From here on means differential entropy; where surprise is meant it is written explicitly.
Two worked densities
ExampleUniform distribution on
The density is on and 0 elsewhere, so
ImportantDifferential entropy can be negative
For we get . 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: 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 rather than .
ExampleNormal distribution
Let . Computing in nats:
Split the two terms. The first is an expectation of , the second a constant pulled out of a density that integrates to 1:
using . Now absorb the using :
FormulaDifferential entropy of a Gaussian
IntuitionReading the Gaussian formula
Entropy depends on but not on the mean — sliding the bell curve along the axis does not change how spread out it is (formalized later as ). And it grows like : 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: is close to 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 be drawn i.i.d. according to the density . Then
ProofIdentical to the discrete case
Independence makes a sample mean of i.i.d. terms; the weak law of large numbers sends it to . 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 and any ,
where .
DefinitionVolume
The volume of a set is
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 has a continuous counterpart about with the same exponent.
TheoremProperties of the continuous typical set
- for sufficiently large.
- for all .
- for 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:
Every typical point has density at least , so
The one substantive change from the discrete proof: pulling the constant out of the integral leaves , 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 large enough that property 1 holds,
using the density ceiling this time. Rearranging gives property 3.
Together, for sufficiently large:
∎
TheoremMinimality
The set is the smallest volume set with probability , 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 . That is an -dimensional volume, so the corresponding side length is
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 — for discrete variables, 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 into bins of length , and assume the density is continuous within bins. By the mean value theorem there exists a value within each bin such that
Define the quantized random variable
so that . This is a genuinely discrete variable, so its is well defined.
DerivationEntropy of the quantized variable
Step 1: Write the discrete entropy.
Step 2: Split the logarithm of the product.
Step 3: Collapse the second sum. Since , the second term is just :
Step 4: Take . If is Riemann integrable — a condition needed to ensure the limit is well defined — the first term approaches by the definition of Riemann integrability.
TheoremQuantization relation
If the density of is Riemann integrable, then
ImportantWhere the infinity went
Rearranged, . As the term 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 , the entropy of an -bit quantization of is approximately .
ExampleThree quantizations
- uniform on , : here and , so bits suffice to describe to -bit accuracy — the baseline.
- uniform on : the first 3 bits after the point must be 0, so describing to -bit accuracy requires only bits. This agrees with — and gives the negative entropy a perfectly concrete meaning: a 3-bit discount.
- with : describing to -bit accuracy costs on average bits — a surcharge, because the distribution is spread over far more than a unit interval.
In general, is the average number of bits required to describe to -bit accuracy.
RemarkA discrete variable has
Consistently, the differential entropy of a discrete random variable can be considered : then , 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
DefinitionConditional differential entropy
If have joint density ,
Since in general, we can also write
CautionSubtracting infinities
The identity requires care if any of the differential entropies are infinite — the right-hand side can be . 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 [[entropy-mutual-information#Conditional entropy |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 given already happened.
TheoremEntropy of a multivariate normal
Let have a multivariate normal distribution with mean and covariance matrix . Then
where is the determinant of .
ProofThe quadratic form in the exponent has a trace that collapses
Step 1: Write the density and take . The pdf is
so, in nats,
Step 2: Push the expectation inside — this is the key move. Expectation is linear and is a constant, so
Step 3: Recognize the covariance and contract. The expectation is exactly , so the double sum is a matrix product traced out:
Step 4: Absorb using .
∎
IntuitionThe determinant is the volume
is the squared volume of the ellipsoid the Gaussian occupies, so this formula is the scalar case with — again entropy is log-volume, consistent with the typical-set reading above.
Relative entropy and mutual information
DefinitionRelative entropy between densities
is finite only if the support set of is contained in the support set of . Motivated by continuity, we set .
IntuitionThe same infinite penalty as before
The support condition is the continuous form of the warning from the discrete case: if your codebook assigns zero probability to something reality actually produces, the penalty is infinite. Nothing has changed except sums becoming integrals.
DefinitionMutual information between densities
FormulaThe familiar identities survive intact
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:
The terms cancel. The divergence that made 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 or mutual information” — here is the cancellation that makes it so.
The master definition
DefinitionMutual information via partitions
Let be the range of . A partition of is a finite collection of disjoint sets with . The quantization of by , denoted , is the discrete random variable with . Then
where the supremum is over all finite partitions and .
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 , 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 — there is no partition-based quantity converging to differential entropy, because the corresponding sequence diverges. Another way of seeing that is the fundamental object and the derived, fragile one.
ExampleMutual information between correlated Gaussians
Let with
Then , and since , . So
Sanity checks: if , and are independent and . If they are perfectly correlated and — knowing one pins the other to infinite precision, which is infinitely many bits. Note the individual ‘s depend on but does not: rescaling both variables cannot change how much one says about the other.
Properties
TheoremInformation inequality
with equality iff almost everywhere.
ProofJensen, exactly as in the discrete case
Let be the support set of :
The middle step is Jensen’s inequality applied to the concave (pulling it outside the integral), and the last holds because when is only part of ‘s support. Equality requires equality in Jensen, which occurs iff a.e.
∎
CorollaryNon-negativity and conditioning
- , with equality iff and are independent.
- , with equality iff and are independent.
ImportantWhat did and did not survive the transition
Note carefully: survives, but does not. Conditioning still reduces entropy, and relative entropy is still non-negative — every inequality between entropies carries over, because the divergent appears on both sides and cancels. Only the statements about the absolute level of fail.
TheoremChain rule for differential entropy
(Follows directly from the definitions, as in the [[entropy-mutual-information#Chain rule for entropy ( variables)|discrete case]].)
CorollaryIndependence bound
with equality iff the are independent. (Chain rule plus “conditioning reduces entropy”.)
ExampleApplication — Hadamard’s inequality
Let and apply the independence bound. The left side is and each right-side term is , so
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
(Immediate from the definition — shifting the density along the axis changes nothing inside the integral.)
TheoremScaling
ProofChange of variables
Let , so . Then
Substituting (so ) and splitting the logarithm:
∎
CorollaryLinear maps
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 adds bits, because it stretches the typical volume by the same factor. Switching from volts to millivolts changes by without changing a single physical fact — which is the sharpest possible statement that is not an intrinsic property of the random variable, only of the variable together with a choice of scale. Once again, is immune: the cancels in the difference.
The Gaussian maximizes entropy
TheoremMaximum entropy under a covariance constraint
Let have zero mean and covariance . Then
with equality iff .
ProofA relative-entropy trick: the cross term is blind to which density it sees
Let be any density with , and let be the density. Start from non-negativity:
The key step: is a quadratic form in , so depends on only through its second moments — which by assumption match those of . Hence we may substitute:
and the right side is . Therefore
∎
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 , proved by the same 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 and estimator , with in nats,
with equality if and only if is Gaussian and is the mean of .
ProofBest estimator, then maximum entropy in reverse
where (a) uses that the mean is the best mean-squared estimator, and (b) is the maximum-entropy theorem read backwards: since , solving for the variance gives . Equality in (a) needs to be the mean; equality in (b) needs Gaussian.
∎
CorollaryWith side information
Given side information and estimator ,
IntuitionWhat this says physically
You cannot estimate a variable more accurately than its differential entropy permits. A source with high 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 helps exactly insofar as it reduces — which, by the identity , 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
| Object | Formula | Note |
|---|---|---|
| Differential entropy | Can be negative; not “bits of surprise”. | |
| Uniform on | , the support volume. | |
| Gaussian | Mean-independent. | |
| Multivariate normal | Determinant volume. | |
| Continuous AEP | in prob. | Same weak-law proof. |
| Typical volume | Volume replaces cardinality. | |
| Interpretation | side length | Log of the effective side length. |
| Quantization | -bit description costs . | |
| Relative entropy | ; needs . | |
| Mutual information | , scale-invariant, has a master definition. | |
| Correlated Gaussians | at , at . | |
| Translation | — | |
| Scaling | ; | Not relabelling-invariant. |
| Max entropy | Gaussian is extremal at fixed covariance. | |
| Estimation bound | Fano’s continuous counterpart. |
What carries over from the discrete theory, and what does not:
| Survives | Fails |
|---|---|
| , | — differential entropy can be negative |
| Chain rules for , , | Relabelling invariance — shifts by |
| Conditioning reduces entropy | Absolute interpretation as “bits” — only differences mean anything |
| Independence bound, max-entropy arguments | A partition-based master definition of (exists for only) |
| The AEP and typical-set machinery, with volume for cardinality | Finiteness — is a real hazard in |
The one-line summary: is discrete entropy minus the divergent 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 does not.
References
- [[lit/cover2006-elements|Cover & Thomas, Elements of Information Theory]] — Chapter 8