Trait statrs::distribution::Univariate [−][src]
The Univariate
trait is used to specify an interface for univariate
distributions e.g. distributions that have a closed form cumulative
distribution
function
Required methods
fn cdf(&self, x: K) -> K
[src]
Returns the cumulative distribution function calculated
at x
for a given distribution. May panic depending
on the implementor.
Examples
use statrs::distribution::{Univariate, Uniform}; let n = Uniform::new(0.0, 1.0).unwrap(); assert_eq!(0.5, n.cdf(0.5));
Implementors
impl Univariate<f64, f64> for Beta
[src]
impl Univariate<f64, f64> for Beta
[src]impl Univariate<f64, f64> for Cauchy
[src]
impl Univariate<f64, f64> for Cauchy
[src]impl Univariate<f64, f64> for Chi
[src]
impl Univariate<f64, f64> for Chi
[src]impl Univariate<f64, f64> for ChiSquared
[src]
impl Univariate<f64, f64> for ChiSquared
[src]impl Univariate<f64, f64> for Erlang
[src]
impl Univariate<f64, f64> for Erlang
[src]impl Univariate<f64, f64> for Exponential
[src]
impl Univariate<f64, f64> for Exponential
[src]impl Univariate<f64, f64> for FisherSnedecor
[src]
impl Univariate<f64, f64> for FisherSnedecor
[src]fn cdf(&self, x: f64) -> f64
[src]
Calculates the cumulative distribution function for the fisher-snedecor
distribution
at x
Formula
I_((d1 * x) / (d1 * x + d2))(d1 / 2, d2 / 2)
where d1
is the first degree of freedom, d2
is
the second degree of freedom, and I
is the regularized incomplete
beta function
impl Univariate<f64, f64> for Gamma
[src]
impl Univariate<f64, f64> for Gamma
[src]impl Univariate<f64, f64> for InverseGamma
[src]
impl Univariate<f64, f64> for InverseGamma
[src]impl Univariate<f64, f64> for LogNormal
[src]
impl Univariate<f64, f64> for LogNormal
[src]impl Univariate<f64, f64> for Normal
[src]
impl Univariate<f64, f64> for Normal
[src]impl Univariate<f64, f64> for Pareto
[src]
impl Univariate<f64, f64> for Pareto
[src]impl Univariate<f64, f64> for StudentsT
[src]
impl Univariate<f64, f64> for StudentsT
[src]fn cdf(&self, x: f64) -> f64
[src]
Calculates the cumulative distribution function for the student’s
t-distribution
at x
Formula
if x < μ { (1 / 2) * I(t, v / 2, 1 / 2) } else { 1 - (1 / 2) * I(t, v / 2, 1 / 2) }
where t = v / (v + k^2)
, k = (x - μ) / σ
, μ
is the location,
σ
is the scale, v
is the freedom, and I
is the regularized
incomplete
beta function
impl Univariate<f64, f64> for Triangular
[src]
impl Univariate<f64, f64> for Triangular
[src]impl Univariate<f64, f64> for Uniform
[src]
impl Univariate<f64, f64> for Uniform
[src]impl Univariate<f64, f64> for Weibull
[src]
impl Univariate<f64, f64> for Weibull
[src]impl Univariate<i64, f64> for DiscreteUniform
[src]
impl Univariate<i64, f64> for DiscreteUniform
[src]impl Univariate<u64, f64> for Bernoulli
[src]
impl Univariate<u64, f64> for Bernoulli
[src]impl Univariate<u64, f64> for Binomial
[src]
impl Univariate<u64, f64> for Binomial
[src]impl Univariate<u64, f64> for Categorical
[src]
impl Univariate<u64, f64> for Categorical
[src]impl Univariate<u64, f64> for Geometric
[src]
impl Univariate<u64, f64> for Geometric
[src]impl Univariate<u64, f64> for Hypergeometric
[src]
impl Univariate<u64, f64> for Hypergeometric
[src]fn cdf(&self, x: f64) -> f64
[src]
Calculates the cumulative distribution function for the hypergeometric
distribution at x
Formula
1 - ((n choose k+1) * (N-n choose K-k-1)) / (N choose K) * 3_F_2(1, k+1-K, k+1-n; k+2, N+k+2-K-n; 1)
and p_F_q
is the [generalized hypergeometric
function](https://en.wikipedia.
org/wiki/Generalized_hypergeometric_function)