Skip to main content

dirichlet_distribution

Function dirichlet_distribution 

Source
pub fn dirichlet_distribution<U: UniformGenerator>(
    uniform_generator: &mut U,
    alpha: &[f64],
) -> Result<Vec<f64>, ErrorsJSL>
Expand description

A Dirichlet sample on the probability simplex, x_i = g_i / Σ g_j with independent g_i ~ Gamma(α_i, 1). Its mean is α_i / α₀ (α₀ = Σ α_i); two components give the beta distribution.