pub struct Binomial { /* private fields */ }
Implementations§
Source§impl Binomial
impl Binomial
pub fn new(n: usize, p: Probability) -> Result<Binomial, Error>
pub fn new_unchecked(n: usize, p: Probability) -> Binomial
Trait Implementations§
Source§impl Convolution<Bernoulli> for Binomial
impl Convolution<Bernoulli> for Binomial
Source§impl Convolution for Binomial
impl Convolution for Binomial
Source§impl DiscreteDistribution for Binomial
impl DiscreteDistribution for Binomial
Source§impl Distribution for Binomial
impl Distribution for Binomial
Source§fn params(&self) -> Params
fn params(&self) -> Params
Returns an instance of the distribution parameters,
Self::Params
. Read moreSource§fn cdf(&self, k: &usize) -> Probability
fn cdf(&self, k: &usize) -> Probability
Evaluates the cumulative distribution function (CDF) at \(x\). Read more
Source§fn sample<R: Rng + ?Sized>(&self, rng: &mut R) -> usize
fn sample<R: Rng + ?Sized>(&self, rng: &mut R) -> usize
Draw a random value from the distribution support.
Source§fn into_support(self) -> Self::Support
fn into_support(self) -> Self::Support
Converts
self
into an instance of Self::Support
.Source§fn into_params(self) -> Self::Params
fn into_params(self) -> Self::Params
Converts
self
into an instance of Self::Params
.Source§fn ccdf(&self, x: &Sample<Self>) -> Probability
fn ccdf(&self, x: &Sample<Self>) -> Probability
Evaluates the complementary CDF at \(x\). Read more
Source§fn log_cdf(&self, x: &Sample<Self>) -> f64
fn log_cdf(&self, x: &Sample<Self>) -> f64
Evaluates the log CDF at \(x\), i.e. \(\ln{F(x)}\).
Source§fn log_ccdf(&self, x: &Sample<Self>) -> f64
fn log_ccdf(&self, x: &Sample<Self>) -> f64
Evaluates the log complementary CDF at \(x\), i.e. \(\ln{(1 - F(x))}\).
Source§impl FisherInformation for Binomial
impl FisherInformation for Binomial
Source§fn fisher_information(&self) -> Array2<f64>
fn fisher_information(&self) -> Array2<f64>
Computes the Fisher information matrix of the distribution, \(I(X)\).
Source§impl Quantiles for Binomial
impl Quantiles for Binomial
Source§fn quantile(&self, _: Probability) -> f64
fn quantile(&self, _: Probability) -> f64
Evaluates the inverse cumulative distribution function (CDF) at
p
. Read moreSource§fn cquantile(&self, p: Probability) -> f64
fn cquantile(&self, p: Probability) -> f64
Evaluates the complementary quantile function at
x
: Q(1 - p)
.Source§fn lower_quartile(&self) -> f64
fn lower_quartile(&self) -> f64
Computes the lower quartile of the distribution,
Q(0.25)
.Source§fn upper_quartile(&self) -> f64
fn upper_quartile(&self) -> f64
Computes the upper quartile of the distribution,
Q(0.75)
.Source§fn iqr(&self) -> f64
fn iqr(&self) -> f64
Computes the interquartile range (IQR) of the distribution,
Q(0.75) - Q(0.25)
.Source§fn lower_fence(&self) -> f64
fn lower_fence(&self) -> f64
Computes the lower fence of the distribution,
Q(0.25) - 1.5 · IQR
. Read moreSource§fn upper_fence(&self) -> f64
fn upper_fence(&self) -> f64
Computes the lower fence of the distribution,
Q(0.75) + 1.5 · IQR
. Read moreSource§impl ShannonEntropy for Binomial
impl ShannonEntropy for Binomial
Source§fn shannon_entropy(&self) -> f64
fn shannon_entropy(&self) -> f64
Computes the Shannon entropy of the distribution, \(H(X)\).
Source§impl UnivariateMoments for Binomial
impl UnivariateMoments for Binomial
Source§fn standard_deviation(&self) -> f64
fn standard_deviation(&self) -> f64
Computes the standard deviation of the distribution.
Source§fn excess_kurtosis(&self) -> f64
fn excess_kurtosis(&self) -> f64
Computes the excess kurtosis of the distribution.
impl Copy for Binomial
Auto Trait Implementations§
impl Freeze for Binomial
impl RefUnwindSafe for Binomial
impl Send for Binomial
impl Sync for Binomial
impl Unpin for Binomial
impl UnwindSafe for Binomial
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more