pub trait Statistic<T>where
T: Float,{
Show 21 methods
// Required methods
fn mean(&self) -> T;
fn arithmetic_mean(&self) -> T;
fn geometric_mean(&self) -> T;
fn harmonic_mean(&self) -> T;
fn variance(&self) -> T;
fn sample_variance(&self) -> f64;
fn population_variance(&self) -> f64;
fn standard_deviation(&self) -> T;
fn sample_standard_deviation(&self) -> f64;
fn population_standard_deviation(&self) -> f64;
fn covariance(&self, other: &Self) -> T;
fn correlation(&self, other: &Self) -> T;
fn skewness(&self) -> T;
fn kurtosis(&self) -> T;
fn min(&self) -> T;
fn max(&self) -> T;
fn median(&self) -> T;
fn percentile(&self, percentile: f64) -> T;
fn quantile(&self, quantile: f64) -> T;
fn interquartile_range(&self) -> T;
fn range(&self) -> T;
}
Expand description
Statistics trait for vectors of floating point numbers.
Required Methods§
Sourcefn arithmetic_mean(&self) -> T
fn arithmetic_mean(&self) -> T
Calculate the arithmetic mean of a vector.
Sourcefn geometric_mean(&self) -> T
fn geometric_mean(&self) -> T
Calculate the geometric mean of a vector.
Sourcefn harmonic_mean(&self) -> T
fn harmonic_mean(&self) -> T
Calculate the harmonic mean of a vector.
Sourcefn variance(&self) -> T
fn variance(&self) -> T
Calculate the variance of a vector.
Simply a wrapper for sample_variance
.
Sourcefn sample_variance(&self) -> f64
fn sample_variance(&self) -> f64
Calculate the sample variance of a vector.
Sourcefn population_variance(&self) -> f64
fn population_variance(&self) -> f64
Calculate the population variance of a vector.
Sourcefn standard_deviation(&self) -> T
fn standard_deviation(&self) -> T
Calculate the standard deviation of a vector.
Simply a wrapper for sample_standard_deviation
.
Sourcefn sample_standard_deviation(&self) -> f64
fn sample_standard_deviation(&self) -> f64
Calculate the sample standard deviation of a vector.
Sourcefn population_standard_deviation(&self) -> f64
fn population_standard_deviation(&self) -> f64
Calculate the population standard deviation of a vector.
Sourcefn covariance(&self, other: &Self) -> T
fn covariance(&self, other: &Self) -> T
Calculate the covariance of two vectors.
Sourcefn correlation(&self, other: &Self) -> T
fn correlation(&self, other: &Self) -> T
Calculate the correlation of two vectors.
Sourcefn percentile(&self, percentile: f64) -> T
fn percentile(&self, percentile: f64) -> T
Calculate the percentile of a vector.
Sourcefn interquartile_range(&self) -> T
fn interquartile_range(&self) -> T
Calculate the interquartile range of a vector.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.