Struct probability::distribution::Bernoulli [] [src]

pub struct Bernoulli {
    // some fields omitted
}

A Bernoulli distribution.

Methods

impl Bernoulli
[src]

fn new(p: f64) -> Bernoulli

Create a Bernoulli distribution with success probability p.

It should hold that p > 0 and p < 1.

fn with_failure(q: f64) -> Bernoulli

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.

fn p(&self) -> f64

Return the success probability.

fn q(&self) -> f64

Return the failure probability.

Trait Implementations

impl Copy for Bernoulli
[src]

impl Clone for Bernoulli
[src]

fn clone(&self) -> Bernoulli

Returns a copy of the value. Read more

fn clone_from(&mut self, source: &Self)
1.0.0

Performs copy-assignment from source. Read more

impl Distribution for Bernoulli
[src]

type Value = u8

The type of outcomes.

fn cdf(&self, x: f64) -> f64

Compute the distribution function. Read more

impl Discrete for Bernoulli
[src]

fn pmf(&self, x: u8) -> f64

Compute the probability mass function.

impl Entropy for Bernoulli
[src]

fn entropy(&self) -> f64

Compute the differential entropy. Read more

impl Inverse for Bernoulli
[src]

fn inv_cdf(&self, p: f64) -> u8

Compute the inverse of the distribution function.

impl Kurtosis for Bernoulli
[src]

fn kurtosis(&self) -> f64

Compute the excess kurtosis.

impl Mean for Bernoulli
[src]

fn mean(&self) -> f64

Compute the expected value.

impl Median for Bernoulli
[src]

fn median(&self) -> f64

Compute the median.

impl Modes for Bernoulli
[src]

fn modes(&self) -> Vec<u8>

Compute the modes.

impl Sample for Bernoulli
[src]

fn sample<S>(&self, source: &mut S) -> u8 where S: Source

Draw a sample.

impl Skewness for Bernoulli
[src]

fn skewness(&self) -> f64

Compute the skewness.

impl Variance for Bernoulli
[src]

fn variance(&self) -> f64

Compute the variance.

fn deviation(&self) -> f64

Compute the standard deviation.

fn var(&self) -> f64

Compute the variance. Read more

fn sd(&self) -> f64

Compute the standard deviation. Read more