Calculate a robust standard deviation using the median absolute deviation (MAD).
The standard deviation estimator is given by:
\sigma \approx \frac{\textrm{MAD}}{\Phi^{-1}(3/4)} \approx 1.4826 \ \textrm{MAD}
where \Phi^{-1}(P) is the normal inverse cumulative distribution function evaluated at probability P = 3/4.
Parameters: | data : array-like
|
---|---|
Returns: | result : float
|
Examples
>>> from astropy.stats import mad_std
>>> from astropy.utils import NumpyRNGContext
>>> from numpy.random import normal
>>> with NumpyRNGContext(12345):
... data = normal(5, 2, size=(100, 100))
... mad_std(data)
2.02327646594