Struct rand::distributions::Poisson[][src]

pub struct Poisson { /* fields omitted */ }

The Poisson distribution Poisson(lambda).

This distribution has a density function: f(k) = lambda^k * exp(-lambda) / k! for k >= 0.

Example

use rand::distributions::{Poisson, Distribution};

let poi = Poisson::new(2.0);
let v = poi.sample(&mut rand::thread_rng());
println!("{} is from a Poisson(2) distribution", v);

Methods

impl Poisson
[src]

Construct a new Poisson with the given shape parameter lambda. Panics if lambda <= 0.

Trait Implementations

impl Clone for Poisson
[src]

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

impl Copy for Poisson
[src]

impl Debug for Poisson
[src]

Formats the value using the given formatter. Read more

impl Distribution<u64> for Poisson
[src]

Generate a random value of T, using rng as the source of randomness.

Important traits for DistIter<'a, D, R, T>

Create an iterator that generates random values of T, using rng as the source of randomness. Read more

Auto Trait Implementations

impl Send for Poisson

impl Sync for Poisson