[][src]Struct probability::distribution::Categorical

pub struct Categorical { /* fields omitted */ }

A categorical distribution.

Methods

impl Categorical[src]

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

Create a categorical distribution with success probability p.

It should hold that p[i] >= 0, p[i] <= 1, and sum(p) == 1.

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

Return the number of categories.

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

Return the event probabilities.

Trait Implementations

impl Discrete for Categorical[src]

impl Distribution for Categorical[src]

type Value = usize

The type of outcomes.

impl Entropy for Categorical[src]

impl Inverse for Categorical[src]

impl Kurtosis for Categorical[src]

impl Mean for Categorical[src]

impl Median for Categorical[src]

impl Modes for Categorical[src]

impl Sample for Categorical[src]

impl Skewness for Categorical[src]

impl Variance for Categorical[src]

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

Compute the standard deviation.

impl Clone for Categorical[src]

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

Performs copy-assignment from source. Read more

impl Debug for Categorical[src]

Auto Trait Implementations

impl Send for Categorical

impl Sync for Categorical

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]