pingouin.mad

pingouin.mad(a, normalize=True, axis=0)[source]

Median Absolute Deviation along given axis of an array.

Parameters
aarray-like

Input array.

normalizeboolean.

If True, scale by a normalization constant (~0.67)

axisint, optional

The defaul is 0. Can also be None.

Returns
madfloat

mad = median(abs(a - median(a))) / c

References

1

https://en.wikipedia.org/wiki/Median_absolute_deviation

Examples

>>> from pingouin import mad
>>> a = [1.2, 5.4, 3.2, 7.8, 2.5]
>>> mad(a)
2.965204437011204
>>> mad(a, normalize=False)
2.0