Expand description
Small robust-statistics helpers shared across NEREIDS crates.
These live in nereids-core (the dependency-free foundation crate) so that
the same estimator is computed identically everywhere instead of being
re-implemented per crate. Each helper returns a plain Option/value
rather than a formatted error, so the calling crate can map degenerate
inputs onto its own error type / message wording without nereids-core
having to know about IoError, FittingError, etc.
Precondition: callers pass finite inputs (they enforce this via
crate::validation before calling in). The helpers nevertheless sort
with f64::total_cmp, which is a total order even over NaN (NaN sorts
last), so a violated precondition degrades to a deterministic — if
meaningless — result instead of a partial_cmp panic path.
Constants§
- MAD_
TO_ SIGMA - Consistency factor converting a median absolute deviation into a Gaussian
standard-deviation estimate:
sigma ≈ MAD_TO_SIGMA * MAD.
Functions§
- median
- Median of a slice of values.
- median_
abs_ deviation - Median absolute deviation of a slice about a given center.