Trait statrs::statistics::CheckedMean[][src]

pub trait CheckedMean<T> {
    fn checked_mean(&self) -> Result<T>;
}

The CheckedMean trait specifies that an object has a closed form solution for its mean(s) with possible failure modes

Required methods

fn checked_mean(&self) -> Result<T>[src]

Returns the mean.

Examples

use statrs::statistics::CheckedMean;
use statrs::distribution::FisherSnedecor;

let n = FisherSnedecor::new(1.0, 1.0).unwrap();
assert!(n.checked_mean().is_err());
Loading content...

Implementors

impl CheckedMean<f64> for FisherSnedecor[src]

fn checked_mean(&self) -> Result<f64>[src]

Returns the mean of the fisher-snedecor distribution

Errors

If freedom_2 <= 2.0

Remarks

Returns NaN if freedom_2 is INF

Formula

d2 / (d2 - 2)

where d2 is the second degree of freedom

impl CheckedMean<f64> for Hypergeometric[src]

fn checked_mean(&self) -> Result<f64>[src]

Returns the mean of the hypergeometric distribution

Errors

If N is 0

Formula

K * n / N

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

impl CheckedMean<f64> for InverseGamma[src]

fn checked_mean(&self) -> Result<f64>[src]

Returns the mean of the inverse distribution

Errors

If shape <= 1.0

Formula

β / (α - 1)

where α is the shape and β is the rate

impl CheckedMean<f64> for StudentsT[src]

fn checked_mean(&self) -> Result<f64>[src]

Returns the mean of the student’s t-distribution

Errors

If freedom <= 1.0

Formula

μ

where μ is the location

Loading content...