Struct rand_distr::Frechet
source · pub struct Frechet<F>where
F: Float,
OpenClosed01: Distribution<F>,{ /* private fields */ }
Expand description
Samples floating-point numbers according to the Fréchet distribution
This distribution has density function:
f(x) = [(x - μ) / σ]^(-1 - α) exp[-(x - μ) / σ]^(-α) α / σ
,
where μ
is the location parameter, σ
the scale parameter, and α
the shape parameter.
Example
use rand::prelude::*;
use rand_distr::Frechet;
let val: f64 = thread_rng().sample(Frechet::new(0.0, 1.0, 1.0).unwrap());
println!("{}", val);
Implementations§
Trait Implementations§
source§impl<F> Clone for Frechet<F>where
F: Float + Clone,
OpenClosed01: Distribution<F>,
impl<F> Clone for Frechet<F>where
F: Float + Clone,
OpenClosed01: Distribution<F>,
source§impl<F> Debug for Frechet<F>where
F: Float + Debug,
OpenClosed01: Distribution<F>,
impl<F> Debug for Frechet<F>where
F: Float + Debug,
OpenClosed01: Distribution<F>,
source§impl<F> Distribution<F> for Frechet<F>where
F: Float,
OpenClosed01: Distribution<F>,
impl<F> Distribution<F> for Frechet<F>where
F: Float,
OpenClosed01: Distribution<F>,
source§fn sample<R: Rng + ?Sized>(&self, rng: &mut R) -> F
fn sample<R: Rng + ?Sized>(&self, rng: &mut R) -> F
Generate a random value of
T
, using rng
as the source of randomness.