rgsl/randist/gamma.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 density p(x) at x for a gamma distribution with parameters a and b, using the formula given above.
6#[doc(alias = "gsl_ran_gamma_pdf")]
7pub fn gamma_pdf(x: f64, a: f64, b: f64) -> f64 {
8 unsafe { sys::gsl_ran_gamma_pdf(x, a, b) }
9}
10
11/// This function compute the cumulative distribution functions P(x), Q(x) and their inverses for
12/// the gamma distribution with parameters a and b.
13#[doc(alias = "gsl_cdf_gamma_P")]
14pub fn gamma_P(x: f64, a: f64, b: f64) -> f64 {
15 unsafe { sys::gsl_cdf_gamma_P(x, a, b) }
16}
17
18/// This function compute the cumulative distribution functions P(x), Q(x) and their inverses for
19/// the gamma distribution with parameters a and b.
20#[doc(alias = "gsl_cdf_gamma_Q")]
21pub fn gamma_Q(x: f64, a: f64, b: f64) -> f64 {
22 unsafe { sys::gsl_cdf_gamma_Q(x, a, b) }
23}
24
25/// This function compute the cumulative distribution functions P(x), Q(x) and their inverses for
26/// the gamma distribution with parameters a and b.
27#[doc(alias = "gsl_cdf_gamma_Pinv")]
28pub fn gamma_Pinv(P: f64, a: f64, b: f64) -> f64 {
29 unsafe { sys::gsl_cdf_gamma_Pinv(P, a, b) }
30}
31
32/// This function compute the cumulative distribution functions P(x), Q(x) and their inverses for
33/// the gamma distribution with parameters a and b.
34#[doc(alias = "gsl_cdf_gamma_Qinv")]
35pub fn gamma_Qinv(Q: f64, a: f64, b: f64) -> f64 {
36 unsafe { sys::gsl_cdf_gamma_Qinv(Q, a, b) }
37}