Struct probability::distribution::Categorical [−][src]
A categorical distribution.
Implementations
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 Clone for Categorical
[src]
fn clone(&self) -> Categorical
[src]
pub fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl Debug for Categorical
[src]
impl Discrete for Categorical
[src]
impl Distribution for Categorical
[src]
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]
Auto Trait Implementations
impl RefUnwindSafe for Categorical
impl Send for Categorical
impl Sync for Categorical
impl Unpin for Categorical
impl UnwindSafe for Categorical
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>,