1 Definition and concept

Median absolute deviation (MAD) is a robust statistic used to quantify statistical dispersion. It is constructed by measuring the absolute distance of each observation from the sample median, and then taking the median of those distances. Because it relies on medians rather than averages of squared deviations, it responds less strongly to extreme observations than variance or standard deviation.

1.1 Absolute deviations from the median

The central idea behind MAD is to replace the mean-based notion of “average distance from a center” with a median-based center and a median-based distance summary.

1.1.1 Computing the median of deviations

Given a sample \(x_1,\dots,x_n\), compute the sample median \(m\). Then form the set of absolute deviations \(x_i-m\) for each observation. MAD is obtained as the median of these absolute deviations. This produces a scale-like quantity: it grows when the observations become more spread out around the median, and it shrinks when they cluster tightly.

1.2 Robustness compared with mean-based measures

In mean- and variance-based measures, large outliers can exert disproportionate influence because they are amplified through averaging and (for variance) squaring. MAD avoids much of this amplification by using medians twice: once to locate the center and once to summarize the dispersion. As a result, MAD typically remains stable under contamination by a moderate fraction of outlying values.

1.3 Relationship to other dispersion measures

MAD is related to other robust measures of spread such as the interquartile range (IQR). Both are based on medians or quantiles, and both can support outlier detection. Compared with IQR, MAD often provides a smoother, observation-level notion of scale because it uses all absolute deviations before taking their median. Compared with the standard deviation, MAD is generally less sensitive to heavy tails and isolated extremes, at the cost of some efficiency when the data are truly normal and outliers are absent.

2 Mathematical formulation

2.1 Sample MAD

2.1.1 Notation and step-by-step calculation

Let \(x_1,\dots,x_n\) be a sample and let

  • \(m = \operatorname{median}(x_1,\dots,x_n)\).

Define the sample MAD as \[

\operatorname{MAD}=\operatorname{median}\left(\,x_1-m,\dots,x_n-m\,\right).

\] A step-by-step computational outline is:

  1. Compute the sample median \(m\).
2. Compute absolute deviations \(d_i =x_i-m\).
  1. Take the median of \(\{d_1,\dots,d_n\}\).

Many software packages implement this exact construction, occasionally differing by whether a scaling factor is applied afterward.

2.2 Scaled MAD and consistency with normal data

In some applications, MAD is multiplied by a constant so that it estimates the standard deviation for data drawn from a normal distribution.

2.2.1 Common scaling constants

For \(X\sim \mathcal{N}(\mu,\sigma^2)\), the distribution of \(X-\mu\) implies that

\[ \text{MAD} \approx \frac{\sigma}{c} \] for a specific constant \(c\). A commonly used scaling constant is \[ c \approx 0.6745, \] leading to the scaled MAD \[ \text{scaled MAD} = \frac{\operatorname{MAD}}{0.6745}, \] which is a consistency adjustment under normality.

Other conventions exist depending on whether the median is taken over the sample or the population, and on how medians are defined for even sample sizes, but the “divide by 0.6745” rule is widely encountered.

2.3 Population MAD

A population analogue defines dispersion using the true median and the median of absolute deviations under the distribution. If \(F\) is the distribution of \(X\), let \(m_F\) be a (population) median. Then the population MAD is \[

\operatorname{MAD}(F)=\operatorname{median}\left(X-m_F\right),

\]

where “median” refers to the distribution of \(X-m_F\). This framing is useful for theoretical properties such as asymptotic behavior.

2.4 Connection to quantiles

MAD can be expressed in terms of quantiles. Let \(Q_p(\cdot)\) denote a quantile at probability level \(p\). If the median of \(X-m_F\) corresponds to probability \(1/2\), then MAD is essentially the 50th percentile of the absolute-deviation distribution. In practice, with finite samples, computing the median of deviations is equivalent to taking an empirical quantile of \(X-m\).

3 Properties of MAD

3.1 Breakdown point and outlier sensitivity

MAD has a high breakdown point relative to classical scale estimators. Intuitively, because it uses medians, a substantial fraction of contaminated observations must be present before the center or the median absolute deviation shifts dramatically. In many settings, MAD can tolerate contamination better than mean- or variance-based scales.

The exact breakdown value depends on how the sample median behaves and on whether the statistic is defined with a particular convention for even \(n\). Nevertheless, MAD is commonly regarded as a robust alternative that resists isolated extreme values.

3.2 Influence function (qualitative behavior)

The influence function describes how an infinitesimal contamination at a point affects an estimator. For MAD, the qualitative behavior is that points far from the median tend to have a bounded (or at least much less explosive) effect compared with estimators based on squared deviations. This means that outliers do not produce unbounded changes in the estimated dispersion, supporting its use in robust workflows.

3.3 Efficiency under different distributions

Robustness often trades off with efficiency. When the data are exactly normal and outliers are absent, standard deviation may be more efficient (lower variance) than MAD. However, for heavy-tailed distributions or contaminated samples, MAD can outperform mean-based measures in terms of mean squared error because the latter can be heavily biased by extremes. Scaled MAD can partially mitigate efficiency loss under normality, but it does not fully remove the robustness–efficiency trade-off.

3.4 Symmetry and transformation behavior

MAD is equivariant under location shifts and scales in a simple way. If the data are shifted by a constant \(a\), absolute deviations from the median remain unchanged in magnitude; if multiplied by a constant \(b\), all deviations scale by \(b\). Consequently, MAD scales proportionally with the data under linear transformations, preserving its interpretability as a “scale” measure.

Because it is based on absolute deviations and medians, MAD behaves naturally under sign changes (multiplying by \(-1\)) and under monotone transformations is more nuanced; general nonlinear transforms can distort the relationship between MAD and the underlying scale.

4 Estimation and interpretation

4.1 Choosing between MAD and scaled MAD

Choosing between raw MAD and scaled MAD depends on the goal:

  • If the objective is robust dispersion in the original units without assuming any parametric form, raw MAD is often appropriate.
  • If the goal is to approximate a standard deviation scale under normality (for example, when building robust z-scores), scaled MAD is typically preferred.

In practice, analysts often report both: MAD for robustness and scaled MAD for easier comparison with standard deviation.

4.2 How to interpret MAD values

MAD is measured in the same units as the variable (not squared units). A larger MAD indicates that absolute deviations from the sample median tend to be larger, suggesting greater spread. For interpretability, it can help to relate MAD to other robust scales, such as IQR, by checking whether the dataset exhibits strong concentration or broad dispersion.

On very skewed or multimodal data, the median-based center can fall in a region that is not representative of all modes; in such cases, MAD reflects dispersion around that median, which may differ from “typical” dispersion within each cluster.

4.3 Robust z-scores using MAD

Robust z-scores standardize each observation using a robust scale estimate. A common form is \[ z_i = \frac{x_i - m}{k \cdot \operatorname{MAD}}, \] where \(m\) is the sample median, and \(k\) is a scaling constant used to match standard deviation under normality (often \(k=1\) when MAD has already been scaled, or \(k\approx 0.6745\) when it has not). These robust z-scores can be used for outlier screening with thresholds that are motivated by normal theory but computed using robust dispersion.

4.4 Practical guidance for skewed distributions

For skewed distributions, mean and standard deviation can be pulled in different directions by tail behavior. MAD, tied to the median, remains aligned with the “typical” central location under asymmetry. However, the distribution of \(X-m\) can be asymmetric as well, so interpreting MAD magnitude in relation to a standard deviation may be less precise. Analysts often complement MAD with IQR-based summaries and visualize distributions to validate whether the robust scale aligns with practical expectations.

5 Outlier detection with MAD

5.1 Thresholding rules (conceptual)

A typical robust outlier rule compares a point’s distance from the median to a multiple of MAD. Conceptually, an observation \(x_i\) is flagged if \[

x_i - m> \tau \cdot \operatorname{MAD}

\] (or using scaled MAD and the corresponding \(\tau\)). The choice of \(\tau\) reflects the tolerance level: smaller values flag more points; larger values capture more only extreme departures.

Thresholds are sometimes chosen to mimic normal-theory cutoffs, but in robust practice they can be calibrated empirically to balance sensitivity and false alarms.

5.2 Robust residuals and anomaly scoring

Rather than only declaring a binary outlier, MAD can support graded anomaly scores. One can define robust residuals using \[ r_i = x_i - m, \]

then score anomalies through a standardized magnitude such as \(r_i/ \operatorname{MAD}\) (possibly with scaling). This produces an ordering of points by how atypical they are relative to the median-centered spread.

This scoring approach is especially useful when paired with visualization (e.g., sorting scores) or downstream robust modeling, where it may be preferable to down-weight suspicious observations instead of discarding them outright.

5.3 Comparing MAD-based and IQR-based methods

Both MAD and IQR are robust. IQR-based rules often use quartiles and flag points beyond a certain multiple of the IQR from the quartile boundaries. MAD-based rules, in contrast, use absolute deviations from the median and their median. In practice:

  • MAD can be more sensitive to moderate deviations because it references every absolute deviation, albeit summarized by a median.
  • IQR can be more straightforward to interpret in terms of “middle 50%” spread.
  • Which performs better depends on distribution shape and the outlier pattern (e.g., symmetric heavy tails vs. one-sided contamination).

In many workflows, using both as cross-checks improves confidence in outlier labeling.

6 Algorithms and computation

6.1 Efficient median and absolute deviation computation

Computing MAD requires medians of the original data and of the absolute deviations. Efficient algorithms for medians can be used, such as selection-based methods that avoid full sorting, although many practical implementations simply sort when \(n\) is manageable. The general computational flow is:

  1. Find the median \(m\).
2. Compute absolute deviations \(d_i =x_i-m\).
  1. Find the median of \(\{d_i\}\).

When working with large datasets, care is taken to minimize extra passes and temporary storage where possible.

6.2 Handling ties and discrete data

If many observations share the same value, medians and median absolute deviations can exhibit tied values. Standard median definitions for even sample sizes (e.g., average of the two central values) can affect the resulting MAD. For discrete data, MAD may take on a limited set of values; this is not a failure but reflects the resolution of the underlying measurement. When MAD is zero due to repeated observations at the median (or when all observations coincide), robust z-scores must be handled separately to avoid division by zero.

6.3 Numerical stability considerations

Absolute deviation computations are generally stable, but numerical issues can arise in extreme scales (very large magnitudes) or when data are floating-point with limited precision. Using robust libraries that implement median computation carefully helps reduce errors. Additionally, when \( \operatorname{MAD} \) is very small, scaling for robust z-scores can produce very large standardized values; implementations often include safeguards, such as treating near-zero MAD as a special case.

6.4 Computational complexity overview

Median computation can be performed in:

  • \(O(n \log n)\) time via sorting, or
  • \(O(n)\) expected time using selection algorithms (depending on implementation details).

MAD calculation typically involves computing one median and then another median after forming deviations, which leads to roughly twice the cost of median finding plus the overhead of computing absolute deviations. In most real-world settings, the total cost is dominated by the median computation method chosen.

7 Extensions and variants

7.1 Multivariate MAD ideas (overview)

For multivariate data, defining a “median absolute deviation” is less direct because “distance from the median” depends on a notion of multivariate center and a distance metric. Approaches include:

  • using a multivariate median (e.g., geometric median) as the center and computing distances to it, then taking a median of those distances,
  • using robust scatter estimators and then applying robust scale measures to distances.

These methods aim to preserve robustness properties while accommodating correlations among variables.

7.2 Conditional or localized MAD

Conditional variants adapt the dispersion measure to subsets or neighborhoods of the data. Instead of one global median-based scale, one computes MAD in localized regions, or conditions on covariates. This can be valuable when variability changes across the input space (heteroscedasticity), where a single global MAD may over- or under-estimate spread in different regimes.

7.3 Weighted and generalized MAD forms

Weighted MAD introduces weights for observations, altering how the median and median-of-deviations are computed. Generalizations can include using alternative norms for deviations (e.g., L1-type deviations remain natural because absolute value is central to MAD) or incorporating robustness considerations into more elaborate scale estimators. Weighted versions can be useful when data collection involves sampling weights or unequal reliability.

7.4 Streaming/online MAD approximations

In streaming settings, storing all data to compute exact medians may be impractical. Online methods approximate medians using data sketches or incremental selection strategies. Once an approximate center is available, approximations of median absolute deviations can be updated as new points arrive. Such methods trade exactness for lower memory usage and timely computation, which is often appropriate for real-time monitoring.

8 Applications in statistics and data science

8.1 Robust scale estimation

MAD is widely used as a robust measure of scale in statistics. It serves as a dependable alternative to variance and standard deviation when the sample includes outliers or heavy-tailed noise. In estimation pipelines, it can stabilize procedures that would otherwise be distorted by anomalous observations.

8.2 Preprocessing for machine learning

Feature preprocessing often includes scaling. Using MAD-based scaling can improve robustness when features have outliers. For instance, each feature can be transformed to have a median near zero and a robust dispersion of one (via robust z-scores). This can make learning algorithms less sensitive to extreme feature values, particularly for models that assume or benefit from approximately standardized inputs.

8.3 Quality control and exploratory analysis

In industrial or laboratory contexts, MAD supports identifying irregular measurements without being overly influenced by occasional extreme readings. In exploratory data analysis, MAD can complement histograms and box plots by providing a quantitative, robust summary of spread. It can also support monitoring drift by comparing MAD over time windows.

8.4 Hampel-type robust procedures (conceptual)

Hampel-type robust methods employ robust location and scale estimates to down-weight or reject observations that deviate substantially from the bulk of the data. MAD often appears as the scale component because of its high breakdown properties. Conceptually, such procedures treat large deviations as potential outliers and adjust the analysis accordingly, aiming to maintain reliability under contamination.

9 Common pitfalls

9.1 Confusing MAD with mean absolute deviation

Mean absolute deviation (about the mean) is a different statistic from MAD (about the median). MAD uses the median as the center and takes the median of the absolute deviations. Mixing these variants can lead to incorrect scaling, different sensitivity behavior, and misinterpretation of results.

9.2 Misapplying scaling factors

Scaled MAD depends on the convention for the constant used to relate MAD to standard deviation under normality. Using the wrong scaling constant, or double-scaling, can distort the magnitude of robust z-scores and the thresholds used for outlier detection. It is important to confirm whether a given implementation already returns scaled MAD or raw MAD.

9.3 Effects of small sample sizes

With small \(n\), medians can be unstable in the sense that adding or removing a single observation may change the median and, therefore, the MAD. This variability can reduce reliability. Analysts may mitigate this by using robust resampling checks, reporting uncertainty, or using alternative robust scale estimators when sample sizes are extremely small.

9.4 Units and interpretation issues

MAD is in the same units as the data, which is helpful, but some users expect it to behave like standard deviation. When scaled MAD is not used, MAD should not be directly compared numerically to standard deviation without acknowledging the scaling difference. Additionally, on skewed or multimodal distributions, MAD reflects spread around the median rather than spread within each mode.

10 Worked examples

10.1 Example with a clean dataset

Consider a dataset (already in consistent units): \[ \{2, 3, 4, 5, 6\}. \]

The sample median is \(m=4\). Absolute deviations are \(2-4=2\), \(3-4=1\), \(4-4=0\), \(5-4=1\), \(6-4=2\). The median of these deviations is \(1\). Thus \(\operatorname{MAD}=1\). For data that are roughly symmetric and without extremes, MAD will often track the scale of typical fluctuations.

10.2 Example showing outlier robustness

Take a baseline dataset: \[ \{2, 3, 4, 5, 6\} \] which has MAD \(=1\) as above. Now add an outlier: \[ \{2, 3, 4, 5, 6, 100\}. \]

The sample median remains close to the middle; with an even number of points, typical conventions place the median between the two central values (depending on definition). In common implementations, the median is \(m=(3+4)/2=3.5\). Deviations become \(2-3.5=1.5\), \(3-3.5=0.5\), \(4-3.5=0.5\), \(5-3.5=1.5\), \(6-3.5=2.5\), \(100-3.5\approx 96.5\). The median of deviations is the average of the 3rd and 4th sorted deviations, which are \(0.5\) and \(1.5\), giving MAD \(\approx 1.0\). Despite the extreme outlier, the median-of-deviations result stays near the original scale.

10.3 Example computing robust z-scores

Using the outlier-contaminated dataset above, let \(m=3.5\) and \(\operatorname{MAD}\approx 1.0\). Suppose one uses a scaled MAD approximation with \(0.6745\). Then an approximate robust z-score could be \[ z_i=\frac{x_i-m}{0.6745\cdot \operatorname{MAD}}=\frac{x_i-3.5}{0.6745}. \] For \(x=6\), \(z\approx (6-3.5)/0.6745\approx 2.5/0.6745\approx 3.71\). For the outlier \(x=100\), \(z\approx (100-3.5)/0.6745\approx 96.5/0.6745\approx 143\), clearly separating it from typical points. Robust z-scores thus convert the dispersion estimate into a standardized scale for comparison and flagging.

10.4 Comparing MAD to standard deviation and IQR

For the clean dataset \(\{2,3,4,5,6\}\), the spread is moderate and roughly symmetric, so standard deviation, IQR, and MAD tend to be aligned up to scaling. After adding an extreme outlier like \(100\), standard deviation increases dramatically because it aggregates squared deviations. The IQR may increase depending on how the outlier affects quartiles, but for a single isolated extreme point, IQR may remain comparatively stable. MAD typically remains close to its original value (as shown), illustrating why it can be preferred when the main goal is robust scale estimation under contamination.