Struct rand_distr::Beta
source · [−]pub struct Beta<F> where
F: Float,
Open01: Distribution<F>, { /* private fields */ }
Expand description
The Beta distribution with shape parameters alpha
and beta
.
Example
use rand_distr::{Distribution, Beta};
let beta = Beta::new(2.0, 5.0).unwrap();
let v = beta.sample(&mut rand::thread_rng());
println!("{} is from a Beta(2, 5) distribution", v);
Implementations
Trait Implementations
Generate a random value of T
, using rng
as the source of randomness.
fn sample_iter<R>(self, rng: R) -> DistIter<Self, R, T>ⓘ where
R: Rng,
fn sample_iter<R>(self, rng: R) -> DistIter<Self, R, T>ⓘ where
R: Rng,
Create an iterator that generates random values of T
, using rng
as
the source of randomness. Read more
Auto Trait Implementations
impl<F> RefUnwindSafe for Beta<F> where
F: RefUnwindSafe,
impl<F> UnwindSafe for Beta<F> where
F: UnwindSafe,
Blanket Implementations
Mutably borrows from an owned value. Read more