Function medianAbsDev

Calculates the median absolute deviation of a dataset. This is the median of all absolute differences from the median of the dataset.

MedianAbsDev medianAbsDev(T) (
  T data
)
if (doubleInput!T);

Returns

A MedianAbsDev struct that contains the median (since it is computed anyhow) and the median absolute deviation.

Notes

No bias correction is used in this implementation, since using one would require assumptions about the underlying distribution of the data.