Struct rv::data::BernoulliSuffStat[][src]

pub struct BernoulliSuffStat { /* fields omitted */ }

Sufficient statistic for the Bernoulli distribution.

Contains the number of trials and the number of successes.

Implementations

impl BernoulliSuffStat[src]

pub fn new() -> Self[src]

Create a new Bernoulli sufficient statistic

pub fn from_parts_unchecked(n: usize, k: usize) -> Self[src]

Create a sufficient statistic from components without checking whether they are valid.

pub fn n(&self) -> usize[src]

Get the total number of trials, n.

Example

let mut stat = BernoulliSuffStat::new();

stat.observe(&true);
stat.observe(&false);

assert_eq!(stat.n(), 2);

pub fn k(&self) -> usize[src]

Get the number of successful trials, k.

Example

let mut stat = BernoulliSuffStat::new();

stat.observe(&true);
stat.observe(&false);

assert_eq!(stat.k(), 1);

Trait Implementations

impl Clone for BernoulliSuffStat[src]

impl Debug for BernoulliSuffStat[src]

impl Default for BernoulliSuffStat[src]

impl Eq for BernoulliSuffStat[src]

impl<'a, X> From<&'a BernoulliSuffStat> for DataOrSuffStat<'a, X, Bernoulli> where
    X: Booleable
[src]

impl PartialEq<BernoulliSuffStat> for BernoulliSuffStat[src]

impl StructuralEq for BernoulliSuffStat[src]

impl StructuralPartialEq for BernoulliSuffStat[src]

impl<X: Booleable> SuffStat<X> for BernoulliSuffStat[src]

Auto Trait Implementations

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> Same<T> for T

type Output = T

Should always be Self

impl<SS, SP> SupersetOf<SS> for SP where
    SS: SubsetOf<SP>, 

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.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,