Yu-Liang Wu

1. The Method of Types

The method of types refers to a set of combinatorial arguments used to establish Large Deviation Principles (LDP) for i.i.d. random variables taking values in a finite alphabet Σ={𝑎1,𝑎2,…,𝑎|Σ|}.

To demonstrate the argument, we consider i.i.d. random variables (𝑌𝑖)𝑖=1∞ taking values in Σ. Let 𝑀1(Σ) (which can be identified as a subset of ℝ|Σ|) denote the space of all probability measures (laws) on Σ. Assuming the law of each 𝑌𝑖 is 𝜇∈𝑀1(Σ), we denote by 𝑃𝜇 the joint law of (𝑌𝑖)𝑖=1∞ on the product space Σℕ.

Definition 1.1. The empirical measure 𝐿𝑛𝐲 of a finite sequence 𝐲=(𝑦1,𝑦2,…,𝑦𝑛)∈Σ𝑛 is the measure in 𝑀1(Σ) that records the frequency of occurrences of each 𝑎𝑖; namely, 𝐿𝑛𝐲=(𝐿𝑛𝐲(𝑎1),…,𝐿𝑛𝐲(𝑎|Σ|)) with

𝐿 𝑛 𝐲 ( 𝑎 𝑖 ) = 1 𝑛 ∑ 𝑗 = 1 𝑛 𝟙 { 𝑎 𝑖 } ( 𝑦 𝑗 ) .

Below are some related notions:

  • (Support) Σ𝜈={𝑎𝑖∈Σ:𝜈(𝑎𝑖)>0} for a measure 𝜈.
  • (Empirical distribution) ℒ︀𝑛={𝐿𝑛𝐲:𝐲∈Σ𝑛}.
  • (Types) 𝑇𝑛(𝜈)={𝐲∈Σ𝑛:𝐿𝑛𝐲=𝜈} for 𝜈∈𝑀1(Σ).
  • (Variational distance) For 𝜈,𝜈′∈𝑀1(Σ), 𝑑𝑉(𝜈,𝜈′)≔12∑𝑎∈Σ|𝜈(𝑎)−𝜈′(𝑎)|.

We have the following fundamental estimates of the size of 𝑇𝑛(𝜈) and ℒ︀𝑛.

Lemma 1.2.

  1. |𝑇𝑛(𝜈)|=(𝑛𝑛𝜈(𝑎1),𝑛𝜈(𝑎2),…,𝑛𝜈(𝑎|Σ|)).
  2. 1≤|ℒ︀𝑛|≤(𝑛+1)|Σ|.

Proof. (1) It follows from a combinatorial argument.

(2) Note that

𝑛 ⋅ ℒ︀ 𝑛 = { ( 𝑘 𝑎 ) 𝑎 ∈ Σ : 𝑘 𝑎 ∈ ℤ + , ∑ 𝑎 ∈ Σ 𝑘 𝑎 = 𝑛 } ,

where the latter set has cardinality

( 𝑛 + | Σ | − 1 | Σ | − 1 ) = ∏ 𝑖 = 1 | Σ | − 1 𝑛 + 𝑖 𝑖 ≤ ( 𝑛 + 1 ) | Σ | ,

as desired. □

In the following, we estimate the large deviation probabilities.

Definition 1.3 (entropy). Let 𝜈,𝜂∈𝑀1(Σ).

  • The entropy of 𝜈∈𝑀1(Σ) is

    𝐻 ( 𝜈 ) = − ∑ 𝑎 ∈ Σ 𝜈 ( 𝑎 ) log 𝜈 ( 𝑎 ) .
  • The relative entropy (or Kullback–Leibler divergence) of 𝜈 with respect to 𝜂 is

    𝐻 ( 𝜈 | 𝜂 ) = ∑ 𝑎 ∈ Σ 𝜈 ( 𝑎 ) log 𝜈 ( 𝑎 ) 𝜂 ( 𝑎 ) .

We adopt the convention that 0log0=0 and 0log(00)=0.

Remark 1.4. Let 𝑀1(Σ) be endowed with the variational distance. Then,

  1. 𝑀1(Σ) is compact.
  2. 𝐻(⋅) is continuous on 𝑀1(Σ)
  3. 𝐻(⋅|𝜇) is continuous on the compact set {𝜈∈𝑀1(Σ):Σ𝜈⊂Σ𝜇}.

Lemma 1.5. If 𝐲∈𝑇𝑛(𝜈), then the following hold.

  1. 𝑃𝜇((𝑌1,…,𝑌𝑛)=𝐲)=𝑒−𝑛(𝐻(𝜈)+𝐻(𝜈|𝜇)).
  2. (𝑛+1)−|Σ|𝑒𝑛𝐻(𝜈)≤|𝑇𝑛(𝜈)|≤𝑒𝑛𝐻(𝜈).
  3. (𝑛+1)−|Σ|𝑒−𝑛𝐻(𝜈|𝜇)≤𝑃𝜇(𝐿𝑛𝐘=𝜈)≤𝑒−𝑛𝐻(𝜈|𝜇).

Proof. (1) The case Σ𝜈⊈Σ𝜇 is trivial, as 𝑃𝜇((𝑌1,…,𝑌𝑛)=𝐲)=0 and 𝐻(𝜈|𝜇)=∞. Assuming Σ𝜈⊆Σ𝜇, we have by definition

𝑃 𝜇 ( ( 𝑌 1 , … , 𝑌 𝑛 ) = 𝐲 ) = ∏ 𝑎 ∈ Σ 𝜇 ( 𝑎 ) 𝑛 𝜈 ( 𝑎 ) = 𝑒 − 𝑛 ( 𝐻 ( 𝜈 ) + 𝐻 ( 𝜈 | 𝜇 ) ) .

(2) The second inequality follows immediately from

1 ≥ 𝑃 𝜈 ( 𝐿 𝑛 𝐘 = 𝜈 ) = 𝑒 − 𝑛 𝐻 ( 𝜈 ) | 𝑇 𝑛 ( 𝜈 ) | .

To prove the first, we claim that if Σ𝜈′⊂Σ𝜈, then

𝑃 𝜈 ( 𝐿 𝑛 𝐘 = 𝜈 ) 𝑃 𝜈 ( 𝐿 𝑛 𝐘 = 𝜈′ ) = ∏ 𝑎 ∈ Σ | 𝑇 𝑛 ( 𝜈 ) | 𝜈 ( 𝑎 ) 𝑛 𝜈 ( 𝑎 ) | 𝑇 𝑛 ( 𝜈′ ) | 𝜈 ( 𝑎 ) 𝑛 𝜈′ ( 𝑎 ) = ∏ 𝑎 ∈ Σ ( 𝑛 𝜈′ ( 𝑎 ) ) ! ( 𝑛 𝜈 ( 𝑎 ) ) ! 𝜈 ( 𝑎 ) 𝑛 𝜈 ( 𝑎 ) − 𝑛 𝜈′ ( 𝑎 ) ≥ 1 .

Indeed, the last expression consists of terms of the form 𝑚!ℓ!(ℓ𝑛)ℓ−𝑚 where the inequality is validated using the fact 𝑚!ℓ!≥ℓ𝑚−ℓ:

𝑃 𝜈 ( 𝐿 𝑛 𝐘 ∈ 𝑇 𝑛 ( 𝜈 ) ) 𝑃 𝜈′ ( 𝐿 𝑛 𝐘 ∈ 𝑇 𝑛 ( 𝜈 ) ) ≥ 𝑛 𝑛 [ ∑ 𝑎 ∈ Σ 𝜈′ ( 𝑎 ) − ∑ 𝑎 ∈ Σ 𝜈 ( 𝑎 ) ] = 1 .

To prove the desired inequality, observe that

1 = ∑ 𝜈′ ∈ ℒ︀ 𝑛 𝑃 𝜈 ( 𝐿 𝑛 𝐘 = 𝜈′ ) ≤ | ℒ︀ 𝑛 | 𝑃 𝜈 ( 𝐿 𝑛 𝐘 = 𝜈 ) = | ℒ︀ 𝑛 | 𝑒 − 𝑛 𝐻 ( 𝜈 ) | 𝑇 𝑛 ( 𝜈 ) | .

The proof is concluded by applying Lemma 1.2.

(3) Combining (1) and (2), we arrive at the estimate

𝑃 𝜇 ( 𝐿 𝑛 𝐘 = 𝜈 ) = | 𝑇 𝑛 ( 𝜈 ) | 𝑃 𝜇 ( ( 𝑌 1 , … , 𝑌 𝑛 ) = 𝐲 ) ≤ | 𝑇 𝑛 ( 𝜈 ) | 𝑒 − 𝑛 ( 𝐻 ( 𝜈 ) + 𝐻 ( 𝜈 | 𝜇 ) ) ≤ 𝑒 − 𝑛 ( 𝐻 ( 𝜈 | 𝜇 ) ) ,

whereas the other inequality follows from the lower bound on |𝑇𝑛(𝜈)|. □

Theorem 1.6 (Sanov). For every set Γ⊆𝑀1(Σ) of probability measures,

− inf 𝜈 ∈ Γ ˚ 𝐻 ( 𝜈 | 𝜇 ) ≤ lim inf 𝑛 → ∞ 1 𝑛 log 𝑃 𝜇 ( 𝐿 𝑛 𝐘 ∈ Γ ) ≤ lim sup 𝑛 → ∞ 1 𝑛 log 𝑃 𝜇 ( 𝐿 𝑛 𝐘 ∈ Γ ) ≤ − inf 𝜈 ∈ Γ ─ 𝐻 ( 𝜈 | 𝜇 ) .

Proof. By Lemma 1.5, we obtain the upper bound:

𝑃 𝜇 ( 𝐿 𝑛 𝐘 ∈ Γ ) = ∑ 𝜈 ∈ Γ ∩ ℒ︀ 𝑛 𝑃 𝜇 ( 𝐿 𝑛 𝐘 = 𝜈 ) ≤ | Γ ∩ ℒ︀ 𝑛 | 𝑒 − 𝑛 inf 𝜈 ∈ Γ ∩ ℒ︀ 𝑛 𝐻 ( 𝜈 | 𝜇 ) ≤ ( 𝑛 + 1 ) | Σ | 𝑒 − 𝑛 inf 𝜈 ∈ Γ ∩ ℒ︀ 𝑛 𝐻 ( 𝜈 | 𝜇 ) ,

which yields

lim sup 𝑛 → ∞ 1 𝑛 log 𝑃 𝜇 ( 𝐿 𝑛 𝐘 ∈ Γ ) ≤ − lim inf 𝑛 → ∞ inf 𝜈 ∈ Γ ∩ ℒ︀ 𝑛 𝐻 ( 𝜈 | 𝜇 ) ≤ − inf 𝜈 ∈ Γ ─ 𝐻 ( 𝜈 | 𝜇 ) .

To prove the lower bound, we begin with an analogous estimate

𝑃 𝜇 ( 𝐿 𝑛 𝐘 ∈ Γ ) = ∑ 𝜈 ∈ Γ ∩ ℒ︀ 𝑛 𝑃 𝜇 ( 𝐿 𝑛 𝐘 = 𝜈 ) ≥ ( 𝑛 + 1 ) − | Σ | 𝑒 − 𝑛 inf 𝜈 ∈ Γ ∩ ℒ︀ 𝑛 𝐻 ( 𝜈 | 𝜇 ) .

Since sup𝜈∈𝑀1(Σ)𝑑𝑉(𝜈,ℒ︀𝑛)≤|Σ|2𝑛, for every 𝜈∈Γ˚ with Σ𝜈⊂Σ𝜇, one can find for every sufficiently large 𝑛 some 𝜈𝑛∈Γ˚∩ℒ︀𝑛 such that 𝜈𝑛→𝜈. By the continuity of the relative entropy on the restricted domain,

lim inf 𝑛 → ∞ 1 𝑛 log 𝑃 𝜇 ( 𝐿 𝑛 𝐘 ∈ Γ ) ≥ − lim sup 𝑛 → ∞ 𝐻 ( 𝜈 𝑛 | 𝜇 ) = − 𝐻 ( 𝜈 | 𝜇 ) .

The theorem follows since 𝜈∈Γ˚ is arbitrary as long as Σ𝜈⊂Σ𝜇, and 𝐻(𝜈|𝜇)=∞ whenever Σ𝜈⊈Σ𝜇. □

As an application of Sanov’s theorem, we prove a version of Cramér’s theorem concerning Large Deviations for the empirical mean. Let 𝑓:Σ→ℝ be a function. We identify 𝑓 with the vector 𝐟∈ℝ|Σ| so that the empirical average 𝑆ˆ𝑛=1𝑛∑𝑖=1𝑛𝑓(𝑌𝑖) can be written as the inner product 𝑆ˆ𝑛=⟨𝐿𝑛𝐘,𝐟⟩. Sanov’s theorem then implies the following result.

Theorem 1.7 (Cramér). For any set 𝐴⊆ℝ,

− inf 𝑥 ∈ 𝐴 ˚ 𝐼 ( 𝑥 ) ≤ lim inf 𝑛 → ∞ 1 𝑛 log 𝑃 𝜇 ( 𝑆 ˆ 𝑛 ∈ 𝐴 ) ≤ lim sup 𝑛 → ∞ 1 𝑛 log 𝑃 𝜇 ( 𝑆 ˆ 𝑛 ∈ 𝐴 ) ≤ − inf 𝑥 ∈ 𝐴 ─ 𝐼 ( 𝑥 ) ,

where 𝐼(𝑥)=inf𝜈:⟨𝜈,𝐟⟩=𝑥𝐻(𝜈|𝜇). The rate function 𝐼 is continuous on the interval [min𝑎∈Σ𝜇𝑓(𝑎),max𝑎∈Σ𝜇𝑓(𝑎)] and satisfies

𝐼 ( 𝑥 ) = sup 𝜆 ∈ ℝ [ 𝜆 𝑥 − Λ ( 𝜆 ) ] ,

where

Λ ( 𝜆 ) = log ∑ 𝑎 ∈ Σ 𝜇 ( 𝑎 ) 𝑒 𝜆 𝑓 ( 𝑎 ) .

Proof. We provide two proofs of the theorem.

(1) The formula

𝐼 ( 𝑥 ) = inf 𝜈 : ⟨ 𝜈 , 𝐟 ⟩ = 𝑥 𝐻 ( 𝜈 | 𝜇 ) = inf 𝜈 ∈ 𝑀 1 ( Σ ) sup 𝜆 ∈ ℝ [ 𝜆 𝑥 − ∑ 𝑎 ∈ Σ 𝜈 ( 𝑎 ) log ( 𝜇 ( 𝑎 ) 𝑒 𝜆 𝑓 ( 𝑎 ) 𝜈 ( 𝑎 ) ) ]

follows from that 𝑆ˆ𝑛=⟨𝐿𝑛𝐘,𝐟⟩ and that 𝜈↦⟨𝜈,𝐟⟩ is a continuous function. Moreover, in view of the formula, 𝐼 is clearly continuous on its effective domain [min𝑎∈Σ𝜇𝑓(𝑎),max𝑎∈Σ𝜇𝑓(𝑎)]. We note that the optimization problem here is a classical problem in convex optimization where strong duality holds (see, for example, [1, Section 5]); specifically, one can swap inf and sup without changing the value of the expression:

𝐼 ( 𝑥 ) = sup 𝜆 ∈ ℝ inf 𝜈 ∈ 𝑀 1 ( Σ ) [ 𝜆 𝑥 − ∑ 𝑎 ∈ Σ 𝜈 ( 𝑎 ) log ( 𝜇 ( 𝑎 ) 𝑒 𝜆 𝑓 ( 𝑎 ) 𝜈 ( 𝑎 ) ) ] ,

The inner minimization can then be solved using Gibbs inequality (or Jensen’s inequality applied to 𝑥↦𝑥log𝑥), yielding

𝐼 ( 𝑥 ) = sup 𝜆 ∈ ℝ [ 𝜆 𝑥 − log ∑ 𝑎 ∈ Σ 𝜇 ( 𝑎 ) 𝑒 𝜆 𝑓 ( 𝑎 ) ] .

This establishes the Fenchel–Legendre transform representation.

(2) Alternatively, this result is a special case of Cramér’s theorem for real-valued random variables, and its rate function 𝐼(𝑥)=Λ∗(𝑥), a fortiori, is the Fenchel–Legendre transform of the logarithmic moment generating function

Λ ( 𝜆 ) = log 𝔼 [ 𝑒 𝜆 𝑓 ( 𝑌 1 ) ] = log ∑ 𝑎 ∈ Σ 𝜇 ( 𝑎 ) 𝑒 𝜆 𝑓 ( 𝑎 ) .

It remains to show that Λ∗(𝑥)=inf𝜈:⟨𝜈,𝐟⟩=𝑥𝐻(𝜈|𝜇), for, once established, the continuity of 𝐼 follows from that of 𝐻(⋅|𝜇) immediately. To this end, it suffices to show that Λ∗(𝑥)≥inf𝜈:⟨𝜈,𝐟⟩=𝑥𝐻(𝜈|𝜇), since by Gibbs’ inequality,

𝜆 ⟨ 𝐟 , 𝜈 ⟩ − 𝐻 ( 𝜈 | 𝜇 ) = ∑ 𝑎 ∈ Σ 𝜈 ( 𝑎 ) log ( 𝜇 ( 𝑎 ) 𝑒 𝜆 𝑓 ( 𝑎 ) 𝜈 ( 𝑎 ) ) ≤ Λ ( 𝜆 )

for all 𝜈∈𝑀1(Σ) and 𝜆∈ℝ, implying Λ∗(𝑥)≤inf𝜈:⟨𝜈,𝐟⟩=𝑥𝐻(𝜈|𝜇).

Recall that Λ is convex and differentiable in the interior of its effective domain. By asymptotic analysis of the derivative Λ′(𝜆), for every 𝑥∈(min𝑎∈Σ𝜇𝑓(𝑎),max𝑎∈Σ𝜇𝑓(𝑎)), there exists 𝜆∈ℝ such that

𝑥 = Λ′ ( 𝜆 ) = ∑ 𝑎 ∈ Σ 𝑓 ( 𝑎 ) 𝜇 ( 𝑎 ) 𝑒 𝜆 𝑓 ( 𝑎 ) ∑ 𝑎 ∈ Σ 𝜇 ( 𝑎 ) 𝑒 𝜆 𝑓 ( 𝑎 ) ⇒ Λ ∗ ( 𝑥 ) = 𝜆 𝑥 − Λ ( 𝜆 ) .

Choosing 𝜂𝑎=𝜇(𝑎)𝑒𝜆𝑓(𝑎)∑𝑏𝜇(𝑏)𝑒𝜆𝑓(𝑏), we have ⟨𝜂,𝐟⟩=𝑥 and

Λ ∗ ( 𝑥 ) = 𝜆 𝑥 − Λ ( 𝜆 ) = 𝐻 ( 𝜂 | 𝜇 ) ≥ inf 𝜈 : ⟨ 𝜈 , 𝐟 ⟩ = 𝑥 𝐻 ( 𝜈 | 𝜇 )

as desired. For the boundary point 𝑥=max𝑎∈Σ𝜇𝑓(𝑎) (the case for min is similar), we have that

inf 𝜈 : ⟨ 𝜈 , 𝐟 ⟩ = 𝑥 𝐻 ( 𝜈 | 𝜇 ) = − log 𝜇 ( { 𝑎 ∈ Σ : 𝑓 ( 𝑎 ) = 𝑥 } ) .

and, through direct evaluation, that

Λ ∗ ( 𝑥 ) = lim 𝜆 → ∞ [ 𝜆 𝑥 − Λ ( 𝜆 ) ] = − log 𝜇 ( { 𝑎 ∈ Σ : 𝑓 ( 𝑎 ) = 𝑥 } ) .

Combining these results proves Λ∗(𝑥)=inf𝜈:⟨𝜈,𝐟⟩=𝑥𝐻(𝜈|𝜇). Finally, for 𝑥∉[min𝑎∈Σ𝜇𝑓(𝑎),max𝑎∈Σ𝜇𝑓(𝑎)], one can show Λ∗(𝑥)=∞. This concludes the proof. □

References

  • [1] Boyd, Stephen, and Vandenberghe, Lieven, Convex Optimization, Cambridge University Press, 2004.↩