[][src]Struct rv::dist::Poisson

pub struct Poisson {
    pub rate: f64,
}

Possion distribution over x in {0, 1, ... }.

Example

extern crate rv;
extern crate rand;

use rv::prelude::*;

// Create Possion(λ=5.3)
let pois = Poisson::new(5.3).unwrap();

// CDF at 5
assert!((pois.cdf(&5_u16) - 0.56347339228807169).abs() < 1E-12);

// Draw 100 samples
let mut rng = rand::thread_rng();
let xs: Vec<u32> = pois.sample(100, &mut rng);
assert_eq!(xs.len(), 100)

Fields

rate: f64

Methods

impl Poisson[src]

pub fn new(rate: f64) -> Result<Self>[src]

Trait Implementations

impl Rv<u8> for Poisson[src]

fn f(&self, x: &X) -> f64[src]

Probability function Read more

impl Rv<u16> for Poisson[src]

fn f(&self, x: &X) -> f64[src]

Probability function Read more

impl Rv<u32> for Poisson[src]

fn f(&self, x: &X) -> f64[src]

Probability function Read more

impl Support<u8> for Poisson[src]

impl Support<u16> for Poisson[src]

impl Support<u32> for Poisson[src]

impl Cdf<u8> for Poisson[src]

fn sf(&self, x: &X) -> f64[src]

Survival function, 1 - CDF(x)

impl Cdf<u16> for Poisson[src]

fn sf(&self, x: &X) -> f64[src]

Survival function, 1 - CDF(x)

impl Cdf<u32> for Poisson[src]

fn sf(&self, x: &X) -> f64[src]

Survival function, 1 - CDF(x)

impl DiscreteDistr<u8> for Poisson[src]

fn pmf(&self, x: &X) -> f64[src]

Probability mass function (PMF) at x Read more

fn ln_pmf(&self, x: &X) -> f64[src]

Natural logarithm of the probability mass function (PMF) Read more

impl DiscreteDistr<u16> for Poisson[src]

fn pmf(&self, x: &X) -> f64[src]

Probability mass function (PMF) at x Read more

fn ln_pmf(&self, x: &X) -> f64[src]

Natural logarithm of the probability mass function (PMF) Read more

impl DiscreteDistr<u32> for Poisson[src]

fn pmf(&self, x: &X) -> f64[src]

Probability mass function (PMF) at x Read more

fn ln_pmf(&self, x: &X) -> f64[src]

Natural logarithm of the probability mass function (PMF) Read more

impl Mean<f64> for Poisson[src]

impl Variance<f64> for Poisson[src]

impl Skewness for Poisson[src]

impl Kurtosis for Poisson[src]

impl PartialOrd<Poisson> for Poisson[src]

impl<'_> From<&'_ Poisson> for String[src]

impl PartialEq<Poisson> for Poisson[src]

impl Clone for Poisson[src]

fn clone_from(&mut self, source: &Self)1.0.0[src]

Performs copy-assignment from source. Read more

impl Display for Poisson[src]

impl Debug for Poisson[src]

Auto Trait Implementations

impl Send for Poisson

impl Sync for Poisson

Blanket Implementations

impl<T> ApiReady for T where
    T: Clone + Debug + PartialOrd<T> + PartialEq<T>, 
[src]

impl<T> From<T> for T[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T> ToString for T where
    T: Display + ?Sized
[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<SS, SP> SupersetOf<SS> for SP where
    SS: SubsetOf<SP>,