Documentation

CslibFrontier.Probability.HypothesisSelection.Likelihood

Likelihood-ratio Chernoff bounds and finite-family MLE #

This module proves the Bhattacharyya / likelihood-ratio Chernoff bound for discrete distributions and uses it to bound the Hellinger estimation error of maximum likelihood estimation (MLE) over a finite family of models, building on CslibFrontier.Probability.Hellinger (see [Can22] and [Tsy09] for background; the discrete finite-family likelihood-ratio Chernoff and MLE formulations below are proved in this library).

Main definitions #

Main results #

References #

theorem Cslib.Probability.PMF.toOuterMeasure_mul_le_bhattacharyya_div_sqrt {α : Type u_1} (p q : PMF α) {c : ℝ} (hc : 0 < c) :

Weighted single-sample likelihood-ratio bound: the p-probability of {a | c * p a ≤ q a} is at most bhattacharyya p q / √c for every c > 0.

Single-sample likelihood-ratio Chernoff bound: (p.toOuterMeasure {a | p a ≤ q a}).toReal ≤ bhattacharyya p q.

Real-valued form of the single-sample likelihood-ratio Chernoff bound.

theorem Cslib.Probability.PMF.toOuterMeasure_iid_mul_le_bhattacharyya_pow_div_sqrt {α : Type u_1} [Finite α] (p q : PMF α) (n : ℕ) {c : ℝ} (hc : 0 < c) :
((iid p n).toOuterMeasure {x : Fin n → α | c * ((iid p n) x).toReal ≤ ((iid q n) x).toReal}).toReal ≤ bhattacharyya p q ^ n / √c

Weighted n-fold i.i.d. likelihood-ratio Chernoff bound: for c > 0, ((iid p n).toOuterMeasure {x | c * (iid p n x).toReal ≤ (iid q n x).toReal}).toReal ≤ bhattacharyya p q ^ n / √c.

theorem Cslib.Probability.PMF.toOuterMeasure_iid_le_bhattacharyya_pow {α : Type u_1} [Finite α] (p q : PMF α) (n : ℕ) :
((iid p n).toOuterMeasure {x : Fin n → α | (iid p n) x ≤ (iid q n) x}).toReal ≤ bhattacharyya p q ^ n

The n-fold i.i.d. likelihood-ratio Chernoff bound: ((iid p n).toOuterMeasure {x | iid p n x ≤ iid q n x}).toReal ≤ bhattacharyya p q ^ n.

theorem Cslib.Probability.PMF.toOuterMeasure_iid_prod_le_bhattacharyya_pow {α : Type u_1} [Finite α] (p q : PMF α) (n : ℕ) :
((iid p n).toOuterMeasure {x : Fin n → α | ∏ i : Fin n, p (x i) ≤ ∏ i : Fin n, q (x i)}).toReal ≤ bhattacharyya p q ^ n

Product form of the n-fold i.i.d. likelihood-ratio Chernoff bound.

theorem Cslib.Probability.PMF.toOuterMeasure_iid_prod_toReal_le_bhattacharyya_pow {α : Type u_1} [Finite α] (p q : PMF α) (n : ℕ) :
((iid p n).toOuterMeasure {x : Fin n → α | ∏ i : Fin n, (p (x i)).toReal ≤ ∏ i : Fin n, (q (x i)).toReal}).toReal ≤ bhattacharyya p q ^ n

Real-valued product form of the n-fold i.i.d. likelihood-ratio Chernoff bound.

Exponential upper bound on the n-th power of the Bhattacharyya coefficient: bhattacharyya p q ^ n ≤ Real.exp (-n * hellingerSq p q).

theorem Cslib.Probability.PMF.toOuterMeasure_iid_le_exp_hellingerSq {α : Type u_1} [Finite α] (p q : PMF α) (n : ℕ) :
((iid p n).toOuterMeasure {x : Fin n → α | (iid p n) x ≤ (iid q n) x}).toReal ≤ Real.exp (-↑n * hellingerSq p q)

Exponential Hellinger form of the n-fold i.i.d. likelihood-ratio Chernoff bound in terms of hellingerSq.

theorem Cslib.Probability.PMF.toOuterMeasure_iid_le_exp_hellingerDist {α : Type u_1} [Finite α] (p q : PMF α) (n : ℕ) :
((iid p n).toOuterMeasure {x : Fin n → α | (iid p n) x ≤ (iid q n) x}).toReal ≤ Real.exp (-↑n * hellingerDist p q ^ 2)

Exponential Hellinger form of the n-fold i.i.d. likelihood-ratio Chernoff bound in terms of hellingerDist: ((iid p n).toOuterMeasure {x | iid p n x ≤ iid q n x}).toReal ≤ Real.exp (-n * hellingerDist p q ^ 2).

noncomputable def Cslib.Probability.HypothesisSelection.mle {ι : Type u_1} {α : Type u_2} (s : Finset ι) (hs : s.Nonempty) (models : ι → PMF α) {n : ℕ} (x : Fin n → α) :
ι

Maximum likelihood estimator over a nonempty finite family of distributions models indexed by s : Finset ι. Returns an index i ∈ s maximizing iid (models i) n x.

theorem Cslib.Probability.HypothesisSelection.mle_mem {ι : Type u_1} {α : Type u_2} (s : Finset ι) (hs : s.Nonempty) (models : ι → PMF α) {n : ℕ} (x : Fin n → α) :
mle s hs models x ∈ s

Membership of mle s hs models x in s.

theorem Cslib.Probability.HypothesisSelection.le_iid_mle {ι : Type u_1} {α : Type u_2} (s : Finset ι) (hs : s.Nonempty) (models : ι → PMF α) {n : ℕ} (x : Fin n → α) {j : ι} (hj : j ∈ s) :
(PMF.iid (models j) n) x ≤ (PMF.iid (models (mle s hs models x)) n) x

Optimality of mle: the selected model maximizes iid (models i) n x over s.

theorem Cslib.Probability.HypothesisSelection.mle_hellingerDist_gt_le_sum_bhattacharyya {ι : Type u_1} {α : Type u_2} [DecidableEq ι] [Finite α] (s : Finset ι) (hs : s.Nonempty) (models : ι → PMF α) {i₀ : ι} (hi₀ : i₀ ∈ s) (n : ℕ) {r : ℝ} (hr : 0 ≤ r) :
((PMF.iid (models i₀) n).toOuterMeasure {x : Fin n → α | r < PMF.hellingerDist (models i₀) (models (mle s hs models x))}).toReal ≤ ∑ j ∈ s.erase i₀ with r < PMF.hellingerDist (models i₀) (models j), PMF.bhattacharyya (models i₀) (models j) ^ n

Sharp Bhattacharyya sum bound for MLE over a finite family when the true model models i₀ lies in s: the probability of selecting a model outside Hellinger radius r ≥ 0 is at most the sum of bhattacharyya (models i₀) (models j) ^ n over j ∈ s.erase i₀ beyond radius r.

theorem Cslib.Probability.HypothesisSelection.mle_hellingerDist_gt_le {ι : Type u_1} {α : Type u_2} [Finite α] (s : Finset ι) (hs : s.Nonempty) (models : ι → PMF α) {i₀ : ι} (hi₀ : i₀ ∈ s) (n : ℕ) {r : ℝ} (hr : 0 ≤ r) :
((PMF.iid (models i₀) n).toOuterMeasure {x : Fin n → α | r < PMF.hellingerDist (models i₀) (models (mle s hs models x))}).toReal ≤ (↑s.card - 1) * Real.exp (-↑n * r ^ 2)

Maximum likelihood estimation over s (|s| = M) returns a model within Hellinger radius r ≥ 0 (strict failure r < h) except with probability at most (M - 1) * exp (-n * r ^ 2).

theorem Cslib.Probability.HypothesisSelection.mle_hellingerDist_ge_le {ι : Type u_1} {α : Type u_2} [Finite α] (s : Finset ι) (hs : s.Nonempty) (models : ι → PMF α) {i₀ : ι} (hi₀ : i₀ ∈ s) (n : ℕ) {r : ℝ} (hr : 0 < r) :
((PMF.iid (models i₀) n).toOuterMeasure {x : Fin n → α | r ≤ PMF.hellingerDist (models i₀) (models (mle s hs models x))}).toReal ≤ (↑s.card - 1) * Real.exp (-↑n * r ^ 2)

Non-strict Hellinger radius bound r ≤ h for MLE when 0 < r.

noncomputable def Cslib.Probability.HypothesisSelection.mleFin {α : Type u_2} {M : ℕ} [NeZero M] (models : Fin M → PMF α) {n : ℕ} (x : Fin n → α) :
Fin M

Maximum likelihood estimator over an indexed family of M candidate distributions (M > 0).

theorem Cslib.Probability.HypothesisSelection.mleFin_hellingerDist_gt_le {α : Type u_2} [Finite α] {M : ℕ} [NeZero M] (models : Fin M → PMF α) (i₀ : Fin M) (n : ℕ) {r : ℝ} (hr : 0 ≤ r) :
((PMF.iid (models i₀) n).toOuterMeasure {x : Fin n → α | r < PMF.hellingerDist (models i₀) (models (mleFin models x))}).toReal ≤ (↑M - 1) * Real.exp (-↑n * r ^ 2)

MLE over M models (M > 0) returns a model within Hellinger radius r ≥ 0 except with probability at most (M - 1) * Real.exp (-n * r ^ 2) when models i₀ generates the samples.

theorem Cslib.Probability.HypothesisSelection.mleFin_hellingerDist_ge_le {α : Type u_2} [Finite α] {M : ℕ} [NeZero M] (models : Fin M → PMF α) (i₀ : Fin M) (n : ℕ) {r : ℝ} (hr : 0 < r) :
((PMF.iid (models i₀) n).toOuterMeasure {x : Fin n → α | r ≤ PMF.hellingerDist (models i₀) (models (mleFin models x))}).toReal ≤ (↑M - 1) * Real.exp (-↑n * r ^ 2)

Non-strict Hellinger radius bound for mleFin when 0 < r.

theorem Cslib.Probability.HypothesisSelection.mleFin_hellingerDist_ge_le_of_log {α : Type u_2} [Finite α] {M : ℕ} [NeZero M] (models : Fin M → PMF α) (i₀ : Fin M) {n : ℕ} {r δ : ℝ} (hr : 0 < r) (hδ : 0 < δ) (hn : Real.log (↑M / δ) / r ^ 2 ≤ ↑n) :
((PMF.iid (models i₀) n).toOuterMeasure {x : Fin n → α | r ≤ PMF.hellingerDist (models i₀) (models (mleFin models x))}).toReal ≤ δ

Sample complexity of mleFin: n ≥ log (M / δ) / r ^ 2 suffices for mleFin to succeed within Hellinger radius r > 0 with failure probability at most δ > 0.