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

pub struct Poisson<T> { /* fields omitted */ }

Poisson distribution

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

Implementations

impl<T> Poisson<T> where
    T: Real
[src]

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

Creates a probability distribution

Arguments

  • gamma gamma > 0.0

Panics

if gamma <= 0.0

Example

use mathru::statistics::distrib::Poisson;

let distrib: Poisson<f64> = Poisson::new(&0.2);

Trait Implementations

impl<T: Clone> Clone for Poisson<T>[src]

impl<T: Copy> Copy for Poisson<T>[src]

impl<T: Debug> Debug for Poisson<T>[src]

impl<'de, T> Deserialize<'de> for Poisson<T> where
    T: Deserialize<'de>, 
[src]

impl<T> Discrete<T, u32, u32> for Poisson<T> where
    T: Real + Gamma
[src]

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

Probability mass function

Arguments

  • x Random variable x ∈ ℕ

Example

use mathru::statistics::distrib::{Discrete, Poisson};

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

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

Cumulative distribution function of the Bernoulli distribution

Arguments

  • x Random variable x ∈ ℕ

Example

use mathru::statistics::distrib::{Discrete, Poisson};

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

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

Expected value

Example

use mathru::statistics::distrib::{Discrete, Poisson};

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

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

Variance

Example

use mathru::statistics::distrib::{Discrete, Poisson};

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

impl<T> Serialize for Poisson<T> where
    T: Serialize
[src]

Auto Trait Implementations

impl<T> RefUnwindSafe for Poisson<T> where
    T: RefUnwindSafe

impl<T> Send for Poisson<T> where
    T: Send

impl<T> Sync for Poisson<T> where
    T: Sync

impl<T> Unpin for Poisson<T> where
    T: Unpin

impl<T> UnwindSafe for Poisson<T> where
    T: UnwindSafe

Blanket Implementations

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

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

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

impl<T> DeserializeOwned for T where
    T: for<'de> Deserialize<'de>, 
[src]

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

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

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

type Owned = T

The resulting type after obtaining ownership.

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<V, T> VZip<V> for T where
    V: MultiLane<T>,