Struct rv::dist::Poisson [−][src]
pub struct Poisson { pub rate: f64, }
Possion distribution on unisgned integers
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]
impl Poisson
Trait Implementations
impl Clone for Poisson
[src]
impl Clone for Poisson
fn clone(&self) -> Poisson
[src]
fn clone(&self) -> Poisson
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
impl Debug for Poisson
[src]
impl Debug for Poisson
fn fmt(&self, f: &mut Formatter) -> Result
[src]
fn fmt(&self, f: &mut Formatter) -> Result
Formats the value using the given formatter. Read more
impl Mean<f64> for Poisson
[src]
impl Mean<f64> for Poisson
impl Variance<f64> for Poisson
[src]
impl Variance<f64> for Poisson
impl Skewness for Poisson
[src]
impl Skewness for Poisson
impl Kurtosis for Poisson
[src]
impl Kurtosis for Poisson
impl Rv<u16> for Poisson
[src]
impl Rv<u16> for Poisson
fn ln_f(&self, x: &u16) -> f64
[src]
fn ln_f(&self, x: &u16) -> f64
Un-normalized probability function Read more
fn ln_normalizer(&self) -> f64
[src]
fn ln_normalizer(&self) -> f64
The log of the constant term in the PDF/PMF. Should not be a function of any of the parameters. Read more
fn draw<R: Rng>(&self, rng: &mut R) -> u16
[src]
fn draw<R: Rng>(&self, rng: &mut R) -> u16
Single draw from the Rv
Read more
fn sample<R: Rng>(&self, n: usize, rng: &mut R) -> Vec<u16>
[src]
fn sample<R: Rng>(&self, n: usize, rng: &mut R) -> Vec<u16>
Multiple draws of the Rv
Read more
fn f(&self, x: &X) -> f64
[src]
fn f(&self, x: &X) -> f64
Un-normalized probability function Read more
fn normalizer(&self) -> f64
[src]
fn normalizer(&self) -> f64
The constant term in the PDF/PMF. Should not be a function of any of the parameters. Read more
impl Support<u16> for Poisson
[src]
impl Support<u16> for Poisson
impl DiscreteDistr<u16> for Poisson
[src]
impl DiscreteDistr<u16> for Poisson
fn pmf(&self, x: &X) -> f64
[src]
fn pmf(&self, x: &X) -> f64
Probability mass function (PMF) at x
Read more
fn ln_pmf(&self, x: &X) -> f64
[src]
fn ln_pmf(&self, x: &X) -> f64
Natural logarithm of the probability mass function (PMF) Read more
impl Cdf<u16> for Poisson
[src]
impl Cdf<u16> for Poisson
fn cdf(&self, x: &u16) -> f64
[src]
fn cdf(&self, x: &u16) -> f64
The value of the Cumulative Density Function at x
Read more
fn sf(&self, x: &X) -> f64
[src]
fn sf(&self, x: &X) -> f64
Survival function, 1 - CDF(x)
impl Rv<u32> for Poisson
[src]
impl Rv<u32> for Poisson
fn ln_f(&self, x: &u32) -> f64
[src]
fn ln_f(&self, x: &u32) -> f64
Un-normalized probability function Read more
fn ln_normalizer(&self) -> f64
[src]
fn ln_normalizer(&self) -> f64
The log of the constant term in the PDF/PMF. Should not be a function of any of the parameters. Read more
fn draw<R: Rng>(&self, rng: &mut R) -> u32
[src]
fn draw<R: Rng>(&self, rng: &mut R) -> u32
Single draw from the Rv
Read more
fn sample<R: Rng>(&self, n: usize, rng: &mut R) -> Vec<u32>
[src]
fn sample<R: Rng>(&self, n: usize, rng: &mut R) -> Vec<u32>
Multiple draws of the Rv
Read more
fn f(&self, x: &X) -> f64
[src]
fn f(&self, x: &X) -> f64
Un-normalized probability function Read more
fn normalizer(&self) -> f64
[src]
fn normalizer(&self) -> f64
The constant term in the PDF/PMF. Should not be a function of any of the parameters. Read more
impl Support<u32> for Poisson
[src]
impl Support<u32> for Poisson
impl DiscreteDistr<u32> for Poisson
[src]
impl DiscreteDistr<u32> for Poisson
fn pmf(&self, x: &X) -> f64
[src]
fn pmf(&self, x: &X) -> f64
Probability mass function (PMF) at x
Read more
fn ln_pmf(&self, x: &X) -> f64
[src]
fn ln_pmf(&self, x: &X) -> f64
Natural logarithm of the probability mass function (PMF) Read more
impl Cdf<u32> for Poisson
[src]
impl Cdf<u32> for Poisson