Information Theory and Statistics

The method of types, universal source coding, Sanov's theorem and large deviations, the conditional limit theorem, hypothesis testing, Chernoff–Stein and Chernoff information, and Fisher information

· 37 min read · 7,252 words

Motivation: from typical sequences to exact empirical distributions

The AEP focused our attention on a small subset of typical sequences — those whose sample entropy is close to HH. The method of types is an even more powerful procedure: instead of grouping sequences by their sample entropy, we group them by their exact empirical distribution.

IntuitionWhy the finer grouping is stronger

Typicality is a one-number summary: a tape is typical if its average surprise is right. Two tapes with wildly different letter frequencies can both be typical of different sources. Grouping by the full empirical distribution keeps all that information, and with this restriction we can derive strong bounds — not just “to first order in the exponent” — on the number of sequences with a particular empirical distribution and on the probability of each.

This buys us, in this chapter alone: strong error bounds for channel coding, a variety of rate distortion results, the probability of rare events (large deviations), the existence of universal source codes, the best possible error exponents in hypothesis testing, and the connection to parameter estimation via Fisher information.

NoteNotational convention for this chapter

Capital letters denote types and distributions. We write xnx^n and xx interchangeably for a sequence x1,,xnx_1, \ldots, x_n, and use “distribution” loosely to mean a probability mass function.


The method of types

DefinitionType

The type PxP_x (or empirical probability distribution) of a sequence x1,,xnx_1, \ldots, x_n is the relative proportion of occurrences of each symbol:

Px(a)=N(ax)nfor all aXP_x(a) = \frac{N(a \mid x)}{n} \quad \text{for all } a \in \mathcal{X}

where N(ax)N(a\mid x) is the number of times aa occurs in xXnx \in \mathcal{X}^n. The type is itself a pmf on X\mathcal{X}.

DefinitionProbability simplex, Pn\mathcal{P}_n, type class

  • The probability simplex in Rm\mathbb{R}^m is {x:xi0,i=1mxi=1}\{x : x_i \ge 0, \sum_{i=1}^m x_i = 1\} — an (m1)(m-1)-dimensional manifold in mm-space. For m=3m=3 it is a triangular flat in R3\mathbb{R}^3, which is why we draw the simplex as a triangle.
  • Pn\mathcal{P}_n denotes the set of types with denominator nn. For X={0,1}\mathcal{X} = \{0,1\}: Pn={(0n,nn),(1n,n1n),,(nn,0n)}\mathcal{P}_n = \left\{\left(\tfrac{0}{n},\tfrac{n}{n}\right), \left(\tfrac1n,\tfrac{n-1}{n}\right), \ldots, \left(\tfrac{n}{n},\tfrac0n\right)\right\}
  • If PPnP \in \mathcal{P}_n, the type class is T(P)={xXn:Px=P}T(P) = \{x \in \mathcal{X}^n : P_x = P\}, sometimes called the composition class.

ExampleA ternary sequence

Let X={1,2,3}\mathcal{X} = \{1,2,3\} and x=11321x = 11321. Then Px(1)=35P_x(1) = \tfrac35, Px(2)=15P_x(2) = \tfrac15, Px(3)=15P_x(3) = \tfrac15. The type class is all length-5 sequences with three 1’s, one 2 and one 3:

T(Px)={11123,11132,11213,,32111},T(P)=(53,1,1)=5!3!1!1!=20T(P_x) = \{11123, 11132, 11213, \ldots, 32111\}, \qquad \lvert T(P)\rvert = \binom{5}{3,1,1} = \frac{5!}{3!\,1!\,1!} = 20

The four fundamental theorems

Theorem1. There are only polynomially many types

Pn(n+1)X\lvert \mathcal{P}_n \rvert \le (n+1)^{\lvert\mathcal{X}\rvert}

ProofCount the numerators

There are X\lvert\mathcal{X}\rvert components in the vector specifying PxP_x, and the numerator in each can take only n+1n+1 values, so there are at most (n+1)X(n+1)^{\lvert\mathcal{X}\rvert} choices. These are not independent (the last is fixed by the others), but the bound is good enough.

ImportantThe crucial point

There are only a polynomial number of types of length nn, while the number of sequences is exponential in nn. It follows that at least one type has exponentially many sequences in its class — in fact the largest type class has essentially the same number of elements as the entire set of sequences, to first order in the exponent. Polynomially many buckets, exponentially many items: this asymmetry is the engine of the whole chapter.

Theorem2. The probability of a sequence depends only on its type

If X1,,XnX_1,\ldots,X_n are i.i.d. Q(x)\sim Q(x), then

Qn(x)=2n(H(Px)+D(PxQ))Q^n(x) = 2^{-n\left(H(P_x) + D(P_x \Vert Q)\right)}

ProofRewrite the product by symbol counts, then add and subtract logPx(a)\log P_x(a)

Qn(x)=i=1nQ(xi)=aXQ(a)N(ax)=aQ(a)nPx(a)=a2nPx(a)logQ(a)Q^n(x) = \prod_{i=1}^n Q(x_i) = \prod_{a\in\mathcal{X}} Q(a)^{N(a\mid x)} = \prod_a Q(a)^{nP_x(a)} = \prod_a 2^{nP_x(a)\log Q(a)}

Now the trick: add and subtract Px(a)logPx(a)P_x(a)\log P_x(a) inside the exponent,

=a2n(Px(a)logQ(a)Px(a)logPx(a)+Px(a)logPx(a))=2na(Px(a)logPx(a)Q(a)+Px(a)logPx(a))= \prod_a 2^{n\left(P_x(a)\log Q(a) - P_x(a)\log P_x(a) + P_x(a)\log P_x(a)\right)} = 2^{n\sum_a\left(-P_x(a)\log\frac{P_x(a)}{Q(a)} + P_x(a)\log P_x(a)\right)}

=2n(D(PxQ)H(Px))= 2^{n\left(-D(P_x\Vert Q) - H(P_x)\right)}

CorollaryIf xx is in the type class of QQ

Then Px=QP_x = Q, so D(PxQ)=0D(P_x\Vert Q) = 0 and Qn(x)=2nH(Q)Q^n(x) = 2^{-nH(Q)}.

ExampleFair and unfair dice

A fair die producing a sequence with precisely n/6n/6 of each face has probability 2nH(1/6,,1/6)=6n2^{-nH(1/6,\ldots,1/6)} = 6^{-n} — obvious. But if the die has pmf (13,13,16,112,112,0)(\tfrac13,\tfrac13,\tfrac16,\tfrac1{12},\tfrac1{12},0), the probability of a particular sequence with precisely these frequencies is exactly 2nH(1/3,1/3,1/6,1/12,1/12,0)2^{-nH(1/3,1/3,1/6,1/12,1/12,0)} (for nn a multiple of 12). That is more interesting: whenever the type matches the source, DD vanishes and the probability is exactly 2nH2^{-nH}.

Theorem3. Size of a type class

For any type PPnP \in \mathcal{P}_n,

1(n+1)X2nH(P)T(P)2nH(P)\frac{1}{(n+1)^{\lvert\mathcal{X}\rvert}}2^{nH(P)} \le \lvert T(P)\rvert \le 2^{nH(P)}

ProofUpper bound from total probability; lower bound from ”T(P)T(P) is the most likely class under PP

The exact size is the multinomial (nnP(a1),,nP(aX))\binom{n}{nP(a_1),\ldots,nP(a_{\lvert\mathcal{X}\rvert})}, hard to manipulate, so we derive exponential bounds. (Stirling’s formula also works; this argument is cleaner.)

Upper bound. A type class has probability at most 1 under its own distribution:

1Pn(T(P))=xT(P)Pn(x)=xT(P)2nH(P)=T(P)2nH(P)1 \ge P^n(T(P)) = \sum_{x\in T(P)} P^n(x) = \sum_{x\in T(P)} 2^{-nH(P)} = \lvert T(P)\rvert 2^{-nH(P)}

using Theorem 2’s corollary. Hence T(P)2nH(P)\lvert T(P)\rvert \le 2^{nH(P)}.

Lower bound, step 1: T(P)T(P) has the highest probability of any type class under PP. For any P^Pn\hat P \in \mathcal{P}_n, the ratio of probabilities is

Pn(T(P))Pn(T(P^))=T(P)T(P^)aP(a)n(P(a)P^(a))=a(nP^(a))!(nP(a))!P(a)n(P(a)P^(a))\frac{P^n(T(P))}{P^n(T(\hat P))} = \frac{\lvert T(P)\rvert}{\lvert T(\hat P)\rvert}\prod_a P(a)^{n(P(a) - \hat P(a))} = \prod_a \frac{(n\hat P(a))!}{(nP(a))!}P(a)^{n(P(a)-\hat P(a))}

Using the simple bound m!n!nmn\frac{m!}{n!} \ge n^{m-n} (prove by separately considering mnm\ge n and m<nm<n):

a(nP(a))nP^(a)nP(a)P(a)n(P(a)P^(a))=ann(P^(a)P(a))=nn(11)=1\ge \prod_a (nP(a))^{n\hat P(a) - nP(a)}P(a)^{n(P(a)-\hat P(a))} = \prod_a n^{n(\hat P(a) - P(a))} = n^{n(1-1)} = 1

Lower bound, step 2. Since there are at most (n+1)X(n+1)^{\lvert\mathcal{X}\rvert} types and T(P)T(P) is the most probable,

1=QPnPn(T(Q))(n+1)XPn(T(P))=(n+1)XT(P)2nH(P)1 = \sum_{Q\in\mathcal{P}_n} P^n(T(Q)) \le (n+1)^{\lvert\mathcal{X}\rvert}P^n(T(P)) = (n+1)^{\lvert\mathcal{X}\rvert}\lvert T(P)\rvert 2^{-nH(P)}

ExampleBinary alphabet: (nk)2nH(k/n)\binom nk \doteq 2^{nH(k/n)}

Here the type is determined by the number of 1’s, so T(P)=(nk)\lvert T(P)\rvert = \binom nk, and we show 1n+12nH(k/n)(nk)2nH(k/n)\frac{1}{n+1}2^{nH(k/n)} \le \binom nk \le 2^{nH(k/n)}.

Upper bound. From the binomial formula k=0n(nk)pk(1p)nk=1\sum_{k=0}^n \binom nk p^k(1-p)^{n-k} = 1 with all terms positive, each term is 1\le 1. Set p=k/np = k/n and take the kkth term:

1(nk)(kn)k(1kn)nk=(nk)2n(knlogkn+nknlognkn)=(nk)2nH(k/n)1 \ge \binom nk \left(\frac kn\right)^k\left(1 - \frac kn\right)^{n-k} = \binom nk 2^{n\left(\frac kn\log\frac kn + \frac{n-k}{n}\log\frac{n-k}{n}\right)} = \binom nk 2^{-nH(k/n)}

Lower bound. Let SBinomial(n,p)S \sim \text{Binomial}(n,p). Its most likely value is S=npS = np (check via P(S=i+1)P(S=i)=nii+1p1p\frac{P(S=i+1)}{P(S=i)} = \frac{n-i}{i+1}\frac{p}{1-p}, considering i<npi<np and i>npi>np). Since there are n+1n+1 terms,

1(n+1)maxk(nk)pk(1p)nk=(n+1)(nnp)pnp(1p)nnp1 \le (n+1)\max_k \binom nk p^k(1-p)^{n-k} = (n+1)\binom{n}{np}p^{np}(1-p)^{n-np}

Setting p=k/np = k/n and rerunning the algebra above gives (nk)1n+12nH(k/n)\binom nk \ge \frac{1}{n+1}2^{nH(k/n)}.

Theorem4. Probability of a type class

For any PPnP \in \mathcal{P}_n and any distribution QQ,

1(n+1)X2nD(PQ)Qn(T(P))2nD(PQ)\frac{1}{(n+1)^{\lvert\mathcal{X}\rvert}}2^{-nD(P\Vert Q)} \le Q^n(T(P)) \le 2^{-nD(P\Vert Q)}

ProofCombine Theorems 2 and 3

Qn(T(P))=xT(P)Qn(x)=T(P)2n(D(PQ)+H(P))Q^n(T(P)) = \sum_{x\in T(P)}Q^n(x) = \lvert T(P)\rvert\, 2^{-n(D(P\Vert Q)+H(P))} and substitute the bounds on T(P)\lvert T(P)\rvert: the 2nH(P)2^{nH(P)} cancels the 2nH(P)2^{-nH(P)} exactly, leaving 2nD(PQ)2^{-nD(P\Vert Q)} up to the polynomial factor.

The four equations

ImportantEverything that follows rests on these

Pn(n+1)X,Qn(x)=2n(D(PxQ)+H(Px))\lvert \mathcal{P}_n\rvert \le (n+1)^{\lvert\mathcal{X}\rvert}, \qquad Q^n(x) = 2^{-n(D(P_x\Vert Q) + H(P_x))}

T(P)2nH(P),Qn(T(P))2nD(PQ)\lvert T(P)\rvert \doteq 2^{nH(P)}, \qquad Q^n(T(P)) \doteq 2^{-nD(P\Vert Q)}

In words: only polynomially many types; exponentially many sequences of each type; an exact formula for a sequence’s probability; and an approximate formula for a type class’s probability.

IntuitionThe two exponents and what they mean

Read the middle equation as a decomposition of surprise: a sequence’s improbability under QQ splits into H(Px)H(P_x) — how spread out its own empirical distribution is — plus D(PxQ)D(P_x\Vert Q) — how far that empirical distribution sits from the truth. The first term is paid by every sequence of that type; the second is the penalty for looking unlike the source, and it is what makes atypical types exponentially rare.


Law of large numbers, via types

DerivationThe weak law falls out of the four equations

Define a typical set by relative entropy: TQϵ={xn:D(PxnQ)ϵ}T_Q^\epsilon = \{x^n : D(P_{x^n}\Vert Q)\le\epsilon\}. Then

1Qn(TQϵ)=P:D(PQ)>ϵQn(T(P))P:D>ϵ2nD(PQ)P:D>ϵ2nϵ1 - Q^n(T_Q^\epsilon) = \sum_{P : D(P\Vert Q) > \epsilon} Q^n(T(P)) \le \sum_{P:D>\epsilon} 2^{-nD(P\Vert Q)} \le \sum_{P:D>\epsilon}2^{-n\epsilon}

(n+1)X2nϵ=2n(ϵXlog(n+1)n)\le (n+1)^{\lvert\mathcal{X}\rvert}2^{-n\epsilon} = 2^{-n\left(\epsilon - \lvert\mathcal{X}\rvert\frac{\log(n+1)}{n}\right)}

using Theorem 4 then Theorem 1. This is the whole argument: an exponentially small probability per bad type, times only polynomially many bad types. The bound 0\to 0, so Qn(TQϵ)1Q^n(T_Q^\epsilon)\to1.

TheoremConvergence of the empirical distribution

Let X1,,XnX_1,\ldots,X_n be i.i.d. P\sim P. Then

Pr{D(PxnP)>ϵ}2n(ϵXlog(n+1)n)\Pr\{D(P_{x^n}\Vert P) > \epsilon\} \le 2^{-n\left(\epsilon - \lvert\mathcal{X}\rvert\frac{\log(n+1)}{n}\right)}

and consequently D(PxnP)0D(P_{x^n}\Vert P)\to 0 with probability 1.

ProofBorel–Cantelli

The inequality is the derivation above. Summing over nn gives n=1Pr{D(PxnP)>ϵ}<\sum_{n=1}^\infty \Pr\{D(P_{x^n}\Vert P)>\epsilon\} < \infty, so the expected number of occurrences of the event is finite, hence the actual number is finite with probability 1 (Borel–Cantelli) — giving almost-sure convergence, stronger than the in-probability statement of the AEP.

DefinitionStrongly typical set

Aϵ(n)={xXn:1nN(ax)P(a)<ϵX if P(a)>0;N(ax)=0 if P(a)=0}A_\epsilon^{*(n)} = \left\{x\in\mathcal{X}^n : \left\lvert \tfrac1n N(a\mid x) - P(a)\right\rvert < \tfrac{\epsilon}{\lvert\mathcal{X}\rvert} \text{ if } P(a)>0; \quad N(a\mid x) = 0 \text{ if } P(a)=0\right\}

The type must not differ from the true probabilities by more than ϵ/X\epsilon/\lvert\mathcal{X}\rvert in any component. By the strong law, its probability 1\to1.

NoteWhere strong typicality is needed

The additional power is useful in universal coding, rate distortion theory, and large deviation theory — in particular the two-sided bound that the covering argument required.


Universal source coding

The problem. Huffman coding compresses an i.i.d. source with known p(x)p(x) to its entropy limit H(X)H(X). If the code is designed for the wrong distribution q(x)q(x), a penalty of D(pq)D(p\Vert q) is incurred — so Huffman coding is sensitive to the assumed distribution. What if the true distribution is unknown? Is there a universal code of rate RR that suffices to describe every i.i.d. source with H(X)<RH(X) < R?

IntuitionThe surprising answer is yes, and the four equations say why

There are 2nH(P)2^{nH(P)} sequences of type PP, and only polynomially many types. So an enumeration of all sequences xnx^n whose type satisfies H(Pxn)<RH(P_{x^n}) < R requires roughly nRnR bits — the polynomial factor costs a vanishing number of bits per symbol. Describing all such sequences prepares us for any distribution QQ with H(Q)<RH(Q) < R, without knowing which.

DefinitionUniversal code

A fixed-rate block code of rate RR for a source with unknown distribution QQ is an encoder fn:Xn{1,,2nR}f_n : \mathcal{X}^n \to \{1,\ldots,2^{nR}\} and decoder ϕn:{1,,2nR}Xn\phi_n : \{1,\ldots,2^{nR}\}\to\mathcal{X}^n, with Pe(n)=Qn(Xn:ϕn(fn(Xn))Xn)P_e^{(n)} = Q^n(X^n : \phi_n(f_n(X^n))\ne X^n).

It is universal if fnf_n and ϕn\phi_n do not depend on QQ and Pe(n)0P_e^{(n)}\to0 whenever R>H(Q)R > H(Q).

TheoremExistence of universal source codes

There exists a sequence of (2nR,n)(2^{nR},n) universal source codes with Pe(n)0P_e^{(n)}\to0 for every source QQ with H(Q)<RH(Q) < R.

ProofEncode every sequence whose type has low enough entropy

Step 1: Define the set. Let Rn=RXlog(n+1)nR_n = R - \lvert\mathcal{X}\rvert\frac{\log(n+1)}{n} (the rate, discounted by the polynomial type count) and

A={xXn:H(Px)Rn}A = \{x \in \mathcal{X}^n : H(P_x) \le R_n\}

Step 2: Check it fits in 2nR2^{nR} indices.

A=PPn:H(P)RnT(P)P:H(P)Rn2nH(P)P:H(P)Rn2nRn\lvert A\rvert = \sum_{P\in\mathcal{P}_n : H(P)\le R_n}\lvert T(P)\rvert \le \sum_{P : H(P)\le R_n}2^{nH(P)} \le \sum_{P:H(P)\le R_n}2^{nR_n}

(n+1)X2nRn=2n(Rn+Xlog(n+1)n)=2nR\le (n+1)^{\lvert\mathcal{X}\rvert}2^{nR_n} = 2^{n\left(R_n + \lvert\mathcal{X}\rvert\frac{\log(n+1)}{n}\right)} = 2^{nR}

This is exactly why RnR_n was defined with that discount — it is sized precisely to absorb the polynomial number of types.

Step 3: Encode. fn(x)f_n(x) is the index of xx in AA if xAx\in A, else 0. The decoder maps each index to the corresponding element, so all of AA is recovered and everything else errs.

Step 4: Error probability. With true distribution QQ, H(Q)<RH(Q)<R:

Pe(n)=1Qn(A)=P:H(P)>RnQn(T(P))(n+1)XmaxP:H(P)>RnQn(T(P))P_e^{(n)} = 1 - Q^n(A) = \sum_{P : H(P)>R_n}Q^n(T(P)) \le (n+1)^{\lvert\mathcal{X}\rvert}\max_{P:H(P)>R_n}Q^n(T(P))

(n+1)X2nminP:H(P)>RnD(PQ)\le (n+1)^{\lvert\mathcal{X}\rvert}2^{-n\min_{P : H(P) > R_n}D(P\Vert Q)}

Since RnRR_n \uparrow R and H(Q)<RH(Q) < R, there is n0n_0 beyond which Rn>H(Q)R_n > H(Q); then the minimizing DD is strictly positive and Pe(n)0P_e^{(n)}\to0 exponentially.

FormulaError exponent for the universal code

DR,Q=minP:H(P)>RD(PQ)D^*_{R,Q} = \min_{P : H(P) > R} D(P\Vert Q)

IntuitionThe geometric picture

Draw the simplex with a circle H(P)=RH(P) = R around it. Sequences whose type lies outside the circle are encoded by their index — there are fewer than 2nR2^{nR} of them. Types inside are encoded by 0 and lost. Conversely, if H(Q)>RH(Q) > R the sequence will with high probability have a type outside AA, and the probability of error is close to 1: capacity-like sharpness again.

NoteWhat universality costs

This scheme is universal over i.i.d. distributions. Others exist — the Lempel–Ziv algorithm is a variable-rate universal code for all ergodic sources, widely used on data that cannot be modelled simply, like English text or source code.

So why ever use Huffman? Universal codes need a longer block length to match the performance of a code designed for the known distribution, and we pay for that in encoder/decoder complexity. A distribution-specific code is best when you actually know the distribution.


Large deviation theory and Sanov’s theorem

IntuitionSmall versus large deviations

If X1,,XnX_1,\ldots,X_n are i.i.d. Bernoulli(13\tfrac13), what is the probability that 1nXi\frac1n\sum X_i is near 13\tfrac13? A small deviation — probability near 1. What about 1nXi>34\frac1n\sum X_i > \tfrac34? A large deviation — exponentially small. The central limit theorem gives a poor approximation more than a few standard deviations out.

The type view makes it exact: 1nXi=34\frac1n\sum X_i = \tfrac34 is equivalent to Px=(14,34)P_x = (\tfrac14,\tfrac34), so the question becomes “what is the probability that the type is near (34,14)(\tfrac34,\tfrac14)?” — and Theorem 4 answers it: about 2nD((34,14)(13,23))2^{-nD\left((\frac34,\frac14)\Vert(\frac13,\frac23)\right)}.

Let EE be a subset of the set of pmfs, and write (slightly abusing notation) Qn(E)=Qn(EPn)=x:PxEPnQn(x)Q^n(E) = Q^n(E\cap\mathcal{P}_n) = \sum_{x : P_x \in E\cap\mathcal{P}_n}Q^n(x).

NoteConstraints on sample averages become half-spaces of types

An observation like 1nig(xi)α\frac1n\sum_i g(x_i)\ge\alpha is equivalent to PXEPnP_X\in E\cap\mathcal{P}_n where

E={P:aXg(a)P(a)α}E = \left\{P : \sum_{a\in\mathcal{X}}g(a)P(a)\ge\alpha\right\}

because 1nig(xi)=aPX(a)g(a)\frac1n\sum_i g(x_i) = \sum_a P_X(a)g(a). So EE is a half-space in the space of probability vectors — this is why all the pictures in this chapter are a triangle cut by a line.

TheoremSanov’s theorem

Let X1,,XnX_1,\ldots,X_n be i.i.d. Q\sim Q and EE a set of distributions. Then

Qn(E)(n+1)X2nD(PQ),P=argminPED(PQ)Q^n(E) \le (n+1)^{\lvert\mathcal{X}\rvert}2^{-nD(P^*\Vert Q)}, \qquad P^* = \arg\min_{P\in E}D(P\Vert Q)

the distribution in EE closest to QQ in relative entropy. If in addition EE is the closure of its interior, then

1nlogQn(E)D(PQ)\frac1n\log Q^n(E) \to -D(P^*\Vert Q)

ProofUpper bound by largest term; lower bound needs a “nice” set

Upper bound. Sum over types in EE, bound each by Theorem 4, replace each by the maximum, and count types with Theorem 1:

Qn(E)=PEPnQn(T(P))PEPn2nD(PQ)PEPn2nminPED(PQ)(n+1)X2nD(PQ)Q^n(E) = \sum_{P\in E\cap\mathcal{P}_n}Q^n(T(P)) \le \sum_{P\in E\cap\mathcal{P}_n}2^{-nD(P\Vert Q)} \le \sum_{P\in E\cap\mathcal{P}_n}2^{-n\min_{P\in E}D(P\Vert Q)} \le (n+1)^{\lvert\mathcal{X}\rvert}2^{-nD(P^*\Vert Q)}

Note PP^* need not be a member of Pn\mathcal{P}_n — it is the minimizer over all of EE, not over types.

Lower bound. Here we need a nice set so that for large nn we can find a type in EE close to PP^*. If EE is the closure of its interior (so the interior is nonempty), then since nPn\cup_n\mathcal{P}_n is dense in the set of all distributions, EPnE\cap\mathcal{P}_n is nonempty for nn0n\ge n_0, and we can find PnEPnP_n \in E\cap\mathcal{P}_n with D(PnQ)D(PQ)D(P_n\Vert Q)\to D(P^*\Vert Q). Then

Qn(E)Qn(T(Pn))1(n+1)X2nD(PnQ)Q^n(E) \ge Q^n(T(P_n)) \ge \frac{1}{(n+1)^{\lvert\mathcal{X}\rvert}}2^{-nD(P_n\Vert Q)}

and taking lim inf\liminf of 1nlog\frac1n\log kills the polynomial factor, giving D(PQ)\ge -D(P^*\Vert Q).

ImportantThe principle of the largest term

The whole proof is: the probability of a set of types is the sum of exponentially small terms, and since there are only polynomially many terms, the sum equals the largest one to first order in the exponent. Everything reduces to finding the single closest distribution PP^* — a variational problem, not a summation.

The form of PP^*

DerivationLagrange multipliers for constrained closest distribution

To find Pr{1nigj(Xi)αj, j=1,,k}\Pr\{\frac1n\sum_i g_j(X_i)\ge\alpha_j,\ j=1,\ldots,k\}, minimize D(PQ)D(P\Vert Q) over E={P:aP(a)gj(a)αj}E = \{P : \sum_a P(a)g_j(a)\ge\alpha_j\}. Construct

J(P)=xP(x)logP(x)Q(x)+iλixP(x)gi(x)+νxP(x)J(P) = \sum_x P(x)\log\frac{P(x)}{Q(x)} + \sum_i\lambda_i\sum_x P(x)g_i(x) + \nu\sum_x P(x)

Differentiating gives the closest distribution as an exponential tilt of QQ.

FormulaThe closest distribution is a tilted version of QQ

P(x)=Q(x)eiλigi(x)aXQ(a)eiλigi(a)P^*(x) = \frac{Q(x)e^{\sum_i\lambda_i g_i(x)}}{\sum_{a\in\mathcal{X}}Q(a)e^{\sum_i\lambda_i g_i(a)}}

with the λi\lambda_i chosen to satisfy the constraints. If QQ is uniform, PP^* is the maximum entropy distribution — which is why maximum-entropy distributions keep appearing as the answers to large-deviation questions.

ExampleDice

Toss a fair die nn times; what is the probability that the average throw is 4\ge 4? Sanov gives Qn(E)2nD(PQ)Q^n(E)\doteq2^{-nD(P^*\Vert Q)} where PP^* minimizes D(PQ)D(P\Vert Q) subject to i=16iP(i)4\sum_{i=1}^6 iP(i)\ge4, so P(x)=2λx/i2λiP^*(x) = 2^{\lambda x}/\sum_i 2^{\lambda i}. Solving numerically: λ=0.2519\lambda = 0.2519, P=(0.1031,0.1227,0.1461,0.1740,0.2072,0.2468)P^* = (0.1031, 0.1227, 0.1461, 0.1740, 0.2072, 0.2468), and D(PQ)=0.0624D(P^*\Vert Q) = 0.0624 bits. So the probability that the average of 10,000 throws is 4\ge4 is about 26242^{-624}.

ExampleCoins

Probability of more than 700 heads in 1000 fair tosses: P=(0.7,0.3)P^* = (0.7,0.3), Q=(0.5,0.5)Q = (0.5,0.5), and D(PQ)=1H(0.7)=0.119D(P^*\Vert Q) = 1 - H(0.7) = 0.119. So the probability is about 21192^{-119}.

ExampleMutual dependence — recovering the joint AEP

Let Q0(x,y)=Q(x)Q(y)Q_0(x,y) = Q(x)Q(y) be the product of QQ‘s marginals. How likely is a sample drawn from Q0Q_0 to appear jointly distributed according to QQ? The joint-typicality conditions define a set EE of joint distributions, and Sanov gives Q0n(E)2nD(PQ0)Q_0^n(E)\doteq2^{-nD(P^*\Vert Q_0)}. As ϵ0\epsilon\to0, PP^* is the joint QQ itself and Q0Q_0 is the product, so the probability is

2nD(Q(x,y)Q(x)Q(y))=2nI(X;Y)2^{-nD(Q(x,y)\Vert Q(x)Q(y))} = 2^{-nI(X;Y)}

exactly the joint AEP result from Chapter 7. The mysterious 2nI2^{-nI} that governed rival codewords is a large-deviation exponent.


Conditional limit theorem

The problem. Sanov tells us the probability of the rare event EE is governed by the closest point PP^*. But we can say much more: given that the rare event occurred, what does the sample look like? The answer is that it looks like PP^* and nothing else — the other types in EE are negligible even relative to each other.

First a geometric fact that makes DD behave like a squared distance.

TheoremPythagorean theorem for relative entropy

For a closed convex set EE and QEQ\notin E, let PEP^*\in E achieve D(PQ)=minPED(PQ)D(P^*\Vert Q) = \min_{P\in E}D(P\Vert Q). Then

D(PQ)D(PP)+D(PQ)for all PED(P\Vert Q) \ge D(P\Vert P^*) + D(P^*\Vert Q) \qquad \text{for all } P\in E

ProofThe derivative along the path PPP^*\to P is non-negative at PP^*

Let Pλ=λP+(1λ)PP_\lambda = \lambda P + (1-\lambda)P^*; by convexity of EE, PλEP_\lambda\in E for 0λ10\le\lambda\le1, and PλPP_\lambda\to P^* as λ0\lambda\to0. Since D(PQ)D(P^*\Vert Q) is the minimum along this path, the derivative of Dλ=D(PλQ)D_\lambda = D(P_\lambda\Vert Q) is non-negative at λ=0\lambda = 0:

dDλdλ=(P(x)P(x))[logPλ(x)Q(x)+1]\frac{dD_\lambda}{d\lambda} = \sum (P(x) - P^*(x))\left[\log\frac{P_\lambda(x)}{Q(x)} + 1\right]

Setting λ=0\lambda = 0 (so Pλ=PP_\lambda = P^*) and using P(x)=P(x)=1\sum P(x) = \sum P^*(x) = 1 to kill the +1+1:

0(P(x)P(x))logP(x)Q(x)=P(x)logP(x)Q(x)P(x)P(x)P(x)logP(x)Q(x)0 \le \sum(P(x) - P^*(x))\log\frac{P^*(x)}{Q(x)} = \sum P(x)\log\frac{P(x)}{Q(x)}\frac{P^*(x)}{P(x)} - \sum P^*(x)\log\frac{P^*(x)}{Q(x)}

=D(PQ)D(PP)D(PQ)= D(P\Vert Q) - D(P\Vert P^*) - D(P^*\Vert Q)

IntuitionThe obtuse-angle picture

Take a convex set in Rn\mathbb{R}^n, a point AA outside it, BB the closest point in the set, and CC any other point in the set. The angle at BB must be obtuse, which gives lAC2lAB2+lBC2l_{AC}^2 \ge l_{AB}^2 + l_{BC}^2 — the same form as the theorem. So DD behaves like the square of Euclidean distance, not like a distance.

The use we make of it: if D(PnQ)D(PQ)D(P_n\Vert Q)\to D(P^*\Vert Q), the theorem forces D(PnP)0D(P_n\Vert P^*)\to0 as well. Being close in distance-to-QQ implies close to PP^* itself.

LemmaPinsker’s inequality — relative entropy controls L1L_1

D(P1P2)12ln2P1P212D(P_1\Vert P_2) \ge \frac{1}{2\ln2}\lVert P_1 - P_2\rVert_1^2

where P1P21=aP1(a)P2(a)\lVert P_1-P_2\rVert_1 = \sum_a\lvert P_1(a)-P_2(a)\rvert.

NoteVariational distance identity

With A={x:P1(x)>P2(x)}A = \{x : P_1(x)>P_2(x)\}, expanding the sum over AA and AcA^c gives P1P21=2(P1(A)P2(A))\lVert P_1-P_2\rVert_1 = 2(P_1(A) - P_2(A)), and maxB(P1(B)P2(B))=P1P21/2\max_{B}(P_1(B)-P_2(B)) = \lVert P_1-P_2\rVert_1/2 — the variational distance.

ProofBinary case by calculus, general case by data processing

Binary case. For pqp\ge q, let g(p,q)=plogpq+(1p)log1p1q42ln2(pq)2g(p,q) = p\log\frac pq + (1-p)\log\frac{1-p}{1-q} - \frac{4}{2\ln2}(p-q)^2. Then

dgdq=qpq(1q)ln24ln2(qp)0\frac{dg}{dq} = \frac{q-p}{q(1-q)\ln2} - \frac{4}{\ln2}(q-p) \le 0

since q(1q)14q(1-q)\le\tfrac14 and qpq\le p. As g(p,p)=0g(p,p)=0, we get g(p,q)0g(p,q)\ge0 for qpq\le p.

General case. Let A={x:P1(x)>P2(x)}A = \{x : P_1(x)>P_2(x)\} and Y=1A(X)Y = \mathbb{1}_A(X), with P^1,P^2\hat P_1,\hat P_2 the induced binary distributions. By the data processing inequality for relative entropy,

D(P1P2)D(P^1P^2)42ln2(P1(A)P2(A))2=12ln2P1P212D(P_1\Vert P_2) \ge D(\hat P_1\Vert\hat P_2) \ge \frac{4}{2\ln2}(P_1(A)-P_2(A))^2 = \frac{1}{2\ln2}\lVert P_1-P_2\rVert_1^2

TheoremConditional limit theorem

Let EE be a closed convex subset of P\mathcal{P} and QEQ\notin E. Let X1,,XnX_1,\ldots,X_n be i.i.d. Q\sim Q, and let PP^* achieve minPED(PQ)\min_{P\in E}D(P\Vert Q). Then

Pr(X1=aPXnE)P(a)in probability\Pr(X_1 = a \mid P_{X^n}\in E) \to P^*(a) \quad\text{in probability}

— the conditional distribution of X1X_1, given that the type is in EE, is close to PP^* for large nn.

ProofSplit EE into a near shell and a far shell, then apply Pythagoras

Step 1: Define the shells. Let St={P:D(PQ)t}S_t = \{P : D(P\Vert Q)\le t\}, convex since DD is convex in PP; and D=D(PQ)D^* = D(P^*\Vert Q), with PP^* unique since DD is strictly convex. Set

A=SD+2δE,B=ESD+2δEA = S_{D^*+2\delta}\cap E, \qquad B = E - S_{D^*+2\delta}\cap E

so AB=EA\cup B = E: AA is the part of EE at about PP^*‘s distance from QQ, BB the part at least 2δ2\delta farther.

Step 2: Bound the far shell above.

Qn(B)=PEPn:D>D+2δQn(T(P))(n+1)X2n(D+2δ)Q^n(B) = \sum_{P\in E\cap\mathcal{P}_n : D>D^*+2\delta}Q^n(T(P)) \le (n+1)^{\lvert\mathcal{X}\rvert}2^{-n(D^*+2\delta)}

Step 3: Bound the near shell below. For nn large there is at least one type in SD+δEPnS_{D^*+\delta}\cap E\cap\mathcal{P}_n, and a sum exceeds one of its terms:

Qn(A)Qn(SD+δE)1(n+1)X2n(D+δ)Q^n(A) \ge Q^n(S_{D^*+\delta}\cap E) \ge \frac{1}{(n+1)^{\lvert\mathcal{X}\rvert}}2^{-n(D^*+\delta)}

Step 4: The ratio vanishes.

Pr(PXnBPXnE)Qn(B)Qn(A)(n+1)2X2nδ0\Pr(P_{X^n}\in B \mid P_{X^n}\in E) \le \frac{Q^n(B)}{Q^n(A)} \le (n+1)^{2\lvert\mathcal{X}\rvert}2^{-n\delta} \to 0

so the conditional probability of AA goes to 1. The δ\delta gap between the two shells is what makes the exponentials separate.

Step 5: Everything in AA is close to PP^*. For PAP\in A we have D(PQ)D+2δD(P\Vert Q)\le D^*+2\delta, so by the Pythagorean theorem

D(PP)+DD(PQ)D+2δD(PP)2δD(P\Vert P^*) + D^* \le D(P\Vert Q) \le D^* + 2\delta \quad\Longrightarrow\quad D(P\Vert P^*)\le2\delta

Step 6: Transfer to the marginal. Small relative entropy implies small L1L_1 by Pinsker, so maxaPXn(a)P(a)\max_a\lvert P_{X^n}(a) - P^*(a)\rvert is small with conditional probability 1\to1, i.e. Pr(X1=aPXnE)P(a)\Pr(X_1 = a\mid P_{X^n}\in E)\to P^*(a).

NoteA stronger version, and its limit

The same argument gives Pr(X1=a1,,Xm=amPXnE)i=1mP(ai)\Pr(X_1 = a_1,\ldots,X_m = a_m \mid P_{X^n}\in E)\to\prod_{i=1}^m P^*(a_i) for fixed mm as nn\to\infty: the first few elements are asymptotically independent with common distribution PP^*. It fails for m=nm = n because of end effects — given the type, the last elements are determined by the rest, so they cannot be independent.

ExampleDice conditioned on a high sum

Roll nn fair dice and suppose the sum exceeds 4n4n. Then the first die shows aa with probability approximately P(a)=2λa/i2λiP^*(a) = 2^{\lambda a}/\sum_i 2^{\lambda i} with iP(i)=4\sum iP^*(i)=4 — the maximum entropy distribution subject to the constraint. The first few dice inspected behave as if drawn independently from an exponential distribution.

ImportantThis strengthens the maximum entropy principle

Maximum entropy is usually presented as a modelling choice — “assume the least-committed distribution consistent with what you know.” The conditional limit theorem says it is a theorem about conditioning: if a constraint actually holds, the empirical distribution really does converge to the maximum-entropy (tilted) one. Nature does the tilting, not the modeller.


Hypothesis testing

DefinitionThe testing problem

Let X1,,XnX_1,\ldots,X_n be i.i.d. Q\sim Q. Two hypotheses: H1:Q=P1H_1 : Q = P_1 and H2:Q=P2H_2 : Q = P_2. A decision function g(x1,,xn){1,2}g(x_1,\ldots,x_n)\in\{1,2\} is specified by the acceptance region AA where g=1g = 1. The two error probabilities are

α=Pr(g=2H1)=P1n(Ac),β=Pr(g=1H2)=P2n(A)\alpha = \Pr(g = 2\mid H_1) = P_1^n(A^c), \qquad \beta = \Pr(g=1\mid H_2) = P_2^n(A)

IntuitionThe trade-off

We want both small, but they pull against each other: enlarging AA shrinks α\alpha and grows β\beta. So we minimize one subject to a constraint on the other. The best achievable exponent in that setting is the ; the symmetric Bayesian version is .

TheoremNeyman–Pearson lemma

Define, for T0T\ge0, An(T)={xn:P1(x1,,xn)P2(x1,,xn)>T}A_n(T) = \left\{x^n : \frac{P_1(x_1,\ldots,x_n)}{P_2(x_1,\ldots,x_n)} > T\right\} with errors α=P1n(Anc(T))\alpha^* = P_1^n(A_n^c(T)), β=P2n(An(T))\beta^* = P_2^n(A_n(T)). If any other region BnB_n has αα\alpha\le\alpha^*, then ββ\beta\ge\beta^*.

ProofOne pointwise inequality, summed

For all xx, (ϕA(x)ϕB(x))(P1(x)TP2(x))0(\phi_A(x) - \phi_B(x))(P_1(x) - TP_2(x)) \ge 0 — check the cases xAx\in A and xAx\notin A separately. Summing over the space:

0A(P1TP2)B(P1TP2)=(1α)Tβ(1α)+Tβ=T(ββ)(αα)0 \le \sum_A (P_1 - TP_2) - \sum_B(P_1 - TP_2) = (1-\alpha^*) - T\beta^* - (1-\alpha) + T\beta = T(\beta - \beta^*) - (\alpha^* - \alpha)

Since T0T\ge0, the result follows.

ImportantThe optimum test is a likelihood ratio test

P1(X1,,Xn)P2(X1,,Xn)>T\frac{P_1(X_1,\ldots,X_n)}{P_2(X_1,\ldots,X_n)} > T

ExampleTwo Gaussians: the test is a threshold on the sample mean

For f1=N(1,σ2)f_1 = \mathcal{N}(1,\sigma^2) vs. f2=N(1,σ2)f_2 = \mathcal{N}(-1,\sigma^2),

f1(Xn)f2(Xn)=e+2iXiσ2=e+2nXˉnσ2\frac{f_1(X^n)}{f_2(X^n)} = e^{+\frac{2\sum_i X_i}{\sigma^2}} = e^{+\frac{2n\bar X_n}{\sigma^2}}

so the likelihood ratio test compares Xˉn\bar X_n with a threshold. For equal error probabilities, set T=1T = 1.

DerivationThe log-likelihood ratio is a difference of relative entropies

L(Xn)=logP1(Xn)P2(Xn)=i=1nlogP1(Xi)P2(Xi)=anPXn(a)logP1(a)P2(a)L(X^n) = \log\frac{P_1(X^n)}{P_2(X^n)} = \sum_{i=1}^n\log\frac{P_1(X_i)}{P_2(X_i)} = \sum_a nP_{X^n}(a)\log\frac{P_1(a)}{P_2(a)}

Multiply and divide by PXn(a)P_{X^n}(a) inside the log and split:

=anPXn(a)logPXn(a)P2(a)anPXn(a)logPXn(a)P1(a)=nD(PXnP2)nD(PXnP1)= \sum_a nP_{X^n}(a)\log\frac{P_{X^n}(a)}{P_2(a)} - \sum_a nP_{X^n}(a)\log\frac{P_{X^n}(a)}{P_1(a)} = nD(P_{X^n}\Vert P_2) - nD(P_{X^n}\Vert P_1)

ImportantGeometric form of the optimal test

P1(Xn)P2(Xn)>T    D(PXnP2)D(PXnP1)>1nlogT\frac{P_1(X^n)}{P_2(X^n)} > T \iff D(P_{X^n}\Vert P_2) - D(P_{X^n}\Vert P_1) > \frac1n\log T

The test compares which hypothesis the sample type is closer to. The boundary — the set of types where the difference of distances is constant — is the analog of the perpendicular bisector in Euclidean geometry.

DerivationThe boundary distribution is an exponential interpolation

By Sanov, αn2nD(P1P1)\alpha_n \doteq 2^{-nD(P_1^*\Vert P_1)} and βn2nD(P2P2)\beta_n\doteq 2^{-nD(P_2^*\Vert P_2)} where PiP_i^* is the closest element of the relevant region. Minimizing D(PP2)D(P\Vert P_2) subject to D(PP2)D(PP1)=1nlogTD(P\Vert P_2) - D(P\Vert P_1) = \frac1n\log T by Lagrange multipliers gives:

FormulaThe geodesic between P1P_1 and P2P_2

Pλ(x)=P1λ(x)P21λ(x)aP1λ(a)P21λ(a)P_\lambda(x) = \frac{P_1^\lambda(x)P_2^{1-\lambda}(x)}{\sum_{a}P_1^\lambda(a)P_2^{1-\lambda}(a)}

with λ\lambda chosen so that D(PλP1)D(PλP2)=1nlogTD(P_\lambda\Vert P_1) - D(P_\lambda\Vert P_2) = \frac1n\log T. By symmetry P1=P2P_1^* = P_2^* — the same distribution governs both error exponents.

IntuitionA convex combination in the exponent

As λ1\lambda\to1, PλP1P_\lambda\to P_1; as λ0\lambda\to0, PλP2P_\lambda\to P_2. The curve PλP_\lambda traces a geodesic in the simplex — a normalized convex combination taken in the exponent rather than in the probabilities. This one family parametrizes every optimal test between the two hypotheses.


Chernoff–Stein lemma

The setting. Hold one error probability fixed and make the other as small as possible. The method of proof is a relative-entropy version of the AEP.

TheoremAEP for relative entropy

For X1,,XnX_1,\ldots,X_n i.i.d. P1\sim P_1 and any other P2P_2,

1nlogP1(X1,,Xn)P2(X1,,Xn)D(P1P2)in probability\frac1n\log\frac{P_1(X_1,\ldots,X_n)}{P_2(X_1,\ldots,X_n)} \to D(P_1\Vert P_2) \quad\text{in probability}

ProofWeak law of large numbers

The log-ratio is 1nilogP1(Xi)P2(Xi)\frac1n\sum_i\log\frac{P_1(X_i)}{P_2(X_i)}, a sample mean of i.i.d. terms with expectation EP1logP1(X)P2(X)=D(P1P2)\mathbb{E}_{P_1}\log\frac{P_1(X)}{P_2(X)} = D(P_1\Vert P_2).

DefinitionRelative entropy typical set

(x1,,xn)(x_1,\ldots,x_n) is relative entropy typical iff

D(P1P2)ϵ1nlogP1(xn)P2(xn)D(P1P2)+ϵD(P_1\Vert P_2) - \epsilon \le \frac1n\log\frac{P_1(x^n)}{P_2(x^n)} \le D(P_1\Vert P_2)+\epsilon

The set is denoted Aϵ(n)(P1P2)A_\epsilon^{(n)}(P_1\Vert P_2).

TheoremProperties of the relative entropy typical set

  1. For xnAϵ(n)(P1P2)x^n\in A_\epsilon^{(n)}(P_1\Vert P_2): P1(xn)2n(D(P1P2)+ϵ)P2(xn)P1(xn)2n(D(P1P2)ϵ)P_1(x^n)2^{-n(D(P_1\Vert P_2)+\epsilon)} \le P_2(x^n) \le P_1(x^n)2^{-n(D(P_1\Vert P_2)-\epsilon)}
  2. P1(Aϵ(n))>1ϵP_1\big(A_\epsilon^{(n)}\big) > 1-\epsilon for nn sufficiently large.
  3. P2(Aϵ(n))<2n(D(P1P2)ϵ)P_2\big(A_\epsilon^{(n)}\big) < 2^{-n(D(P_1\Vert P_2)-\epsilon)}.
  4. P2(Aϵ(n))>(1ϵ)2n(D(P1P2)+ϵ)P_2\big(A_\epsilon^{(n)}\big) > (1-\epsilon)2^{-n(D(P_1\Vert P_2)+\epsilon)} for nn sufficiently large.
ProofCounting measure replaced by P2P_2

Property 1 is the definition rearranged; property 2 is the relative entropy AEP. For property 3:

P2(Aϵ(n))=xnAP2(xn)xnAP1(xn)2n(Dϵ)=2n(Dϵ)P1(Aϵ(n))2n(Dϵ)P_2(A_\epsilon^{(n)}) = \sum_{x^n\in A}P_2(x^n) \le \sum_{x^n\in A}P_1(x^n)2^{-n(D-\epsilon)} = 2^{-n(D-\epsilon)}P_1(A_\epsilon^{(n)}) \le 2^{-n(D-\epsilon)}

Property 4 is the same with the other side of property 1 and P1(A)1ϵP_1(A)\ge1-\epsilon.

IntuitionThe structural analogy

This is the discrete AEP with counting measure replaced by the probability measure P2P_2. Where the old theorem said “the typical set has about 2nH2^{nH} elements”, this one says “the relative entropy typical set has P2P_2-probability about 2nD2^{-nD}.”

LemmaAny high-P1P_1-probability set has high P2P_2-probability too

If P1(Bn)>1ϵP_1(B_n) > 1-\epsilon and D(P1P2)<D(P_1\Vert P_2)<\infty, then P2(Bn)>(12ϵ)2n(D(P1P2)+ϵ)P_2(B_n) > (1-2\epsilon)2^{-n(D(P_1\Vert P_2)+\epsilon)}.

ProofIntersect with the typical set

Since P1(Bn)>1ϵP_1(B_n)>1-\epsilon and P1(An)>1ϵP_1(A_n)>1-\epsilon, the union bound gives P1(AnBn)>12ϵP_1(A_n\cap B_n)>1-2\epsilon. Then

P2(Bn)P2(AnBn)AnBnP1(xn)2n(D+ϵ)=2n(D+ϵ)P1(AnBn)(12ϵ)2n(D+ϵ)P_2(B_n)\ge P_2(A_n\cap B_n) \ge \sum_{A_n\cap B_n}P_1(x^n)2^{-n(D+\epsilon)} = 2^{-n(D+\epsilon)}P_1(A_n\cap B_n) \ge (1-2\epsilon)2^{-n(D+\epsilon)}

TheoremChernoff–Stein lemma

Let X1,,XnX_1,\ldots,X_n be i.i.d. Q\sim Q, testing Q=P1Q = P_1 vs. Q=P2Q = P_2 with D(P1P2)<D(P_1\Vert P_2)<\infty. With αn=P1n(Anc)\alpha_n = P_1^n(A_n^c), βn=P2n(An)\beta_n = P_2^n(A_n), and for 0<ϵ<120<\epsilon<\tfrac12,

βnϵ=minAn:αn<ϵβn\beta_n^\epsilon = \min_{A_n : \alpha_n<\epsilon}\beta_n

Then

limn1nlogβnϵ=D(P1P2)\lim_{n\to\infty}\frac1n\log\beta_n^\epsilon = -D(P_1\Vert P_2)

ProofAchievability from property 3, optimality from the lemma

Achievability. Take An=Aϵ(n)(P1P2)A_n = A_\epsilon^{(n)}(P_1\Vert P_2). By property 2, P1(Anc)<ϵP_1(A_n^c)<\epsilon for nn large; by property 3, lim1nlogP2(An)(D(P1P2)ϵ)\lim\frac1n\log P_2(A_n) \le -(D(P_1\Vert P_2)-\epsilon).

No better sequence exists. For any BnB_n with P1(Bn)>1ϵP_1(B_n)>1-\epsilon, the lemma gives P2(Bn)>(12ϵ)2n(D+ϵ)P_2(B_n) > (1-2\epsilon)2^{-n(D+\epsilon)}, so lim1nlogP2(Bn)>(D(P1P2)+ϵ)\lim\frac1n\log P_2(B_n) > -(D(P_1\Vert P_2)+\epsilon).

ImportantRelative entropy is the best error exponent

This is the cleanest operational meaning of D(P1P2)D(P_1\Vert P_2) yet: it is exactly the exponential rate at which the second error probability can be driven down while the first is held fixed. Note the asymmetry is intrinsic — DD is not symmetric, and neither is the setup.

WarningAsymptotically optimal is not optimal

The relative entropy typical set achieves the best asymptotic rate, but it is not the optimal set for any fixed hypothesis-testing problem. The set that minimizes the error probabilities is the one given by Neyman–Pearson.


Chernoff information

The problem. The Chernoff–Stein setup lacks symmetry — we fixed αn\alpha_n and optimized βn\beta_n. A Bayesian approach assigns priors π1,π2\pi_1, \pi_2 and minimizes the overall error

Pe(n)=π1αn+π2βn,D=limn1nlogminAnPe(n)P_e^{(n)} = \pi_1\alpha_n + \pi_2\beta_n, \qquad D^* = \lim_{n\to\infty}-\frac1n\log\min_{A_n}P_e^{(n)}

TheoremChernoff

The best achievable exponent in the Bayesian probability of error is

D=D(PλP1)=D(PλP2)D^* = D(P_{\lambda^*}\Vert P_1) = D(P_{\lambda^*}\Vert P_2)

where PλP_\lambda is the geodesic family above and λ\lambda^* is the value making the two relative entropies equal.

ProofBoth errors are Sanov exponents; the worst one dominates, so equalize them

The optimum test is the likelihood ratio test, dividing the simplex into two regions. The closest point of AcA^c to P1P_1 lies on the boundary of AA and has the form PλP_\lambda; it is simultaneously the point of AA closest to P2P_2. By Sanov,

αn2nD(PλP1),βn2nD(PλP2)\alpha_n \doteq 2^{-nD(P_{\lambda}\Vert P_1)}, \qquad \beta_n \doteq 2^{-nD(P_\lambda\Vert P_2)}

so the weighted sum is

Peπ12nD(PλP1)+π22nD(PλP2)2nmin{D(PλP1),D(PλP2)}P_e \doteq \pi_1 2^{-nD(P_\lambda\Vert P_1)} + \pi_2 2^{-nD(P_\lambda\Vert P_2)} \doteq 2^{-n\min\{D(P_\lambda\Vert P_1),\,D(P_\lambda\Vert P_2)\}}

since the exponential rate is set by the worst exponent. Now D(PλP1)D(P_\lambda\Vert P_1) increases with λ\lambda while D(PλP2)D(P_\lambda\Vert P_2) decreases, so the maximum of their minimum is attained where they cross. Hence choose λ\lambda with D(PλP1)=D(PλP2)D(P_\lambda\Vert P_1) = D(P_\lambda\Vert P_2).

FormulaChernoff information (standard form)

C(P1,P2)=min0λ1log(xP1λ(x)P21λ(x))C(P_1,P_2) = -\min_{0\le\lambda\le1}\log\left(\sum_x P_1^\lambda(x)P_2^{1-\lambda}(x)\right)

(Equivalence with the D(PλP1)D(P_{\lambda^*}\Vert P_1) form is left as an exercise.)

ProofThe usual derivation, via the MAP rule

The maximum a posteriori rule minimizes Bayesian error, with acceptance region A={x:π1P1(x)π2P2(x)>1}A = \{x : \frac{\pi_1P_1(x)}{\pi_2P_2(x)} > 1\}, giving

Pe=π1αn+π2βn=min{π1P1,π2P2}P_e = \pi_1\alpha_n + \pi_2\beta_n = \sum\min\{\pi_1P_1,\pi_2P_2\}

Now use min{a,b}aλb1λ\min\{a,b\}\le a^\lambda b^{1-\lambda} for 0λ10\le\lambda\le1:

Pe(π1P1)λ(π2P2)1λP1λP21λP_e \le \sum(\pi_1P_1)^\lambda(\pi_2P_2)^{1-\lambda} \le \sum P_1^\lambda P_2^{1-\lambda}

For i.i.d. observations the product factorizes, giving Pe(n)(xP1λP21λ)nP_e^{(n)}\le\left(\sum_x P_1^\lambda P_2^{1-\lambda}\right)^n and hence 1nlogPe(n)logxP1λ(x)P21λ(x)\frac1n\log P_e^{(n)} \le \log\sum_x P_1^\lambda(x)P_2^{1-\lambda}(x). Minimizing over λ\lambda gives the bound.

IntuitionThe prior washes out

The Bayesian error exponent does not depend on π1,π2\pi_1,\pi_2, as long as they are nonzero. Taking logs of the MAP test:

1nlogπ1π2+1nilogP1(Xi)P2(Xi)0\frac1n\log\frac{\pi_1}{\pi_2} + \frac1n\sum_i\log\frac{P_1(X_i)}{P_2(X_i)} \gtrless 0

The second term tends to ±D\pm D depending on the truth; the first term tends to 0. For large samples the data overwhelms the prior.

ExampleConditional limit theorem in action: mistaking one Gaussian for another

Major league players bat 260 with s.d. 15; minor leaguers bat 240 with s.d. 15. A group of 100 players from one league has a group average above 250 and is judged major league. We are told this is wrong — they are minor leaguers. What does the distribution of their batting averages look like?

Abstract it: test f1=N(1,σ2)f_1 = \mathcal{N}(1,\sigma^2) vs. f2=N(1,σ2)f_2 = \mathcal{N}(-1,\sigma^2) with the Bayes rule “accept f1f_1 if Xˉn>0\bar X_n>0”, and condition on an error of the first kind. Candidate answers:

  • A (12,12)(\tfrac12,\tfrac12) mix of the two normals — plausible, but wrong.
  • Xi0X_i\approx0 for all ii — very unlikely, though Xˉn\bar X_n is near 0.
  • Correct: the conditional limit theorem gives the distribution in AA closest to f2f_2, which by symmetry is λ=12\lambda = \tfrac12:

f(x)=(12πσ2e(x1)22σ2)1/2(12πσ2e(x+1)22σ2)1/2()1/2()1/2dx=12πσ2ex22σ2=N(0,σ2)f^*(x) = \frac{\left(\frac{1}{\sqrt{2\pi\sigma^2}}e^{-\frac{(x-1)^2}{2\sigma^2}}\right)^{1/2}\left(\frac{1}{\sqrt{2\pi\sigma^2}}e^{-\frac{(x+1)^2}{2\sigma^2}}\right)^{1/2}}{\int(\cdots)^{1/2}(\cdots)^{1/2}dx} = \frac{1}{\sqrt{2\pi\sigma^2}}e^{-\frac{x^2}{2\sigma^2}} = \mathcal{N}(0,\sigma^2)

Strange but true: if we mistake one normal population for another, the population still looks normal with the same variance and a different mean. This rare event does not result from bizarre-looking data. Back in baseball terms: the misjudged players have mean 250 and s.d. 15.

ExampleLarge deviations and football

A coach chooses between running (a few yards with very high probability) and passing (huge gains with low probability). At the start of the game he uses whichever has the greatest expected gain. But in the closing minutes, trailing badly with only nn plays left and lnE[gain]l \gg n\cdot\mathbb{E}[\text{gain}] yards needed, winning requires luck — so play as though you will be lucky.

The probability of winning with pure passing is 2nD(P1P1)2^{-nD(P_1^*\Vert P_1)} and with pure running 2nD(P2P2)2^{-nD(P_2^*\Vert P_2)}, where E={P:aP(a)aα}E = \{P : \sum_a P(a)a \ge \alpha\}. Can a mixed strategy Pλ=λP1+(1λ)P2P_\lambda = \lambda P_1 + (1-\lambda)P_2 beat both? The somewhat surprising answer is yes, as can be shown by example — giving a reason to mix strategies beyond confusing the defense.

LemmaChernoff bound

For any random variable YY with moment generating function ψ(s)=EesY\psi(s) = \mathbb{E}e^{sY}, for all s0s\ge0:

Pr(Ya)esaψ(s),hencePr(Ya)mins0esaψ(s)\Pr(Y\ge a) \le e^{-sa}\psi(s), \qquad \text{hence} \qquad \Pr(Y\ge a)\le\min_{s\ge0}e^{-sa}\psi(s)

ProofMarkov’s inequality applied to esYe^{sY}, a non-negative random variable.


Fisher information and the Cramér–Rao inequality

The problem. Determine the parameters of a distribution from a sample. For X1,,XnX_1,\ldots,X_n i.i.d. N(θ,1)\sim\mathcal{N}(\theta,1), we could estimate θ\theta by X1X_1 — whose expectation is θ\theta — but clearly we can do better using more of the data. How much better, and is there a limit?

DefinitionEstimator, bias, consistency, domination

Let {f(x;θ)}\{f(x;\theta)\}, θΘ\theta\in\Theta, be an indexed family of densities.

  • An estimator for sample size nn is a function T:XnΘT:\mathcal{X}^n\to\Theta.
  • The bias is EθTθ\mathbb{E}_\theta T - \theta; the estimator is unbiased if the bias is 0 for all θ\theta.
  • TT is consistent in probability if TθT\to\theta in probability.
  • T1T_1 dominates T2T_2 if E(T1θ)2E(T2θ)2\mathbb{E}(T_1-\theta)^2 \le \mathbb{E}(T_2-\theta)^2 for all θ\theta.

NoteBias alone is not enough

For XiX_i i.i.d. exponential with mean λ\lambda, both X1X_1 and Xˉn\bar X_n are unbiased — yet one is obviously worse. Zero bias does not guarantee the error is small with high probability, so we rank estimators by expected squared error instead.

DefinitionScore and Fisher information

The score is the random variable

V=θlnf(X;θ)=θf(X;θ)f(X;θ),Xf(x;θ)V = \frac{\partial}{\partial\theta}\ln f(X;\theta) = \frac{\frac{\partial}{\partial\theta}f(X;\theta)}{f(X;\theta)}, \qquad X\sim f(x;\theta)

The Fisher information is the variance of the score:

J(θ)=Eθ[(θlnf(X;θ))2]J(\theta) = \mathbb{E}_\theta\left[\left(\frac{\partial}{\partial\theta}\ln f(X;\theta)\right)^2\right]

DerivationThe score has mean zero, so EV2=var(V)\mathbb{E}V^2 = \mathrm{var}(V)

EV=θf(x;θ)f(x;θ)f(x;θ)dx=θf(x;θ)dx=θ1=0\mathbb{E}V = \int\frac{\frac{\partial}{\partial\theta}f(x;\theta)}{f(x;\theta)}f(x;\theta)dx = \frac{\partial}{\partial\theta}\int f(x;\theta)dx = \frac{\partial}{\partial\theta}1 = 0

TheoremFisher information is additive over i.i.d. samples

Jn(θ)=nJ(θ)J_n(\theta) = nJ(\theta)

ProofThe score of a product is a sum of independent, zero-mean scores

f(xn;θ)=if(xi;θ)f(x^n;\theta) = \prod_i f(x_i;\theta), so V(Xn)=iV(Xi)V(X^n) = \sum_i V(X_i) with the V(Xi)V(X_i) i.i.d. and zero mean. Hence EV2(Xn)=iEV2(Xi)=nJ(θ)\mathbb{E}V^2(X^n) = \sum_i\mathbb{E}V^2(X_i) = nJ(\theta) — the cross terms vanish by independence and zero mean.

TheoremCramér–Rao inequality

The mean-squared error of any unbiased estimator T(X)T(X) of θ\theta is lower bounded by the reciprocal of the Fisher information:

var(T)1J(θ)\mathrm{var}(T) \ge \frac{1}{J(\theta)}

ProofCauchy–Schwarz between the score and the estimator

Step 1: Cauchy–Schwarz.

(Eθ[(VEθV)(TEθT)])2Eθ(VEθV)2Eθ(TEθT)2\left(\mathbb{E}_\theta\big[(V - \mathbb{E}_\theta V)(T - \mathbb{E}_\theta T)\big]\right)^2 \le \mathbb{E}_\theta(V-\mathbb{E}_\theta V)^2\,\mathbb{E}_\theta(T - \mathbb{E}_\theta T)^2

Step 2: Simplify both sides. TT unbiased gives EθT=θ\mathbb{E}_\theta T = \theta; EθV=0\mathbb{E}_\theta V = 0 gives E[(VEV)(TET)]=E(VT)\mathbb{E}[(V-\mathbb{E}V)(T-\mathbb{E}T)] = \mathbb{E}(VT); and var(V)=J(θ)\mathrm{var}(V) = J(\theta) by definition. So [Eθ(VT)]2J(θ)var(T)[\mathbb{E}_\theta(VT)]^2 \le J(\theta)\mathrm{var}(T).

Step 3: The covariance is exactly 1.

Eθ(VT)=θf(x;θ)f(x;θ)T(x)f(x;θ)dx=θf(x;θ)T(x)dx=θEθT=θθ=1\mathbb{E}_\theta(VT) = \int\frac{\frac{\partial}{\partial\theta}f(x;\theta)}{f(x;\theta)}T(x)f(x;\theta)dx = \frac{\partial}{\partial\theta}\int f(x;\theta)T(x)dx = \frac{\partial}{\partial\theta}\mathbb{E}_\theta T = \frac{\partial}{\partial\theta}\theta = 1

(the interchange of differentiation and integration justified by bounded convergence for well-behaved ff, and the last step by unbiasedness). Substituting gives var(T)1/J(θ)\mathrm{var}(T)\ge1/J(\theta).

NoteGeneral (biased) version

E(Tθ)2(1+bT(θ))2J(θ)+bT2(θ)\mathbb{E}(T-\theta)^2 \ge \frac{(1+b_T'(\theta))^2}{J(\theta)} + b_T^2(\theta) where bT(θ)=EθTθb_T(\theta) = \mathbb{E}_\theta T - \theta.

DefinitionEfficient estimator

An unbiased estimator TT is efficient if it meets the Cramér–Rao bound with equality, var(T)=1/J(θ)\mathrm{var}(T) = 1/J(\theta).

ExampleThe sample mean is efficient for a Gaussian mean

For XiX_i i.i.d. N(θ,σ2)\sim\mathcal{N}(\theta,\sigma^2) with σ2\sigma^2 known, J(θ)=n/σ2J(\theta) = n/\sigma^2. With T=XˉnT = \bar X_n, Eθ(Xˉnθ)2=σ2/n=1/J(θ)\mathbb{E}_\theta(\bar X_n - \theta)^2 = \sigma^2/n = 1/J(\theta). So Xˉn\bar X_n is the minimum variance unbiased estimator, achieving the bound.

NoteMultiparameter version

Jij(θ)=f(x;θ)θilnf(x;θ)θjlnf(x;θ)dxJ_{ij}(\theta) = \int f(x;\theta)\frac{\partial}{\partial\theta_i}\ln f(x;\theta)\frac{\partial}{\partial\theta_j}\ln f(x;\theta)\,dx and Cramér–Rao becomes the matrix inequality ΣJ1(θ)\Sigma \succeq J^{-1}(\theta), meaning ΣJ1\Sigma - J^{-1} is nonnegative definite.

ImportantFisher information versus entropy

Fisher information measures the amount of “information” about θ\theta present in the data, lower-bounding the estimation error. Note the definitional asymmetry: Fisher information is defined for a parametric family, whereas entropy is defined for any distribution. We can bridge them by parametrizing any f(x)f(x) by a location parameter and defining JJ with respect to the translated family f(xθ)f(x-\theta).

The relationship, promised back in Chapter 8: entropy is related to the volume of the typical set; Fisher information is related to its surface area.

WarningA bound is not a guarantee

Cramér–Rao gives a lower bound on the variance of all unbiased estimators — but it is possible that no estimator meets it. Efficiency is a property to be checked, not assumed.


Quick reference

ObjectStatementNote
Number of typesPn(n+1)X\lvert\mathcal{P}_n\rvert \le (n+1)^{\lvert\mathcal{X}\rvert}Polynomial — the key asymmetry.
Sequence probabilityQn(x)=2n(H(Px)+D(PxQ))Q^n(x) = 2^{-n(H(P_x) + D(P_x\Vert Q))}Exact, not asymptotic.
Type class sizeT(P)2nH(P)\lvert T(P)\rvert \doteq 2^{nH(P)}Exponential.
Type class probabilityQn(T(P))2nD(PQ)Q^n(T(P)) \doteq 2^{-nD(P\Vert Q)}Distance from truth is the exponent.
Universal codingexists with Pe0P_e\to0 whenever H(Q)<RH(Q)<RError exponent minP:H(P)>RD(PQ)\min_{P:H(P)>R}D(P\Vert Q).
SanovQn(E)2nD(PQ)Q^n(E)\doteq 2^{-nD(P^*\Vert Q)}PP^* = closest point of EE to QQ.
Tilted distributionP(x)Q(x)eiλigi(x)P^*(x)\propto Q(x)e^{\sum_i\lambda_ig_i(x)}Max-entropy when QQ uniform.
PythagorasD(PQ)D(PP)+D(PQ)D(P\Vert Q)\ge D(P\Vert P^*) + D(P^*\Vert Q)DD behaves like squared distance.
PinskerD(P1P2)12ln2P1P212D(P_1\Vert P_2)\ge\frac{1}{2\ln2}\lVert P_1-P_2\rVert_1^2Small DD \Rightarrow small L1L_1.
Conditional limitPr(X1=aPXnE)P(a)\Pr(X_1 = a\mid P_{X^n}\in E)\to P^*(a)Max-entropy as a theorem, not a choice.
Neyman–Pearsonoptimal test is P1P2>T\frac{P_1}{P_2} > TEquivalently D(PxP2)D(PxP1)>1nlogTD(P_x\Vert P_2)-D(P_x\Vert P_1) > \frac1n\log T.
GeodesicPλP1λP21λP_\lambda\propto P_1^\lambda P_2^{1-\lambda}Convex combination in the exponent.
Chernoff–Stein1nlogβnϵD(P1P2)\frac1n\log\beta_n^\epsilon \to -D(P_1\Vert P_2)DD is the best error exponent.
Chernoff informationD=D(PλP1)=D(PλP2)D^* = D(P_{\lambda^*}\Vert P_1) = D(P_{\lambda^*}\Vert P_2)Bayesian; prior washes out.
Fisher informationJ(θ)=E[(θlnf)2]J(\theta) = \mathbb{E}\left[\left(\partial_\theta\ln f\right)^2\right], Jn=nJJ_n = nJVariance of the score.
Cramér–Raovar(T)1/J(θ)\mathrm{var}(T)\ge 1/J(\theta)For unbiased TT; Xˉn\bar X_n attains it for a Gaussian mean.

Facts to keep to hand:

  • Every exponent in this chapter is a relative entropy to the closest point of a set. Universal coding, Sanov, hypothesis testing, Chernoff — same shape, different sets.
  • The recurring argument is the principle of the largest term: exponentially small probabilities summed over polynomially many types equal the largest term to first order in the exponent.
  • DD is not a metric but obeys a Pythagorean inequality, which is what converts “close in distance-to-QQ” into “close to PP^*”.
  • Constraints on sample averages become half-spaces in the simplex; maximizing entropy subject to them produces exponentially tilted distributions.
  • Chernoff–Stein fixes one error and optimizes the other (D(P1P2)\to D(P_1\Vert P_2)); Chernoff information weights both (\to the crossing point of the two relative entropies along the geodesic).
  • The chapter’s two halves connect through the typical set: entropy ↔ volume, Fisher information ↔ surface area.

References

  • [[lit/cover2006-elements|Cover & Thomas, Elements of Information Theory]] — Chapter 11

← All notes