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§
sourcefn medf_unchecked(self) -> f64
fn medf_unchecked(self) -> f64
Median of f64s, including NaNs
sourcefn medf_weighted(self, ws: Self, eps: f64) -> Result<f64, MedError<String>>
fn medf_weighted(self, ws: Self, eps: f64) -> Result<f64, MedError<String>>
Iterative weighted median
sourcefn medf_zeroed(self, centre: f64) -> Vec<f64>
fn medf_zeroed(self, centre: f64) -> Vec<f64>
Zero mean/median data produced by subtracting the centre
Object Safety§
This trait is not object safe.
Implementations on Foreign Types§
source§impl Medianf64 for &[f64]
impl Medianf64 for &[f64]
Medians of &mut [&f64].
source§fn medf_checked(self) -> Result<f64, MedError<String>>
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
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>>
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>
fn medf_zeroed(self, centre: f64) -> Vec<f64>
Zero mean/median data produced by subtracting the centre, typically the mean or the median.