Documentation

CslibFrontier.Probability.HypothesisSelection.Tournament

Scheffé and Le Cam–Birgé tournament hypothesis selection #

This module implements parameter-free tournament selection algorithms over finite candidate families using the robust pairwise tests from CslibFrontier.Probability.HypothesisSelection.LeCamBirge:

  1. Scheffé TV minimum-distance / tournament selection (scheffeSelect): scores each candidate qᵢ by its worst empirical Scheffé discrepancy max_{j ∈ s} |μ_n(A_{j,i}) - qᵢ(A_{j,i})| over the pairwise Scheffé witness sets A_{j,i} = {a | qᵢ(a) < qⱼ(a)}, and selects a minimizer. Under any true distribution p (not necessarily in the family), it outputs a model satisfying dist p q_hat ≤ 3 * dist p q_* + 2 * γ simultaneously for all q_* ∈ s, except with probability at most 2 * M * (M - 1) * Real.exp (-2 * n * γ ^ 2) (this one-sided scheffeScore formulation and Hoeffding union-bound proof are this library's formulation; see [DL01] as background).
  2. Adaptive Le Cam–Birgé Hellinger tournament (birgeTournamentSelect): runs all pairwise leCamBirgeTest comparisons, defines each candidate's maximum defeat radius, and selects a minimizer without needing prior knowledge of the approximation error r. Whenever some candidate q₀ satisfies h(p, q₀) ≤ r, the selected model satisfies h(p, q_hat) ≤ 11 * r except with probability at most 2 * (M - 1) * Real.exp (-4 * n * r ^ 2) (this library's explicit constants derived from the clipped 1/3–2/3 birgeWeight test; see [LC73] and [Bir83] as background). Taking a finite Hellinger r-cover yields 11 * r agnostic selection over an arbitrary distribution class (birgeTournamentSelect_of_cover).

Main definitions #

Main results #

References #

noncomputable def Cslib.Probability.HypothesisSelection.scheffeScore {ι : Type u_1} {α : Type u_2} [Fintype α] [DecidableEq α] (s : Finset ι) (hs : s.Nonempty) (models : ι → PMF α) {n : ℕ} (x : Fin n → α) (i : ι) :

Worst empirical Scheffé discrepancy of candidate i against challengers in s: max_{j ∈ s} |empiricalMass (scheffeSet (models j) (models i)) x - (models i)(scheffeSet ...)|.

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

Scheffé tournament selector: picks an index in s minimizing scheffeScore.

theorem Cslib.Probability.HypothesisSelection.scheffeSelect_mem {ι : Type u_1} {α : Type u_2} [Fintype α] [DecidableEq α] (s : Finset ι) (hs : s.Nonempty) (models : ι → PMF α) {n : ℕ} (x : Fin n → α) :
scheffeSelect s hs models x ∈ s

Membership of scheffeSelect s hs models x in s.

theorem Cslib.Probability.HypothesisSelection.scheffeSelect_dist_le_of_forall {ι : Type u_1} {α : Type u_2} [Fintype α] [DecidableEq α] {p : PMF α} (s : Finset ι) (hs : s.Nonempty) (models : ι → PMF α) {n : ℕ} {x : Fin n → α} {γ : ℝ} (hγ : 0 ≤ γ) {i₀ : ι} (hi₀ : i₀ ∈ s) (hgood : ∀ j ∈ s, ∀ k ∈ s, j ≠ k → |empiricalMass (scheffeSet (models j) (models k)) x - (p.toOuterMeasure ↑(scheffeSet (models j) (models k))).toReal| ≤ γ) :
dist p (models (scheffeSelect s hs models x)) ≤ 3 * dist p (models i₀) + 2 * γ

Deterministic TV guarantee for scheffeSelect: if empirical frequencies on all pairwise Scheffé sets approximate p within γ ≥ 0, then dist p q_hat ≤ 3 * dist p q₀ + 2 * γ for every i₀ ∈ s.

theorem Cslib.Probability.HypothesisSelection.scheffeSelect_dist_lt_of_forall {ι : Type u_1} {α : Type u_2} [Fintype α] [DecidableEq α] {p : PMF α} (s : Finset ι) (hs : s.Nonempty) (models : ι → PMF α) {n : ℕ} {x : Fin n → α} {γ : ℝ} (hγ : 0 < γ) {i₀ : ι} (hi₀ : i₀ ∈ s) (hgood : ∀ j ∈ s, ∀ k ∈ s, j ≠ k → |empiricalMass (scheffeSet (models j) (models k)) x - (p.toOuterMeasure ↑(scheffeSet (models j) (models k))).toReal| < γ) :
dist p (models (scheffeSelect s hs models x)) < 3 * dist p (models i₀) + 2 * γ

Strict deterministic TV guarantee for scheffeSelect when γ > 0.

theorem Cslib.Probability.HypothesisSelection.scheffeSelect_prob_gt_le {ι : Type u_1} {α : Type u_2} [Fintype α] [DecidableEq α] (p : PMF α) (s : Finset ι) (hs : s.Nonempty) (models : ι → PMF α) {i₀ : ι} (hi₀ : i₀ ∈ s) (n : ℕ) {γ : ℝ} (hγ : 0 ≤ γ) :
((PMF.iid p n).toOuterMeasure {x : Fin n → α | 3 * dist p (models i₀) + 2 * γ < dist p (models (scheffeSelect s hs models x))}).toReal ≤ 2 * (↑s.card * (↑s.card - 1)) * Real.exp (-2 * ↑n * γ ^ 2)

Probabilistic TV localization guarantee for scheffeSelect (0 ≤ γ, strict failure event): for every p and i₀ ∈ s, `dist p (models (scheffeSelect s hs models x)) ≤ 3 * dist p (models i₀)

  • 2 * γexcept with probability at most2 * M * (M - 1) * Real.exp (-2 * n * γ ^ 2)`.
theorem Cslib.Probability.HypothesisSelection.scheffeSelect_prob_ge_le {ι : Type u_1} {α : Type u_2} [Fintype α] [DecidableEq α] (p : PMF α) (s : Finset ι) (hs : s.Nonempty) (models : ι → PMF α) {i₀ : ι} (hi₀ : i₀ ∈ s) (n : ℕ) {γ : ℝ} (hγ : 0 < γ) :
((PMF.iid p n).toOuterMeasure {x : Fin n → α | 3 * dist p (models i₀) + 2 * γ ≤ dist p (models (scheffeSelect s hs models x))}).toReal ≤ 2 * (↑s.card * (↑s.card - 1)) * Real.exp (-2 * ↑n * γ ^ 2)

Probabilistic TV localization guarantee for scheffeSelect (0 < γ, non-strict failure event).

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

Fin M-indexed specialization of scheffeSelect.

theorem Cslib.Probability.HypothesisSelection.scheffeSelectFin_prob_gt_le {α : Type u_2} [Fintype α] [DecidableEq α] (p : PMF α) {M : ℕ} [NeZero M] (models : Fin M → PMF α) (i₀ : Fin M) (n : ℕ) {γ : ℝ} (hγ : 0 ≤ γ) :
((PMF.iid p n).toOuterMeasure {x : Fin n → α | 3 * dist p (models i₀) + 2 * γ < dist p (models (scheffeSelectFin models x))}).toReal ≤ 2 * (↑M * (↑M - 1)) * Real.exp (-2 * ↑n * γ ^ 2)

Fin M TV localization guarantee for scheffeSelectFin (0 ≤ γ).

theorem Cslib.Probability.HypothesisSelection.scheffeSelectFin_prob_ge_le {α : Type u_2} [Fintype α] [DecidableEq α] (p : PMF α) {M : ℕ} [NeZero M] (models : Fin M → PMF α) (i₀ : Fin M) (n : ℕ) {γ : ℝ} (hγ : 0 < γ) :
((PMF.iid p n).toOuterMeasure {x : Fin n → α | 3 * dist p (models i₀) + 2 * γ ≤ dist p (models (scheffeSelectFin models x))}).toReal ≤ 2 * (↑M * (↑M - 1)) * Real.exp (-2 * ↑n * γ ^ 2)

Fin M TV localization guarantee for scheffeSelectFin (0 < γ).

theorem Cslib.Probability.HypothesisSelection.scheffeSelectFin_ge_le_of_log {α : Type u_2} [Fintype α] [DecidableEq α] (p : PMF α) {M : ℕ} [NeZero M] (models : Fin M → PMF α) (i₀ : Fin M) {n : ℕ} {γ δ : ℝ} (hγ : 0 < γ) (hδ : 0 < δ) (hn : Real.log (2 * ↑M ^ 2 / δ) / (2 * γ ^ 2) ≤ ↑n) :
((PMF.iid p n).toOuterMeasure {x : Fin n → α | 3 * dist p (models i₀) + 2 * γ ≤ dist p (models (scheffeSelectFin models x))}).toReal ≤ δ

Sample complexity for scheffeSelectFin: n ≥ log (2 * M^2 / δ) / (2 * γ^2) suffices for dist p (models (scheffeSelectFin models x)) < 3 * dist p (models i₀) + 2 * γ with probability at least 1 - δ.

theorem Cslib.Probability.HypothesisSelection.scheffeSelect_of_cover {ι : Type u_1} {α : Type u_2} [Fintype α] [DecidableEq α] (s : Finset ι) (hs : s.Nonempty) (models : ι → PMF α) (ℱ : Set (PMF α)) {r γ : ℝ} (hγ : 0 ≤ γ) (hcov : ∀ p ∈ ℱ, ∃ i ∈ s, dist p (models i) ≤ r) {p : PMF α} (hp : p ∈ ℱ) (n : ℕ) :
((PMF.iid p n).toOuterMeasure {x : Fin n → α | 3 * r + 2 * γ < dist p (models (scheffeSelect s hs models x))}).toReal ≤ 2 * (↑s.card * (↑s.card - 1)) * Real.exp (-2 * ↑n * γ ^ 2)

Agnostic finite-cover TV guarantee for scheffeSelect: if models on s forms an r-cover of ℱ in TV distance, then for every p ∈ ℱ, scheffeSelect recovers a model within 3 * r + 2 * γ except with probability at most 2 * M * (M - 1) * Real.exp (-2 * n * γ ^ 2).

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

Maximum Hellinger defeat radius of candidate i in the pairwise Le Cam–Birgé tournament over s: the largest Hellinger distance h(models i, models j) to any challenger j ∈ s that defeats i (leCamBirgeTest (models i) (models j) x = false), or 0 if none defeats i.

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

Parameter-free Le Cam–Birgé Hellinger tournament selector: returns an index in s minimizing maxDefeatRadius.

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

Membership of birgeTournamentSelect s hs models x in s.

theorem Cslib.Probability.HypothesisSelection.birgeTournamentSelect_hellingerDist_le_of_good {ι : Type u_1} {α : Type u_2} [Finite α] {p : PMF α} (s : Finset ι) (hs : s.Nonempty) (models : ι → PMF α) {n : ℕ} {x : Fin n → α} {r : ℝ} {i₀ : ι} (hi₀ : i₀ ∈ s) (hp : PMF.hellingerDist p (models i₀) ≤ r) (hwin : ∀ j ∈ s, j ≠ i₀ → 10 * r ≤ PMF.hellingerDist (models i₀) (models j) → leCamBirgeTest (models i₀) (models j) x = true) (hlose : ∀ j ∈ s, j ≠ i₀ → 10 * r ≤ PMF.hellingerDist (models j) (models i₀) → leCamBirgeTest (models j) (models i₀) x = false) :
PMF.hellingerDist p (models (birgeTournamentSelect s hs models x)) ≤ 11 * r

Deterministic 11 * r Hellinger guarantee for birgeTournamentSelect: if h(p, models i₀) ≤ r and no test involving i₀ makes a 10 * r-separated error, then the selected model satisfies h(p, models i_hat) ≤ 11 * r.

theorem Cslib.Probability.HypothesisSelection.birgeTournamentSelect_hellingerDist_lt_of_good {ι : Type u_1} {α : Type u_2} [Finite α] {p : PMF α} (s : Finset ι) (hs : s.Nonempty) (models : ι → PMF α) {n : ℕ} {x : Fin n → α} {r : ℝ} (hr : 0 < r) {i₀ : ι} (hi₀ : i₀ ∈ s) (hp : PMF.hellingerDist p (models i₀) ≤ r) (hwin : ∀ j ∈ s, j ≠ i₀ → 10 * r ≤ PMF.hellingerDist (models i₀) (models j) → leCamBirgeTest (models i₀) (models j) x = true) (hlose : ∀ j ∈ s, j ≠ i₀ → 10 * r ≤ PMF.hellingerDist (models j) (models i₀) → leCamBirgeTest (models j) (models i₀) x = false) :
PMF.hellingerDist p (models (birgeTournamentSelect s hs models x)) < 11 * r

Strict deterministic 11 * r Hellinger guarantee for birgeTournamentSelect when r > 0.

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

Adaptive Hellinger localization guarantee for birgeTournamentSelect (r ≥ 0, strict failure event): whenever some candidate models i₀ satisfies h(p, models i₀) ≤ r, the selected model satisfies h(p, models i_hat) ≤ 11 * r except with probability at most 2 * (M - 1) * Real.exp (-4 * n * r ^ 2).

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

Non-strict failure event form of birgeTournamentSelect_prob_gt_le when r > 0.

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

Fin M-indexed specialization of birgeTournamentSelect.

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

Fin M Hellinger tournament bound (r ≥ 0).

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

Fin M Hellinger tournament bound (r > 0).

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

Sample complexity for birgeTournamentSelectFin: n ≥ log (2 * M / δ) / (4 * r^2) suffices for hellingerDist p (models (birgeTournamentSelectFin models x)) < 11 * r with probability at least 1 - δ.

theorem Cslib.Probability.HypothesisSelection.birgeTournamentSelect_of_cover {ι : Type u_1} {α : Type u_2} [Finite α] (s : Finset ι) (hs : s.Nonempty) (models : ι → PMF α) (ℱ : Set (PMF α)) {r : ℝ} (hr : 0 ≤ r) (hcov : ∀ p ∈ ℱ, ∃ i ∈ s, PMF.hellingerDist p (models i) ≤ r) {p : PMF α} (hp : p ∈ ℱ) (n : ℕ) :
((PMF.iid p n).toOuterMeasure {x : Fin n → α | 11 * r < PMF.hellingerDist p (models (birgeTournamentSelect s hs models x))}).toReal ≤ 2 * (↑s.card - 1) * Real.exp (-4 * ↑n * r ^ 2)

Agnostic finite-cover Hellinger guarantee: if models on s is a finite Hellinger r-cover of a class ℱ, then for every p ∈ ℱ, birgeTournamentSelect outputs a model within Hellinger radius 11 * r except with probability at most 2 * (s.card - 1) * Real.exp (-4 * n * r ^ 2).