pub struct LogNormal { /* fields omitted */ }
The log-normal distribution ln N(mean, std_dev**2)
.
If X
is log-normal distributed, then ln(X)
is N(mean, std_dev**2)
distributed.
use rand::distributions::{LogNormal, Distribution};
let log_normal = LogNormal::new(2.0, 3.0);
let v = log_normal.sample(&mut rand::thread_rng());
println!("{} is from an ln N(2, 9) distribution", v)
Construct a new LogNormal
distribution with the given mean
and standard deviation.
Panics if std_dev < 0
.
Formats the value using the given formatter. Read more
Generate a random value of T
, using rng
as the source of randomness.
pub fn sample_iter<R>(&'a self, rng: &'a mut R) -> DistIter<'a, Self, R, T>ⓘNotable traits for DistIter<'a, D, R, T>
impl<'a, D, R, T> Iterator for DistIter<'a, D, R, T> where
R: Rng + 'a,
D: Distribution<T>, type Item = T;
where
R: Rng,
[src]
Create an iterator that generates random values of T
, using rng
as
the source of randomness. Read more
impl<T> Any for T where
T: 'static + ?Sized,
[src]
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more
impl<T, U> Into<U> for T where
U: From<T>,
[src]
The resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning. Read more
🔬 This is a nightly-only experimental API. (toowned_clone_into
)
recently added
Uses borrowed data to replace owned data, usually by cloning. Read more
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
The type returned in the event of a conversion error.
The type returned in the event of a conversion error.