use rand::SeedableRng;
use rand::distr::Distribution;
use statrs::distribution::Gumbel;
fn main() {
let mut rng = rand::rngs::StdRng::seed_from_u64(42);
let g = Gumbel::new(0.0, 1.0).unwrap();
let samples: Vec<f64> = (0..5).map(|_| g.sample(&mut rng)).collect();
println!("{samples:?}");
}
Output:
[NaN, NaN, NaN, NaN, NaN]
Every draw is NaN, for any location and scale and any RNG. Gumbel::new(0.0, 1.0) returns Ok, and the distribution's cdf, inverse_cdf and moments are all finite, so only sampling is affected.
Tested on statrs 0.19.1 and current main (rand feature).
Output:
Every draw is NaN, for any location and scale and any RNG.
Gumbel::new(0.0, 1.0)returnsOk, and the distribution'scdf,inverse_cdfand moments are all finite, so only sampling is affected.Tested on statrs 0.19.1 and current main (
randfeature).