pub struct Dirichlet<N> { /* private fields */ }
Expand description
The dirichelet distribution Dirichlet(alpha)
.
The Dirichlet distribution is a family of continuous multivariate probability distributions parameterized by a vector alpha of positive reals. It is a multivariate generalization of the beta distribution.
§Example
use rand::prelude::*;
use rand_distr::Dirichlet;
let dirichlet = Dirichlet::new(vec![1.0, 2.0, 3.0]).unwrap();
let samples = dirichlet.sample(&mut rand::thread_rng());
println!("{:?} is from a Dirichlet([1.0, 2.0, 3.0]) distribution", samples);
Implementations§
Trait Implementations§
Auto Trait Implementations§
impl<N> Freeze for Dirichlet<N>
impl<N> RefUnwindSafe for Dirichlet<N>where
N: RefUnwindSafe,
impl<N> Send for Dirichlet<N>where
N: Send,
impl<N> Sync for Dirichlet<N>where
N: Sync,
impl<N> Unpin for Dirichlet<N>where
N: Unpin,
impl<N> UnwindSafe for Dirichlet<N>where
N: UnwindSafe,
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