rgsl/randist/poisson.rs
1//
2// A rust binding for the GSL library by Guillaume Gomez (guillaume1.gomez@gmail.com)
3//
4
5/// This function computes the probability p(k) of obtaining k from a Poisson distribution with mean mu, using the formula given above.
6#[doc(alias = "gsl_ran_poisson_pdf")]
7pub fn poisson_pdf(k: u32, mu: f64) -> f64 {
8 unsafe { sys::gsl_ran_poisson_pdf(k, mu) }
9}
10
11/// This function computes the cumulative distribution functions P(k), Q(k) for the Poisson distribution with parameter mu.
12#[doc(alias = "gsl_cdf_poisson_P")]
13pub fn poisson_P(k: u32, mu: f64) -> f64 {
14 unsafe { sys::gsl_cdf_poisson_P(k, mu) }
15}
16
17/// This function computes the cumulative distribution functions P(k), Q(k) for the Poisson distribution with parameter mu.
18#[doc(alias = "gsl_cdf_poisson_Q")]
19pub fn poisson_Q(k: u32, mu: f64) -> f64 {
20 unsafe { sys::gsl_cdf_poisson_Q(k, mu) }
21}