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

pub struct Bernoulli { /* fields omitted */ }

A Bernoulli distribution.

Implementations

impl Bernoulli[src]

pub fn new(p: f64) -> Self[src]

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]

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]

Return the success probability.

pub fn q(&self) -> f64[src]

Return the failure probability.

Trait Implementations

impl Clone for Bernoulli[src]

impl Copy for Bernoulli[src]

impl Debug for Bernoulli[src]

impl Discrete for Bernoulli[src]

impl Distribution for Bernoulli[src]

type Value = u8

The type of outcomes.

impl Entropy for Bernoulli[src]

impl Inverse for Bernoulli[src]

impl Kurtosis for Bernoulli[src]

impl Mean for Bernoulli[src]

impl Median for Bernoulli[src]

impl Modes for Bernoulli[src]

impl Sample for Bernoulli[src]

impl Skewness for Bernoulli[src]

impl Variance for Bernoulli[src]

Auto Trait Implementations

impl RefUnwindSafe for Bernoulli

impl Send for Bernoulli

impl Sync for Bernoulli

impl Unpin for Bernoulli

impl UnwindSafe for Bernoulli

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.