[][src]Struct mathru::stats::distrib::Poisson

pub struct Poisson { /* fields omitted */ }

Poisson distribution

Fore more information: https://en.wikipedia.org/wiki/Poisson_distribution

Methods

impl Poisson[src]

pub fn new(gamma: &f64) -> Poisson[src]

Creates a probability distribution

Arguments

  • gamma gamma > 0.0

Panics

if gamma <= 0.0

Example

extern crate mathru;
use mathru::stats::distrib::Poisson;

let distrib: Poisson = Poisson::new(&0.2);

Trait Implementations

impl Discrete<u32, u32> for Poisson[src]

fn pmf<'a>(&'a self, x: u32) -> f64[src]

Probability mass function

Arguments

  • x Random variable x ∈ ℕ

Example

extern crate mathru;
use mathru::stats::distrib::{Discrete, Poisson};

let distrib: Poisson = Poisson::new(&0.2);
let x: u32 = 5;
let p: f64 = distrib.pmf(x);

fn cdf<'a>(&'a self, x: u32) -> f64[src]

Cumulative distribution function of the Bernoulli distribution

Arguments

  • x Random variable x ∈ ℕ

Example

extern crate mathru;
use mathru::stats::distrib::{Discrete, Poisson};

let distrib: Poisson = Poisson::new(&0.2);
let x: u32 = 4;
let p: f64 = distrib.cdf(x);

fn mean<'a>(&'a self) -> f64[src]

Expected value

Example

extern crate mathru;
use mathru::stats::distrib::{Discrete, Poisson};

let distrib: Poisson = Poisson::new(&0.2);
let mean: f64 = distrib.mean();

fn variance<'a>(&'a self) -> f64[src]

Variance

Example

extern crate mathru;
use mathru::stats::distrib::{Discrete, Poisson};

let distrib: Poisson = Poisson::new(&0.2);
let var: f64 = distrib.variance();

Auto Trait Implementations

impl Send for Poisson

impl Sync for Poisson

Blanket Implementations

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

impl<T> From<T> for 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]