pub struct Gumbel<F>{ /* private fields */ }
Expand description
The Gumbel distribution Gumbel(μ, β)
.
The Gumbel distribution is a continuous probability distribution
with location parameter μ
(mu
) and scale parameter β
(beta
).
It is used to model the distribution of the maximum (or minimum)
of a number of samples of various distributions.
§Density function
f(x) = exp(-(z + exp(-z))) / β
, where z = (x - μ) / β
.
§Plot
The following plot illustrates the Gumbel distribution with various values of μ
and β
.
Note how the location parameter μ
shifts the distribution along the x-axis,
and the scale parameter β
changes the density around μ
.
Note also the asymptotic behavior of the distribution towards the right.
§Example
use rand::prelude::*;
use rand_distr::Gumbel;
let val: f64 = rand::rng().sample(Gumbel::new(0.0, 1.0).unwrap());
println!("{}", val);
Implementations§
Trait Implementations§
Source§impl<'de, F> Deserialize<'de> for Gumbel<F>
impl<'de, F> Deserialize<'de> for Gumbel<F>
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl<F> Distribution<F> for Gumbel<F>
impl<F> Distribution<F> for Gumbel<F>
impl<F> Copy for Gumbel<F>
impl<F> StructuralPartialEq for Gumbel<F>
Auto Trait Implementations§
impl<F> Freeze for Gumbel<F>where
F: Freeze,
impl<F> RefUnwindSafe for Gumbel<F>where
F: RefUnwindSafe,
impl<F> Send for Gumbel<F>where
F: Send,
impl<F> Sync for Gumbel<F>where
F: Sync,
impl<F> Unpin for Gumbel<F>where
F: Unpin,
impl<F> UnwindSafe for Gumbel<F>where
F: 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