pub trait Statistics<T> {
// Required methods
fn mean(&self) -> Option<T>;
fn var(&self) -> Option<T>;
fn stddev(&self) -> Option<T>;
fn median(&self) -> Option<T>;
fn quantile(&self, q: T) -> Option<T>;
fn iqr(&self) -> Option<T>;
fn min(&self) -> Option<T>;
fn max(&self) -> Option<T>;
fn cumsum(&self) -> Vector<T>;
}Expand description
Trait definition for Statistics, generic over type T. T is expected to be a floating-point type like f32 or f64.
Required Methods§
sourcefn mean(&self) -> Option<T>
fn mean(&self) -> Option<T>
Computes the mean (average) of the data.
Returns an Option
sourcefn var(&self) -> Option<T>
fn var(&self) -> Option<T>
Computes the variance of the data.
Returns an Option
sourcefn stddev(&self) -> Option<T>
fn stddev(&self) -> Option<T>
Computes the standard deviation of the data.
Returns an Option
sourcefn median(&self) -> Option<T>
fn median(&self) -> Option<T>
Computes the median of the data.
Returns an Option
sourcefn quantile(&self, q: T) -> Option<T>
fn quantile(&self, q: T) -> Option<T>
Computes the quantile for the given fraction q.
q is expected to be a floating-point value between 0 and 1.
Returns an Option
sourcefn iqr(&self) -> Option<T>
fn iqr(&self) -> Option<T>
Computes the interquartile range (IQR) of the data.
Returns an Option
sourcefn min(&self) -> Option<T>
fn min(&self) -> Option<T>
Returns the minimum value in the dataset, ignoring NaN values.
Returns an Option