rgsl/randist/
t_distribution.rs

1//
2// A rust binding for the GSL library by Guillaume Gomez (guillaume1.gomez@gmail.com)
3//
4
5/*!
6The t-distribution arises in statistics. If Y_1 has a normal distribution and Y_2 has a chi-squared distribution with \nu degrees of freedom then the ratio,
7
8X = { Y_1 \over \sqrt{Y_2 / \nu} }
9
10has a t-distribution t(x;\nu) with \nu degrees of freedom.
11!*/
12
13/// This function computes the probability density p(x) at x for a t-distribution with nu degrees of freedom, using the formula given above.
14#[doc(alias = "gsl_ran_tdist_pdf")]
15pub fn tdist_pdf(x: f64, nu: f64) -> f64 {
16    unsafe { sys::gsl_ran_tdist_pdf(x, nu) }
17}
18
19/// This function computes the cumulative distribution functions P(x), Q(x) and their inverses for the t-distribution with nu degrees of freedom.
20#[doc(alias = "gsl_cdf_tdist_P")]
21pub fn tdist_P(x: f64, nu: f64) -> f64 {
22    unsafe { sys::gsl_cdf_tdist_P(x, nu) }
23}
24
25/// This function computes the cumulative distribution functions P(x), Q(x) and their inverses for the t-distribution with nu degrees of freedom.
26#[doc(alias = "gsl_cdf_tdist_Q")]
27pub fn tdist_Q(x: f64, nu: f64) -> f64 {
28    unsafe { sys::gsl_cdf_tdist_Q(x, nu) }
29}
30
31/// This function computes the cumulative distribution functions P(x), Q(x) and their inverses for the t-distribution with nu degrees of freedom.
32#[doc(alias = "gsl_cdf_tdist_Pinv")]
33pub fn tdist_Pinv(P: f64, nu: f64) -> f64 {
34    unsafe { sys::gsl_cdf_tdist_Pinv(P, nu) }
35}
36
37/// This function computes the cumulative distribution functions P(x), Q(x) and their inverses for the t-distribution with nu degrees of freedom.
38#[doc(alias = "gsl_cdf_tdist_Qinv")]
39pub fn tdist_Qinv(Q: f64, nu: f64) -> f64 {
40    unsafe { sys::gsl_cdf_tdist_Qinv(Q, nu) }
41}