pub trait StatsExt {
// Required methods
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;
}
Expand description
Trait that provides simple descriptive statistics on a univariate set of numeric samples.
Required Methods§
sourcefn sum(&self) -> f64
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”
sourcefn var(&self) -> f64
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
.