Trait statrs::distribution::ContinuousCDF [−][src]
pub trait ContinuousCDF<K: Float, T: Float>: Min<K> + Max<K> { fn cdf(&self, x: K) -> T; fn inverse_cdf(&self, p: T) -> K { ... } }
Expand description
The ContinuousCDF
trait is used to specify an interface for univariate
distributions for which cdf float arguments are sensible.
Required methods
fn cdf(&self, x: K) -> T
[src]
Expand description
Returns the cumulative distribution function calculated
at x
for a given distribution. May panic depending
on the implementor.
Examples
use statrs::distribution::{ContinuousCDF, Uniform}; let n = Uniform::new(0.0, 1.0).unwrap(); assert_eq!(0.5, n.cdf(0.5));
Provided methods
fn inverse_cdf(&self, p: T) -> K
[src]
Expand description
Due to issues with rounding and floating-point accuracy the default
implementation may be ill-behaved.
Specialized inverse cdfs should be used whenever possible.
Performs a binary search on the domain of cdf
to obtain an approximation
of F^-1(p) := inf { x | F(x) >= p }
. Needless to say, performance may
may be lacking.
Implementors
impl ContinuousCDF<f64, f64> for Beta
[src]
impl ContinuousCDF<f64, f64> for Beta
[src]impl ContinuousCDF<f64, f64> for Cauchy
[src]
impl ContinuousCDF<f64, f64> for Cauchy
[src]impl ContinuousCDF<f64, f64> for Chi
[src]
impl ContinuousCDF<f64, f64> for Chi
[src]impl ContinuousCDF<f64, f64> for ChiSquared
[src]
impl ContinuousCDF<f64, f64> for ChiSquared
[src]impl ContinuousCDF<f64, f64> for Dirac
[src]
impl ContinuousCDF<f64, f64> for Dirac
[src]impl ContinuousCDF<f64, f64> for Erlang
[src]
impl ContinuousCDF<f64, f64> for Erlang
[src]impl ContinuousCDF<f64, f64> for Exp
[src]
impl ContinuousCDF<f64, f64> for Exp
[src]impl ContinuousCDF<f64, f64> for FisherSnedecor
[src]
impl ContinuousCDF<f64, f64> for FisherSnedecor
[src]fn cdf(&self, x: f64) -> f64
[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 ContinuousCDF<f64, f64> for Gamma
[src]
impl ContinuousCDF<f64, f64> for Gamma
[src]impl ContinuousCDF<f64, f64> for InverseGamma
[src]
impl ContinuousCDF<f64, f64> for InverseGamma
[src]impl ContinuousCDF<f64, f64> for Laplace
[src]
impl ContinuousCDF<f64, f64> for Laplace
[src]fn cdf(&self, x: f64) -> f64
[src]
fn cdf(&self, x: f64) -> f64
[src]Calculates the cumulative distribution function for the
laplace distribution at x
Formula
(1 / 2) * (1 + signum(x - μ)) - signum(x - μ) * exp(-|x - μ| / b)
where μ
is the location, b
is the scale
fn inverse_cdf(&self, p: f64) -> f64
[src]
fn inverse_cdf(&self, p: f64) -> f64
[src]Calculates the inverse cumulative distribution function for the
laplace distribution at p
Formula
if p <= 1/2
μ + b * ln(2p)
if p >= 1/2
μ - b * ln(2 - 2p)
where μ
is the location, b
is the scale
impl ContinuousCDF<f64, f64> for LogNormal
[src]
impl ContinuousCDF<f64, f64> for LogNormal
[src]impl ContinuousCDF<f64, f64> for Normal
[src]
impl ContinuousCDF<f64, f64> for Normal
[src]impl ContinuousCDF<f64, f64> for Pareto
[src]
impl ContinuousCDF<f64, f64> for Pareto
[src]impl ContinuousCDF<f64, f64> for StudentsT
[src]
impl ContinuousCDF<f64, f64> for StudentsT
[src]fn cdf(&self, x: f64) -> f64
[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
fn inverse_cdf(&self, x: f64) -> f64
[src]
fn inverse_cdf(&self, x: f64) -> f64
[src]Calculates the inverse cumulative distribution function for the
Student’s T-distribution at x
impl ContinuousCDF<f64, f64> for Triangular
[src]
impl ContinuousCDF<f64, f64> for Triangular
[src]impl ContinuousCDF<f64, f64> for Uniform
[src]
impl ContinuousCDF<f64, f64> for Uniform
[src]