Trait rstats::Medianf64

source ·
pub trait Medianf64 {
    // Required methods
    fn medf_checked(self) -> Result<f64, MedError<String>>;
    fn medf_unchecked(self) -> f64;
    fn medf_weighted(self, ws: Self, eps: f64) -> Result<f64, MedError<String>>;
    fn medf_zeroed(self, centre: f64) -> Vec<f64>;
    fn medf_correlation(self, v: Self) -> Result<f64, MedError<String>>;
    fn madf(self, centre: f64) -> f64;
}
Expand description

Fast 1D medians of floating point data, plus related methods

Required Methods§

source

fn medf_checked(self) -> Result<f64, MedError<String>>

Median of f64s, NaNs removed

source

fn medf_unchecked(self) -> f64

Median of f64s, including NaNs

source

fn medf_weighted(self, ws: Self, eps: f64) -> Result<f64, MedError<String>>

Iterative weighted median

source

fn medf_zeroed(self, centre: f64) -> Vec<f64>

Zero mean/median data produced by subtracting the centre

source

fn medf_correlation(self, v: Self) -> Result<f64, MedError<String>>

Median correlation = cosine of an angle between two zero median vecs

source

fn madf(self, centre: f64) -> f64

Median of absolute differences (MAD).

Object Safety§

This trait is not object safe.

Implementations on Foreign Types§

source§

impl Medianf64 for &[f64]

Medians of &mut [&f64].

source§

fn medf_checked(self) -> Result<f64, MedError<String>>

Returns nan error when any data item is a NaN, otherwise the median

source§

fn medf_unchecked(self) -> f64

Use this when your data does not contain any NaNs. NaNs will not raise an error. However, they will affect the result because of their order positions beyond infinity.

source§

fn medf_weighted(self, ws: &[f64], eps: f64) -> Result<f64, MedError<String>>

Iterative weighted median with accuracy eps

source§

fn medf_zeroed(self, centre: f64) -> Vec<f64>

Zero mean/median data produced by subtracting the centre, typically the mean or the median.

source§

fn medf_correlation(self, v: &[f64]) -> Result<f64, MedError<String>>

Median correlation = cosine of an angle between two zero median vectors, (where the two data samples are interpreted as n-dimensional vectors).

source§

fn madf(self, centre: f64) -> f64

Data dispersion estimator MAD (Median of Absolute Differences). MAD is more stable than standard deviation and more general than quartiles. When argument centre is the median, it is the most stable measure of data dispersion.

Implementors§