Robust Non-Parametric Dispersion (50% Breakdown)

Median Absolute Deviation Calculator

Calculate the Median Absolute Deviation (MAD), Normalized MAD (NMAD = 1.4826×MAD), and Hampel outlier filtering fences with step-by-step absolute deviation proofs.

Normal Consistency Constant (k):
Absolute Deviations from Median
i Value (x) Formula Absolute Deviation |x − M|
Normalized MAD (NMAD)
3.707
Robust Estimator of Gaussian σ (1.4826 × MAD)
N = 10 sorted values
Raw MAD 2.500 median(|x − M|)
Dataset Median (M) 17.50 50th percentile
Classical Sample SD: 32.610
Notice how classical SD is inflated 9× by a single outlier, while MAD remains stable.
Hampel Outlier Boundaries [M ± 3×NMAD]
Lower Fence 6.38
Upper Fence 28.62
Flagged Outliers: 120
Robust Statistics & Heavy-Tailed Distributions

Critical Problems This Median Absolute Deviation Calculator Solves

Classical standard deviation squares distances, giving infinite leverage to extreme anomalies. When analyzing sensor telemetry, financial returns, or biomedical assays, our median absolute deviation calculator delivers robust stability:

50% Breakdown Point Resilience

Standard deviation has a 0% breakdown point: a single corrupted sensor reading (e.g. 10,000°C) blows the entire scale estimate to infinity. MAD can withstand up to 50% contaminated observations without losing its integrity.

Powering Hampel Outlier Filtering

Using classical \(Z\)-scores to find outliers creates a catch-22: the outliers inflate the standard deviation, which then masks the outliers. The Hampel filter uses \(\text{median} \pm 3 \times \text{NMAD}\) to prevent outlier masking.

Seamless Conversion to Gaussian σ (NMAD)

Raw MAD values are smaller than standard deviations because they measure the 50% interquartile span. Multiplying by \(1 / \Phi^{-1}(0.75) \approx 1.4826\) provides an unbiased estimator of true Gaussian standard deviation.

Financial Risk & Algorithmic Trading

Asset return series feature fat-tailed kurtosis and flash crashes. Quantitative risk models rely on MAD to size stop-losses and detect regime shifts without being whipsawed by one-off black swan events.

Features Available in the Median Absolute Deviation Calculator

Raw & Normalized MAD

Derives both raw \(\text{median}(|x - M|)\) and Gaussian-scaled \(\text{NMAD} = 1.4826 \times \text{MAD}\).

Classical SD Contrast

Directly compares robust NMAD against classical standard deviation to show outlier distortion.

Hampel Outlier Engine

Computes lower and upper 3-NMAD fences and automatically lists all breached observations.

Itemized Deviation Table

Displays row-by-row distance proofs from the median with highlighted outlier tags.

How to Use the Median Absolute Deviation Calculator

1

Paste Observations

Enter numerical values separated by commas, spaces, tabs, or lines.

2

Review Dataset Median

Check the calculated 50th percentile center value in the diagnostics grid.

3

Inspect Normalized MAD

Review the primary NMAD score estimating standard deviation robustly.

4

Check Classical SD

Observe how vulnerable the classical standard deviation was to your tail data.

5

Audit Hampel Fences

Review the flagged outlier values lying beyond \(M \pm 3 \times \text{NMAD}\).

6

Export Summary

Copy the complete MAD audit report directly to your clipboard.

Mathematical MAD Formulations

Given dataset \(X = \{x_1, x_2, \dots, x_n\}\) with sample median \(M = \text{median}(X)\):

$$\text{MAD} = \text{median}\left(\Big| x_i - \text{median}(X) \Big|\right)$$

Normalized MAD (\(\text{NMAD}\)) for Gaussian consistency:

$$\text{NMAD} = \frac{1}{\Phi^{-1}(0.75)} \times \text{MAD} \approx 1.4826 \times \text{MAD}$$

Hampel Identifier Outlier Thresholds:

$$\text{Fence}_{\text{Lower}} = M - 3 \times \text{NMAD} \quad,\quad \text{Fence}_{\text{Upper}} = M + 3 \times \text{NMAD}$$

Worked Case Study: Microcontroller Sensor Telemetry with Noise Spike

Scenario: 10 pressure readings (kPa) are captured: 12, 14, 15, 16, 17, 18, 19, 20, 22, 120 (one erroneous electrical glitch spike).

  • Sorted Data: 12, 14, 15, 16, 17, 18, 19, 20, 22, 120
  • Median (\(M\)): \(\frac{17 + 18}{2} = \mathbf{17.50\,\text{kPa}}\)
  • Absolute Deviations \(|x_i - 17.5|\): 5.5, 3.5, 2.5, 1.5, 0.5, 0.5, 1.5, 2.5, 4.5, 102.5
  • Sorted Deviations: 0.5, 0.5, 1.5, 1.5, 2.5, 2.5, 3.5, 4.5, 5.5, 102.5
  • Raw MAD: \(\frac{2.5 + 2.5}{2} = \mathbf{2.50\,\text{kPa}}\).
  • Normalized MAD (NMAD): \(2.50 \times 1.4826 = \mathbf{3.707\,\text{kPa}}\).
  • Classical Standard Deviation: \(s = \mathbf{32.61\,\text{kPa}}\) (corrupted 900% by the 120 glitch).
  • Hampel Outlier Fences: \(17.5 \pm (3 \times 3.707) = [6.38, 28.62]\). The spike of 120 is flagged cleanly as an outlier.

Robust Scale Best Practices

Use for Automated Machine Pipelines

In automated data pipelines where human analysts cannot inspect histograms, replace classical Z-scores with NMAD and Hampel filtering to prevent pipeline crashes from noise spikes.

Beware of Repeated Identical Values

If more than 50% of the sample has the exact same value (e.g. lots of zeros in sales data), MAD will collapse to 0. In such zero-inflated cases, use IQR or Rousseeuw's \(S_n\) estimator.

Efficiency on Pure Normal Data

On perfectly pure Gaussian data with zero outliers, MAD has an asymptotic efficiency of 37% compared to sample standard deviation. Use MAD when outlier contamination is possible.

Small Sample Bias Adjustment

For tiny datasets (\(N < 10\)), NMAD slightly underestimates true \(\sigma\). Finite sample correction factors (\(b_n\)) can be applied to tune the scaling multiplier.

Scale Estimators Comparison Matrix

Scale Metric Core Formula Breakdown Point Outlier Resilience
MAD / NMAD 1.4826 × median(|x − M|) 50% (Highest Possible) Immune to up to half outliers
Interquartile Range (IQR) Q3 − Q1 25% Immune to up to 25% tail outliers
Standard Deviation (s) √[ ∑(x − x̄)² / (n − 1) ] 0% (Fragile) Destroyed by a single outlier

Robust Statistics Glossary

Breakdown Point

The proportion of incorrect observations an estimator can handle before giving an arbitrarily large or incorrect result (50% for MAD).

NMAD

Normalized Median Absolute Deviation, computed by multiplying raw MAD by 1.4826 to make it an unbiased estimator of \(\sigma\) on normal data.

Hampel Identifier

A robust outlier detection rule that replaces sample mean and standard deviation with median and NMAD: \(|x - M| > 3 \times \text{NMAD}\).

Masking Effect

The phenomenon where multiple outliers inflate standard deviation so much that they hide each other from classical \(Z\)-score detection.

Frequently Asked Questions

What is the Median Absolute Deviation (MAD)?
The Median Absolute Deviation (MAD) is a robust measure of statistical dispersion, defined as the median of the absolute differences between each data point and the sample median.
Why is MAD preferred over Standard Deviation in robust statistics?
Standard deviation squares errors and is severely distorted by extreme outliers (0% breakdown point). MAD has a 50% breakdown point, remaining unaffected even if up to half the data is corrupted.
Why is MAD multiplied by 1.4826?
For a normal distribution, raw MAD equals approximately 0.6745 times the standard deviation. Multiplying MAD by 1 / 0.6745 ≈ 1.4826 normalizes MAD so that NMAD estimates sigma consistently.
How is MAD calculated step-by-step?
1. Find median M of dataset X. 2. Calculate absolute distances |xi - M| for all observations. 3. Find the median of these absolute differences. The result is the MAD.
What is the Hampel filter for outlier detection?
The Hampel identifier flags an observation as an outlier if |xi - Median| > 3 * NMAD, replacing standard deviation with robust MAD to prevent outlier masking.
Can MAD be zero?
Yes. If more than 50% of the observations in the dataset share the exact same identical value, the median absolute deviation will equal zero.
What is the breakdown point of MAD?
MAD has the highest possible breakdown point of 50%, meaning that up to 50% of the observations can be replaced with infinite outliers without blowing up the scale estimate.
What is the difference between MAD and Mean Absolute Deviation?
Median Absolute Deviation uses the median both as the center and the summary operator. Mean Absolute Deviation uses the arithmetic mean, making it more vulnerable to outliers.
Where is MAD commonly used in industry?
MAD is widely used in algorithmic trading for anomaly detection, bioinformatics microarray data normalization, digital signal filtering, and machine learning robust loss functions.
How does MAD behave on asymmetric skewed data?
MAD remains stable on skewed distributions because it measures distance from the median; however, the normal scaling factor 1.4826 only applies to symmetric Gaussian data.
Is MAD sensitive to sample size?
For small samples (n < 15), small-sample correction factors are sometimes applied to NMAD to adjust for finite-sample bias, though 1.4826 is universally accepted as standard.
What software uses NMAD as default?
R's `mad()` function, Python SciPy's `scipy.stats.median_abs_deviation(..., scale='normal')`, and MATLAB's `mad(..., 1)` all apply the 1.4826 scaling constant by default.