pub struct Dirichlet {
pub alpha: Vec<f64>,
}Expand description
The Dirichlet distribution on the simplex (SciPy’s dirichlet(α)):
f(x) = Π x_i^{α_i − 1} / B(α), B(α) = Π Γ(α_i) / Γ(α₀), α₀ = Σ α_i.
Fields§
§alpha: Vec<f64>Implementations§
Source§impl Dirichlet
impl Dirichlet
pub fn new(alpha: Vec<f64>) -> Result<Self, ErrorsJSL>
Sourcepub fn logpdf(&self, x: &[f64]) -> Result<f64, ErrorsJSL>
pub fn logpdf(&self, x: &[f64]) -> Result<f64, ErrorsJSL>
The log density at a point of the simplex (components positive, summing to 1 within 10⁻¹⁰).
pub fn pdf(&self, x: &[f64]) -> Result<f64, ErrorsJSL>
pub fn mean(&self) -> Vec<f64>
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Dirichlet
impl RefUnwindSafe for Dirichlet
impl Send for Dirichlet
impl Sync for Dirichlet
impl Unpin for Dirichlet
impl UnsafeUnpin for Dirichlet
impl UnwindSafe for Dirichlet
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more