Struct probability::distribution::Bernoulli [−][src]
pub struct Bernoulli { /* fields omitted */ }
A Bernoulli distribution.
Methods
impl Bernoulli
[src]
impl Bernoulli
pub fn new(p: f64) -> Self
[src]
pub fn new(p: f64) -> Self
Create a Bernoulli distribution with success probability p
.
It should hold that p > 0
and p < 1
.
pub fn with_failure(q: f64) -> Self
[src]
pub fn with_failure(q: f64) -> Self
Create a Bernoulli distribution with failure probability q
.
It should hold that q > 0
and q < 1
. This constructor is preferable
when q
is very small.
pub fn p(&self) -> f64
[src]
pub fn p(&self) -> f64
Return the success probability.
pub fn q(&self) -> f64
[src]
pub fn q(&self) -> f64
Return the failure probability.
Trait Implementations
impl Clone for Bernoulli
[src]
impl Clone for Bernoulli
fn clone(&self) -> Bernoulli
[src]
fn clone(&self) -> Bernoulli
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
fn clone_from(&mut self, source: &Self)
1.0.0
[src]Performs copy-assignment from source
. Read more
impl Copy for Bernoulli
[src]
impl Copy for Bernoulli
impl Debug for Bernoulli
[src]
impl Debug for Bernoulli
fn fmt(&self, f: &mut Formatter) -> Result
[src]
fn fmt(&self, f: &mut Formatter) -> Result
Formats the value using the given formatter. Read more
impl Discrete for Bernoulli
[src]
impl Discrete for Bernoulli
impl Distribution for Bernoulli
[src]
impl Distribution for Bernoulli
type Value = u8
The type of outcomes.
fn distribution(&self, x: f64) -> f64
[src]
fn distribution(&self, x: f64) -> f64
Compute the cumulative distribution function.
impl Entropy for Bernoulli
[src]
impl Entropy for Bernoulli
impl Inverse for Bernoulli
[src]
impl Inverse for Bernoulli
impl Kurtosis for Bernoulli
[src]
impl Kurtosis for Bernoulli
impl Mean for Bernoulli
[src]
impl Mean for Bernoulli
impl Median for Bernoulli
[src]
impl Median for Bernoulli
impl Modes for Bernoulli
[src]
impl Modes for Bernoulli
impl Sample for Bernoulli
[src]
impl Sample for Bernoulli
impl Skewness for Bernoulli
[src]
impl Skewness for Bernoulli
impl Variance for Bernoulli
[src]
impl Variance for Bernoulli