Skip to main content

ConcentrationBound

Struct ConcentrationBound 

Source
pub struct ConcentrationBound;
Expand description

Concentration bounds for sums of independent bounded random variables.

Implementations§

Source§

impl ConcentrationBound

Source

pub fn hoeffding(t: f64, intervals: &[(f64, f64)]) -> f64

Hoeffding’s inequality: returns the upper bound on P(S_n - E[S_n] ≥ t) for n summands each bounded in [a_i, b_i].

Bound: exp(-2t² / Σ(b_i - a_i)²).

Source

pub fn markov(expectation: f64, a: f64) -> f64

Markov inequality: P(X ≥ a) ≤ E[X] / a for non-negative X.

Source

pub fn chebyshev(k: f64) -> f64

Chebyshev inequality: P(|X - μ| ≥ k·σ) ≤ 1/k².

Source

pub fn chernoff_upper(mu: f64, delta: f64) -> f64

Chernoff bound for the sum of Bernoulli(p_i) variables with mean μ.

Upper tail: P(X ≥ (1+δ)μ) ≤ (e^δ / (1+δ)^(1+δ))^μ.

Source

pub fn bernstein(t: f64, variance_sum: f64, c: f64) -> f64

Bernstein inequality for bounded random variables with variance s².

P(S_n ≥ t) ≤ exp(-t² / (2(s² + ct/3))) where c is the bound on individual terms.

Source

pub fn sub_gaussian_tail(t: f64, sigma: f64) -> f64

Sub-Gaussian tail bound: P(X ≥ t) ≤ exp(-t²/(2σ²)) for σ-sub-Gaussian X.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.