Struct rv::dist::Dirichlet[][src]

pub struct Dirichlet {
    pub alphas: Vec<f64>,
}

Dirichlet distribution over points on the k-simplex

Fields

A Vec of real numbers in (0, ∞)

Methods

impl Dirichlet
[src]

Creates a Dirichlet with a given alphas vector

Creates a Dirichlet where all alphas are identical

Eaxmples

let dir = Dirichlet::symmetric(1.0, 4);
assert_eq!(dir.alphas, vec![1.0, 1.0, 1.0, 1.0]);

Creates a Dirichlet with all alphas = 0.5 (Feffreys prior)

Eaxmples

let dir = Dirichlet::jeffreys(3);
assert_eq!(dir.alphas, vec![0.5, 0.5, 0.5]);

The length of alphas / the number of categories

Trait Implementations

impl Debug for Dirichlet
[src]

Formats the value using the given formatter. Read more

impl Clone for Dirichlet
[src]

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

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

Single draw from the Rv Read more

The log of the constant term in the PDF/PMF. Should not be a function of any of the parameters. Read more

Un-normalized probability function Read more

Un-normalized probability function Read more

The constant term in the PDF/PMF. Should not be a function of any of the parameters. Read more

Multiple draws of the Rv Read more

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

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

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

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

Returns true if x is in the support of the Rv Read more

impl Rv<Categorical> for Dirichlet
[src]

Un-normalized probability function Read more

The log of the constant term in the PDF/PMF. Should not be a function of any of the parameters. Read more

Single draw from the Rv Read more

Un-normalized probability function Read more

The constant term in the PDF/PMF. Should not be a function of any of the parameters. Read more

Multiple draws of the Rv Read more

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

Computes the posterior distribution from the data

Log marginal likelihood

Log posterior predictive of y given x

Marginal likelihood of x

Posterior Predictive distribution

Auto Trait Implementations

impl Send for Dirichlet

impl Sync for Dirichlet