Trait statrs::statistics::Skewness[][src]

pub trait Skewness<T> {
    fn skewness(&self) -> T;
}

The Skewness trait specifies an object that has a closed form solution for its skewness(s)

Required methods

fn skewness(&self) -> T[src]

Returns the skewness. May panic depending on the implementor.

Examples

use statrs::statistics::Skewness;
use statrs::distribution::Uniform;

let n = Uniform::new(0.0, 1.0).unwrap();
assert_eq!(0.0, n.skewness());
Loading content...

Implementors

impl Skewness<f64> for Bernoulli[src]

fn skewness(&self) -> f64[src]

Returns the skewness of the bernoulli distribution

Formula

q = (1 - p)
(1 - 2p) / sqrt(p * q)

impl Skewness<f64> for Beta[src]

fn skewness(&self) -> f64[src]

Returns the skewness of the Beta distribution

Formula

2(β - α) * sqrt(α + β + 1) / ((α + β + 2) * sqrt(αβ))

where α is shapeA and β is shapeB

impl Skewness<f64> for Binomial[src]

fn skewness(&self) -> f64[src]

Returns the skewness of the binomial distribution

Formula

(1 - 2p) / sqrt(n * p * (1 - p)))

impl Skewness<f64> for Chi[src]

fn skewness(&self) -> f64[src]

Returns the skewness of the chi distribution

Remarks

Returns NaN if freedom is INF

Formula

(μ / σ^3) * (1 - ^2)

where μ is the mean and σ the standard deviation of the distribution

impl Skewness<f64> for ChiSquared[src]

fn skewness(&self) -> f64[src]

Returns the skewness of the chi-squared distribution

Formula

sqrt(8 / k)

where k is the degrees of freedom

impl Skewness<f64> for DiscreteUniform[src]

fn skewness(&self) -> f64[src]

Returns the skewness of the discrete uniform distribution

Formula

0

impl Skewness<f64> for Erlang[src]

fn skewness(&self) -> f64[src]

Returns the skewness of the erlang distribution

Formula

2 / sqrt(k)

where k is the shape

impl Skewness<f64> for Exponential[src]

fn skewness(&self) -> f64[src]

Returns the skewness of the exponential distribution

Formula

2

impl Skewness<f64> for FisherSnedecor[src]

fn skewness(&self) -> f64[src]

Returns the skewness of the fisher-snedecor distribution

Panics

If freedom_2 <= 6.0

Remarks

Returns NaN if freedom_1 or freedom_2 is INF

Formula

((2d1 + d2 - 2) * sqrt(8 * (d2 - 4))) / ((d2 - 6) * sqrt(d1 * (d1 + d2
- 2)))

where d1 is the first degree of freedom and d2 is the second degree of freedom

impl Skewness<f64> for Gamma[src]

fn skewness(&self) -> f64[src]

Returns the skewness of the gamma distribution

Formula

2 / sqrt(α)

where α is the shape

impl Skewness<f64> for Geometric[src]

fn skewness(&self) -> f64[src]

Returns the skewness of the geometric distribution

Formula

(2 - p) / sqrt(1 - p)

impl Skewness<f64> for Hypergeometric[src]

fn skewness(&self) -> f64[src]

Returns the skewness of the hypergeometric distribution

Panics

If N <= 2

Formula

((N - 2K) * (N - 1)^(1 / 2) * (N - 2n)) / ([n * K * (N - K) * (N -
n)]^(1 / 2) * (N - 2))

where N is population, K is successes, and n is draws

impl Skewness<f64> for InverseGamma[src]

fn skewness(&self) -> f64[src]

Returns the skewness of the inverse gamma distribution

Panics

If shape <= 3

Formula

4 * sqrt(α - 2) / (α - 3)

where α is the shape

impl Skewness<f64> for LogNormal[src]

fn skewness(&self) -> f64[src]

Returns the skewness of the log-normal distribution

Formula

(e^(σ^2) + 2) * sqrt(e^(σ^2) - 1)

where μ is the location and σ is the scale

impl Skewness<f64> for Normal[src]

fn skewness(&self) -> f64[src]

Returns the skewness of the normal distribution

Formula

0

impl Skewness<f64> for Pareto[src]

fn skewness(&self) -> f64[src]

Returns the skewness of the Pareto distribution

Panics

If α <= 3.0

where α is the shape

Formula

    (2*(α + 1)/(α - 3))*sqrt((α - 2)/α)

where α is the shape

impl Skewness<f64> for Poisson[src]

fn skewness(&self) -> f64[src]

Returns the skewness of the poisson distribution

Formula

λ^(-1/2)

where λ is the rate

impl Skewness<f64> for StudentsT[src]

fn skewness(&self) -> f64[src]

Returns the skewness of the student’s t-distribution

Panics

If x <= 3.0

Formula

0

impl Skewness<f64> for Triangular[src]

fn skewness(&self) -> f64[src]

Returns the skewness of the triangular distribution

Formula

(sqrt(2) * (min + max - 2 * mode) * (2 * min - max - mode) * (min - 2 *
max + mode)) /
( 5 * (min^2 + max^2 + mode^2 - min * max - min * mode - max * mode)^(3
/ 2))

impl Skewness<f64> for Uniform[src]

fn skewness(&self) -> f64[src]

Returns the skewness for the continuous uniform distribution

Formula

0

impl Skewness<f64> for Weibull[src]

fn skewness(&self) -> f64[src]

Returns the skewness of the weibull distribution

Formula

(Γ(1 + 3 / k) * λ^3 - 3μσ^2 - μ^3) / σ^3

where k is the shape, λ is the scale, and Γ is the gamma function, μ is the mean of the distribution. and σ the standard deviation of the distribution

impl Skewness<Vec<f64, Global>> for Multinomial[src]

fn skewness(&self) -> Vec<f64>[src]

Returns the skewness of the multinomial distribution

Formula

(1 - 2 * p_i) / (n * p_i * (1 - p_i)) for i in 1...k

where n is the number of trials, p_i is the ith probability, and k is the total number of probabilities

Loading content...