pub struct Poisson<N> { /* private fields */ }
Expand description
The Poisson distribution Poisson(lambda)
.
This distribution has a density function:
f(k) = lambda^k * exp(-lambda) / k!
for k >= 0
.
§Example
use rand_distr::{Poisson, Distribution};
let poi = Poisson::new(2.0).unwrap();
let v: u64 = poi.sample(&mut rand::thread_rng());
println!("{} is from a Poisson(2) distribution", v);
Implementations§
Trait Implementations§
Source§impl<N: Float> Distribution<N> for Poisson<N>where
Standard: Distribution<N>,
impl<N: Float> Distribution<N> for Poisson<N>where
Standard: Distribution<N>,
Source§impl<N: Float> Distribution<u64> for Poisson<N>where
Standard: Distribution<N>,
impl<N: Float> Distribution<u64> for Poisson<N>where
Standard: Distribution<N>,
impl<N: Copy> Copy for Poisson<N>
Auto Trait Implementations§
impl<N> Freeze for Poisson<N>where
N: Freeze,
impl<N> RefUnwindSafe for Poisson<N>where
N: RefUnwindSafe,
impl<N> Send for Poisson<N>where
N: Send,
impl<N> Sync for Poisson<N>where
N: Sync,
impl<N> Unpin for Poisson<N>where
N: Unpin,
impl<N> UnwindSafe for Poisson<N>where
N: 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