[][src]Struct rv::dist::SymmetricDirichlet

pub struct SymmetricDirichlet {
    pub alpha: f64,
    pub k: usize,
}

Symmetric Dirichlet distribution where all alphas are the same.

SymmetricDirichlet { alpha, k } is mathematicall equivalent to Dirichlet { alphas: vec![alpha; k] }. This version has some extra optimizations to seep up computing the PDF and drawing random vectors.

Fields

alpha: f64k: usize

Methods

impl SymmetricDirichlet[src]

pub fn new(alpha: f64, k: usize) -> Result<Self>[src]

pub fn jeffreys(k: usize) -> Result<Self>[src]

Trait Implementations

impl Rv<Vec<f64>> for SymmetricDirichlet[src]

fn f(&self, x: &X) -> f64[src]

Probability function Read more

fn sample<R: Rng>(&self, n: usize, rng: &mut R) -> Vec<X>[src]

Multiple draws of the Rv Read more

impl Rv<Categorical> for SymmetricDirichlet[src]

fn f(&self, x: &X) -> f64[src]

Probability function Read more

fn sample<R: Rng>(&self, n: usize, rng: &mut R) -> Vec<X>[src]

Multiple draws of the Rv Read more

impl Support<Vec<f64>> for SymmetricDirichlet[src]

impl ContinuousDistr<Vec<f64>> for SymmetricDirichlet[src]

fn pdf(&self, x: &X) -> f64[src]

The value of the Probability Density Function (PDF) at x Read more

fn ln_pdf(&self, x: &X) -> f64[src]

The value of the log Probability Density Function (PDF) at x Read more

impl<X: CategoricalDatum> ConjugatePrior<X, Categorical> for SymmetricDirichlet[src]

type Posterior = Dirichlet

fn m(&self, x: &DataOrSuffStat<X, Fx>) -> f64[src]

Marginal likelihood of x

fn pp(&self, y: &X, x: &DataOrSuffStat<X, Fx>) -> f64[src]

Posterior Predictive distribution

impl PartialOrd<SymmetricDirichlet> for SymmetricDirichlet[src]

impl<'_> From<&'_ SymmetricDirichlet> for String[src]

impl PartialEq<SymmetricDirichlet> for SymmetricDirichlet[src]

impl Clone for SymmetricDirichlet[src]

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

Performs copy-assignment from source. Read more

impl Display for SymmetricDirichlet[src]

impl Debug for SymmetricDirichlet[src]

Auto Trait Implementations

Blanket Implementations

impl<T> ApiReady for T where
    T: Clone + Debug + PartialOrd<T> + PartialEq<T>, 
[src]

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

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

type Owned = T

The resulting type after obtaining ownership.

impl<T> ToString for T where
    T: Display + ?Sized
[src]

impl<T, U> Into<U> for T where
    U: From<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> BorrowMut<T> for T where
    T: ?Sized
[src]

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

impl<T> Any for T where
    T: 'static + ?Sized
[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>,