Struct mathru::stats::distrib::Poisson

source ·
pub struct Poisson { /* private fields */ }
Expand description

Poisson distribution

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

Implementations

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

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);

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);

Expected value

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

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

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

Blanket Implementations

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.