Documentation

CslibFrontier.MachineLearning.Replicable.BiasEstimation

Replicable bounded-mean and coin bias estimation #

This module provides an end-to-end replicable estimation client based on Hoeffding concentration and periodic grid rounding (roundGridProg) [ILPS22]:

Main definitions #

Main results #

References #

noncomputable def Cslib.MachineLearning.Replicable.empiricalMean {X : Type u_1} (f : X → ℝ) {m : ℕ} (S : Fin m → X) :

Sample average of f : X → ℝ over S : Fin m → X.

noncomputable def Cslib.MachineLearning.Replicable.distExpectation {X : Type u_1} (D : PMF X) (f : X → ℝ) :

Population expectation ∑' x, (D x).toReal * f x on a domain X.

noncomputable def Cslib.MachineLearning.Replicable.replicableMeanProg {X : Type} (f : X → ℝ) (w : ℝ) (N m : ℕ) [NeZero N] :
Program X (Fin N) ℝ m

ProbComp-backed ideal real-arithmetic program for replicable bounded-mean estimation via periodic grid rounding of empiricalMean f (interpreted semantically via Program.toAlgorithm).

theorem Cslib.MachineLearning.Replicable.boundedMean_concentrates {X : Type u_1} (D : PMF X) (f : X → ℝ) {a b : ℝ} (hf : ∀ x ∈ D.support, f x ∈ Set.Icc a b) (m : ℕ) [NeZero m] {δ : ℝ} (hδ : 0 ≤ δ) :
((Probability.PMF.iid D m).toOuterMeasure {S : Fin m → X | δ < |empiricalMean f S - distExpectation D f|}).toReal ≤ 2 * Real.exp (-2 * ↑m * δ ^ 2 / max (b - a) 1 ^ 2)

Hoeffding concentration of the empirical mean of an observable f : X → [a, b] under m ≥ 1 i.i.d. draws from D, using effective width M = max (b - a) 1.

theorem Cslib.MachineLearning.Replicable.estimates_replicableMeanProg {X : Type} (f : X → ℝ) {a b : ℝ} (hf : ∀ (x : X), f x ∈ Set.Icc a b) {w δ : ℝ} (hw : 0 < w) (hδ : 0 ≤ δ) (N m : ℕ) [NeZero N] [NeZero m] :
Estimates (replicableMeanProg f w N m).toAlgorithm (fun (D : PMF X) => distExpectation D f) (w / 2 + δ) (2 * Real.exp (-2 * ↑m * δ ^ 2 / max (b - a) 1 ^ 2))

Strong (w / 2 + δ, 2 * exp (-2 * m * δ^2 / (max (b - a) 1)^2))-estimation accuracy of replicableMeanProg.

theorem Cslib.MachineLearning.Replicable.isReplicable_replicableMeanProg {X : Type} (f : X → ℝ) {a b : ℝ} (hf : ∀ (x : X), f x ∈ Set.Icc a b) {w δ : ℝ} (hw : 0 < w) (hδ : 0 ≤ δ) (N m : ℕ) [NeZero N] [NeZero m] :
IsReplicable (replicableMeanProg f w N m).toAlgorithm (2 * δ / w + 1 / ↑N + 2 * (2 * Real.exp (-2 * ↑m * δ ^ 2 / max (b - a) 1 ^ 2)))

Strong ρ-replicability of replicableMeanProg for any bounded observable f : X → [a, b].

theorem Cslib.MachineLearning.Replicable.exists_replicableMeanProg {X : Type} (f : X → ℝ) {a b ε ρ β : ℝ} (hf : ∀ (x : X), f x ∈ Set.Icc a b) (hε : 0 < ε) (hρ : 0 < ρ) (hβ : 0 < β) :
∃ (w : ℝ) (N : ℕ) (m : ℕ) (x : NeZero N) (_ : NeZero m), 0 < w ∧ IsReplicable (replicableMeanProg f w N m).toAlgorithm ρ ∧ Estimates (replicableMeanProg f w N m).toAlgorithm (fun (D : PMF X) => distExpectation D f) ε β

Parameter synthesis for replicable bounded-mean estimation: for any domain X, bounded f : X → [a, b], and target (ε, ρ, β) with ε, ρ, β > 0, there exist w > 0 and N, m ≥ 1 making (replicableMeanProg f w N m).toAlgorithm strongly ρ-replicable and strongly (ε, β)-accurate.

True bias Pr_{x ~ D}[x = true] of a Bernoulli distribution D : PMF Bool.

noncomputable def Cslib.MachineLearning.Replicable.empiricalBias {m : ℕ} (S : Fin m → Bool) :

Empirical bias (fraction of true samples) of S : Fin m → Bool.

ProbComp-backed ideal real-arithmetic program for replicable coin bias estimation via periodic grid rounding of empiricalBias (interpreted semantically via Program.toAlgorithm).

theorem Cslib.MachineLearning.Replicable.estimates_replicableBiasProg {w δ : ℝ} (hw : 0 < w) (hδ : 0 ≤ δ) (N m : ℕ) [NeZero N] [NeZero m] :
Estimates (replicableBiasProg w N m).toAlgorithm coinBias (w / 2 + δ) (2 * Real.exp (-2 * ↑m * δ ^ 2))

Strong (w / 2 + δ, 2 * exp (-2 * m * δ^2))-estimation accuracy of replicableBiasProg for estimating coinBias D across all Bernoulli distributions D : PMF Bool.

theorem Cslib.MachineLearning.Replicable.isReplicable_replicableBiasProg {w δ : ℝ} (hw : 0 < w) (hδ : 0 ≤ δ) (N m : ℕ) [NeZero N] [NeZero m] :
IsReplicable (replicableBiasProg w N m).toAlgorithm (2 * δ / w + 1 / ↑N + 2 * (2 * Real.exp (-2 * ↑m * δ ^ 2)))

Strong ρ-replicability of replicableBiasProg across all distributions D : PMF Bool.

theorem Cslib.MachineLearning.Replicable.exists_replicableBiasProg {ε ρ β : ℝ} (hε : 0 < ε) (hρ : 0 < ρ) (hβ : 0 < β) :
∃ (w : ℝ) (N : ℕ) (m : ℕ) (x : NeZero N) (_ : NeZero m), 0 < w ∧ IsReplicable (replicableBiasProg w N m).toAlgorithm ρ ∧ Estimates (replicableBiasProg w N m).toAlgorithm coinBias ε β

Replicable coin bias-estimation theorem [ILPS22]: for any ε > 0, ρ > 0, and β > 0, there exist w > 0 and N, m ≥ 1 such that (replicableBiasProg w N m).toAlgorithm is strongly ρ-replicable and strongly (ε, β)-accurate for estimating coinBias D.