Trait Statistic

Source
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§

Source

fn mean(&self) -> T

Calculate the mean of a vector. Simply a wrapper for arithmetic_mean.

Source

fn arithmetic_mean(&self) -> T

Calculate the arithmetic mean of a vector.

Source

fn geometric_mean(&self) -> T

Calculate the geometric mean of a vector.

Source

fn harmonic_mean(&self) -> T

Calculate the harmonic mean of a vector.

Source

fn variance(&self) -> T

Calculate the variance of a vector. Simply a wrapper for sample_variance.

Source

fn sample_variance(&self) -> f64

Calculate the sample variance of a vector.

Source

fn population_variance(&self) -> f64

Calculate the population variance of a vector.

Source

fn standard_deviation(&self) -> T

Calculate the standard deviation of a vector. Simply a wrapper for sample_standard_deviation.

Source

fn sample_standard_deviation(&self) -> f64

Calculate the sample standard deviation of a vector.

Source

fn population_standard_deviation(&self) -> f64

Calculate the population standard deviation of a vector.

Source

fn covariance(&self, other: &Self) -> T

Calculate the covariance of two vectors.

Source

fn correlation(&self, other: &Self) -> T

Calculate the correlation of two vectors.

Source

fn skewness(&self) -> T

Calculate the skewness of a vector.

Source

fn kurtosis(&self) -> T

Calculate the kurtosis of a vector.

Source

fn min(&self) -> T

Calculate the minimum value of a vector.

Source

fn max(&self) -> T

Calculate the maximum value of a vector.

Source

fn median(&self) -> T

Calculate the median of a vector.

Source

fn percentile(&self, percentile: f64) -> T

Calculate the percentile of a vector.

Source

fn quantile(&self, quantile: f64) -> T

Calculate the quantile of a vector.

Source

fn interquartile_range(&self) -> T

Calculate the interquartile range of a vector.

Source

fn range(&self) -> T

Calculate the 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.

Implementations on Foreign Types§

Source§

impl Statistic<f64> for Vec<f64>

Source§

fn mean(&self) -> f64

Source§

fn arithmetic_mean(&self) -> f64

Source§

fn geometric_mean(&self) -> f64

Source§

fn harmonic_mean(&self) -> f64

Source§

fn variance(&self) -> f64

Source§

fn sample_variance(&self) -> f64

Source§

fn population_variance(&self) -> f64

Source§

fn standard_deviation(&self) -> f64

Source§

fn sample_standard_deviation(&self) -> f64

Source§

fn population_standard_deviation(&self) -> f64

Source§

fn covariance(&self, other: &Vec<f64>) -> f64

Source§

fn correlation(&self, other: &Vec<f64>) -> f64

Source§

fn skewness(&self) -> f64

Source§

fn kurtosis(&self) -> f64

Source§

fn min(&self) -> f64

Source§

fn max(&self) -> f64

Source§

fn median(&self) -> f64

Source§

fn percentile(&self, percentile: f64) -> f64

Source§

fn quantile(&self, quantile: f64) -> f64

Source§

fn interquartile_range(&self) -> f64

Source§

fn range(&self) -> f64

Implementors§