Struct probability::distribution::Bernoulli [−][src]
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]
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]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,