[][src]Struct probability::prelude::Bernoulli

pub struct Bernoulli { /* fields omitted */ }

A Bernoulli distribution.

Methods

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 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]

fn deviation(&self) -> f64[src]

Compute the standard deviation.

impl Clone for Bernoulli[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 Debug for Bernoulli[src]

Auto Trait Implementations

impl Send for Bernoulli

impl Sync for Bernoulli

Blanket Implementations

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

type Owned = T

The resulting type after obtaining ownership.

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

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

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.

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

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

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