In statistics, the median absolute deviation (MAD) is a robust measure of the variability of a univariate sample of quantitative data. It can also refer to the population parameter that is estimated by the MAD calculated from a sample.[1]
For a univariate data set X1, X2, ..., Xn, the MAD is defined as the median of the absolute deviations from the data's median
\tilde{X}=\operatorname{median}(X)
\operatorname{MAD}=\operatorname{median}(|Xi-\tilde{X}|)
that is, starting with the residuals (deviations) from the data's median, the MAD is the median of their absolute values.
Consider the data (1, 1, 2, 2, 4, 6, 9). It has a median value of 2. The absolute deviations about 2 are (1, 1, 0, 0, 2, 4, 7) which in turn have a median value of 1 (because the sorted absolute deviations are (0, 0, 1, 1, 2, 4, 7)). So the median absolute deviation for this data is 1.
The median absolute deviation is a measure of statistical dispersion. Moreover, the MAD is a robust statistic, being more resilient to outliers in a data set than the standard deviation. In the standard deviation, the distances from the mean are squared, so large deviations are weighted more heavily, and thus outliers can heavily influence it. In the MAD, the deviations of a small number of outliers are irrelevant.
Because the MAD is a more robust estimator of scale than the sample variance or standard deviation, it works better with distributions without a mean or variance, such as the Cauchy distribution.
\sigma
\hat{\sigma}=k ⋅ \operatorname{MAD},
where
k
For normally distributed data
k
k=1/\left(\Phi-1(3/4)\right) ≈ 1/0.67449 ≈ 1.4826,
\Phi-1
Z=(X-\mu)/\sigma
The argument 3/4 is such that
\pm\operatorname{MAD}
12 | |
= |
P(|X-\mu|\le\operatorname{MAD})=P\left(\left|
X-\mu | |
\sigma |
\right|\le
\operatorname{MAD | |
\Phi\left(\operatorname{MAD}/\sigma\right)-\Phi\left(-\operatorname{MAD}/\sigma\right)=1/2.
\Phi\left(-\operatorname{MAD}/\sigma\right)=1-\Phi\left(\operatorname{MAD}/\sigma\right),
\operatorname{MAD}/\sigma=\Phi-1(3/4)=0.67449
k=1/\Phi-1(3/4)=1.4826
Another way of establishing the relationship is noting that MAD equals the half-normal distribution median:
\operatorname{MAD}=\sigma\sqrt{2}\operatorname{erf}-1(1/2) ≈ 0.67449\sigma.
In the case of complex values (X+iY), the relation of MAD to the standard deviation is unchanged for normally distributed data.
Analogously to how the median generalizes to the geometric median (gm) in multivariate data, MAD can be generalized to MADGM (median of distances to gm) in n dimensions. This is done by replacing the absolute differences in one dimension by euclidean distances of the data points to the geometric median in n dimensions.[5] This gives the identical result as the univariate MAD in 1 dimension and generalizes to any number of dimensions. MADGM needs the geometric median to be found, which is done by an iterative process.
The population MAD is defined analogously to the sample MAD, but is based on the complete distribution rather than on a sample. For a symmetric distribution with zero mean, the population MAD is the 75th percentile of the distribution.
Unlike the variance, which may be infinite or undefined, the population MAD is always a finite number. For example, the standard Cauchy distribution has undefined variance, but its MAD is 1.
The earliest known mention of the concept of the MAD occurred in 1816, in a paper by Carl Friedrich Gauss on the determination of the accuracy of numerical observations.[6] [7]