[][src]Trait vecfx::StatsExt

pub trait StatsExt {
    fn sum(&self) -> f64;
fn min(&self) -> f64;
fn max(&self) -> f64;
fn mean(&self) -> f64;
fn var(&self) -> f64;
fn std_dev(&self) -> f64;
fn imin(&self) -> usize;
fn imax(&self) -> usize; }

Trait that provides simple descriptive statistics on a univariate set of numeric samples.

Required methods

fn sum(&self) -> f64

Sum of the samples.

Note: this method sacrifices performance at the altar of accuracy Depends on IEEE-754 arithmetic guarantees. See proof of correctness at: "Adaptive Precision Floating-Point Arithmetic and Fast Robust Geometric Predicates"

fn min(&self) -> f64

Minimum value of the samples.

fn max(&self) -> f64

Maximum value of the samples.

fn mean(&self) -> f64

Arithmetic mean (average) of the samples: sum divided by sample-count.

See: https://en.wikipedia.org/wiki/Arithmetic_mean

fn var(&self) -> f64

Variance of the samples: bias-corrected mean of the squares of the differences of each sample from the sample mean. Note that this calculates the sample variance rather than the population variance, which is assumed to be unknown. It therefore corrects the (n-1)/n bias that would appear if we calculated a population variance, by dividing by (n-1) rather than n.

See: https://en.wikipedia.org/wiki/Variance

fn std_dev(&self) -> f64

Standard deviation: the square root of the sample variance.

Note: this is not a robust statistic for non-normal distributions. Prefer the median_abs_dev for unknown distributions.

See: https://en.wikipedia.org/wiki/Standard_deviation

fn imin(&self) -> usize

Index to the minimum value of the samples.

fn imax(&self) -> usize

Index to the maximum value of the samples.

Loading content...

Implementations on Foreign Types

impl StatsExt for [f64][src]

Loading content...

Implementors

Loading content...