pub struct Exp { /* fields omitted */ }
The exponential distribution Exp(lambda)
.
This distribution has density function: f(x) = lambda * exp(-lambda * x)
for x > 0
.
use rand::distributions::{Exp, IndependentSample};
let exp = Exp::new(2.0);
let v = exp.ind_sample(&mut rand::thread_rng());
println!("{} is from a Exp(2) distribution", v);
Construct a new Exp
with the given shape parameter
lambda
. Panics if lambda <= 0
.
Performs copy-assignment from source
. Read more
Generate a random value of Support
, using rng
as the source of randomness. Read more
Formats the value using the given formatter. Read more