Skip to main content

MAD_TO_SIGMA

Constant MAD_TO_SIGMA 

Source
pub const MAD_TO_SIGMA: f64 = 1.482_602_218_505_601_8;
Expand description

Consistency factor converting a median absolute deviation into a Gaussian standard-deviation estimate: sigma ≈ MAD_TO_SIGMA * MAD.

Derivation: for X ~ N(μ, σ²), the MAD about the median satisfies P(|X − μ| ≤ MAD) = 1/2, i.e. MAD = σ·Φ⁻¹(3/4) where Φ is the standard normal CDF. The consistency factor is therefore

1 / Φ⁻¹(3/4) = 1 / 0.674489750196081… = 1.482602218505601…

so that MAD_TO_SIGMA * MAD is an unbiased estimate of σ for Gaussian data while staying robust (50% breakdown point) against outliers.