Compute the median absolute deviation.
Returns the median absolute deviation (MAD) of the array elements. The MAD is defined as :math median( |a - median (a)| ).
Parameters : | a : array_like
axis : int, optional
|
---|---|
Returns : | median_absolute_deviation : ndarray
|
See also
numpy.median
Examples
This will generate random variates from a Gaussian distribution and return the median absolute deviation for that distribution:
>>> from astropy.stats import median_absolute_deviation
>>> from numpy.random import randn
>>> randvar = randn(10000)
>>> mad = median_absolute_deviation(randvar)