{
  "id": "median-absolute-deviation",
  "title": "Median Absolute Deviation",
  "lang": "en",
  "source_lang": "en",
  "summary": "The median absolute deviation is a robust measure of statistical dispersion, defined as the median of the absolute distances from the data’s median.",
  "category": "mathematics",
  "subcategory": "probability-statistics",
  "type": "concept",
  "aliases": [
    "MAD",
    "Median absolute deviation from the median"
  ],
  "generated_at": "2026-11-05",
  "model": "pro/gpt-6.1-sol",
  "url": "https://aiwiki.page/en/median-absolute-deviation/",
  "translations": {
    "zh-Hans": {
      "url": "https://aiwiki.page/zh/median-absolute-deviation/",
      "json": "https://aiwiki.page/zh/median-absolute-deviation.json"
    }
  },
  "sections": [
    {
      "heading": "",
      "text": "The median absolute deviation (MAD) is a measure of dispersion in statistics. It is the median of the absolute differences between observations and their median. Because it depends on the middle of the distribution of deviations rather than their sum or squared sum, it is relatively insensitive to extreme observations. The MAD is widely used in robust statistics as an alternative to the standard deviation, especially when data contain outliers or have heavy tails."
    },
    {
      "heading": "Definition",
      "text": "For observations \\(x_1,\\ldots,x_n\\), first calculate the sample median,\n\n\\[\\widetilde{x}=\\operatorname{median}_{1\\leq i\\leq n}x_i.\\]\n\nThe unscaled sample MAD is then\n\n\\[\\operatorname{MAD} = \\operatorname{median}_{1\\leq i\\leq n} \\left|x_i-\\widetilde{x}\\right|.\\]\n\nFor an even number of observations, a common convention defines the median as the arithmetic mean of the two middle ordered values. This convention is applied both to the original observations and to their absolute deviations.\n\nFor a random variable \\(X\\) with a specified population median \\(m\\), the population MAD is\n\n\\[d=\\operatorname{median}|X-m|.\\]\n\nFor distributions with nonunique medians, the definition requires a convention for selecting the relevant medians. If the cumulative distribution function \\(F\\) is continuous and strictly increasing, \\(d\\) is the unique nonnegative solution to\n\n\\[F(m+d)-F(m-d)=\\frac12.\\]\n\nThus the interval \\([m-d,m+d]\\) contains half the probability. For distributions with point masses, an interval of this form can contain more than half the probability.\n\nThe abbreviation MAD is also sometimes used for mean absolute deviation. That is a different statistic: it averages absolute deviations rather than taking their median. The center used in a mean absolute deviation must also be specified."
    },
    {
      "heading": "Calculation and example",
      "text": "Consider the ordered data\n\n\\[1,\\;1,\\;2,\\;2,\\;4,\\;6,\\;9.\\]\n\nTheir median is \\(2\\). The absolute deviations from \\(2\\) are\n\n\\[1,\\;1,\\;0,\\;0,\\;2,\\;4,\\;7.\\]\n\nAfter sorting these deviations,\n\n\\[0,\\;0,\\;1,\\;1,\\;2,\\;4,\\;7,\\]\n\ntheir median is \\(1\\), so the MAD equals \\(1\\).\n\nReplacing \\(9\\) by \\(900\\) changes the largest deviation but leaves both the sample median and the MAD unchanged. In contrast, the standard deviation increases substantially.\n\nA direct implementation sorts the observations and then sorts the deviations, requiring \\(O(n\\log n)\\) time in asymptotic notation. Median-selection algorithms can avoid full sorting and compute the MAD in linear time; whether that guarantee is expected or worst-case depends on the selection algorithm."
    },
    {
      "heading": "Scaling to estimate a standard deviation",
      "text": "The raw MAD and the standard deviation measure spread differently, so their numerical values are generally not equal. Under a normal distribution, they have a fixed relationship.\n\nIf \\(X\\sim N(\\mu,\\sigma^2)\\), the population median is \\(\\mu\\), and\n\n\\[\\Pr\\bigl(|X-\\mu|\\leq d\\bigr) = 2\\Phi(d/\\sigma)-1,\\]\n\nwhere \\(\\Phi\\) is the standard normal cumulative distribution function. Setting this probability equal to \\(1/2\\) gives\n\n\\[d=\\sigma\\Phi^{-1}(0.75) \\approx0.67448975\\,\\sigma.\\]\n\nConsequently, the normal-consistent scaled MAD is\n\n\\[\\widehat{\\sigma}_{\\mathrm{MAD}} = \\frac{\\operatorname{MAD}}{\\Phi^{-1}(0.75)} \\approx1.48260222\\,\\operatorname{MAD}.\\]\n\nHere, \\(\\Phi^{-1}(0.75)\\) is the standard normal distribution’s 75th-percentile quantile.\n\nUnder independent sampling from a normal population, this scaled statistic is a consistent estimator of \\(\\sigma\\): it approaches the population standard deviation as sample size increases. The factor \\(1.4826\\) is not a universal conversion from MAD to standard deviation. Other distributional assumptions generally require different factors, and some distributions have no finite standard deviation.\n\nNormal consistency also does not imply exact finite-sample unbiasedness. Additional corrections may depend on sample size and the median convention; they concern estimator bias, not the definition of the raw MAD.\n\nSoftware conventions differ. A function named “MAD” may return either the raw statistic or a scaled value, so its scaling convention is part of the result’s interpretation."
    },
    {
      "heading": "Robustness and statistical properties",
      "text": "Resistance to contamination\n\nThe MAD is resistant to a minority of arbitrarily extreme observations because such observations need not change the middle absolute deviation substantially. By contrast, a single observation taken arbitrarily far away can make the sample variance and standard deviation arbitrarily large.\n\nThe MAD has an asymptotic replacement breakdown point of \\(50\\%\\) for nondegenerate continuous populations. Informally, contamination approaching half the sample can be required to make this scale estimate arbitrarily large or collapse it to zero. Exact finite-sample thresholds depend on sample size, median conventions, and ties. A dataset that already has many identical values can have zero MAD without any additional contamination.\n\nA high breakdown point does not mean that contamination has no effect below that threshold. It describes resistance to arbitrarily severe failure, not complete stability.\n\nTranslation and scale behavior\n\nFor \\(y_i=a+bx_i\\),\n\n\\[\\operatorname{MAD}(y_1,\\ldots,y_n) = |b|\\operatorname{MAD}(x_1,\\ldots,x_n).\\]\n\nAdding a constant therefore leaves the MAD unchanged, while multiplying the observations by a constant multiplies the MAD by its absolute value. The statistic has the same physical units as the observations.\n\nEfficiency under normality\n\nRobustness involves a trade-off. Under independent, exactly normal sampling, the scaled MAD has an asymptotic relative efficiency of approximately \\(37\\%\\) compared with the usual sample standard deviation when estimating \\(\\sigma\\). It therefore requires roughly \\(2.7\\) times as many observations to achieve the same large-sample precision under that model.\n\nThis comparison is model-specific. With contaminated or heavy-tailed data, the usual standard deviation may be much less stable, and its normal-model efficiency advantage need not persist.\n\nNo moment requirement\n\nThe population MAD does not require a finite expected value or variance. For example, a Cauchy distribution with location \\(x_0\\) and scale \\(\\gamma>0\\) has median \\(x_0\\) and MAD \\(\\gamma\\), although its mean and variance are undefined."
    },
    {
      "heading": "Applications",
      "text": "The MAD is commonly reported alongside the median to describe a distribution’s center and spread. It is also used to estimate noise scale, standardize residuals, and construct outlier-screening statistics.\n\nOne common modified z-score is\n\n\\[M_i = \\frac{0.67448975(x_i-\\widetilde{x})} {\\operatorname{MAD}},\\]\n\nprovided the raw MAD is positive. Equivalently, this divides the centered observation by the normal-consistent scaled MAD. Under an approximately normal model, its scale resembles that of an ordinary z-score, but using estimated medians and MADs does not give it an exact standard normal distribution. A threshold applied to this statistic is not automatically a calibrated hypothesis test.\n\nIn time-series analysis, a rolling MAD can describe local variability. Its interpretation depends on the window length, local trends, and serial dependence. In regression, the MAD of residuals can provide a robust scale estimate, although a robust residual-scale calculation does not by itself make the fitted regression resistant to influential observations."
    },
    {
      "heading": "Limitations and related measures",
      "text": "The MAD can equal zero even when some observations differ. For example,\n\n\\[0,\\;0,\\;0,\\;1,\\;2\\]\n\nhas median \\(0\\) and MAD \\(0\\). This occurs when a strict majority of observations coincide, and can be common with discrete, rounded, or zero-heavy data. Standardization by the MAD is then undefined.\n\nFor skewed distributions, the MAD combines deviations on both sides of the median into a single number. It does not describe asymmetry or distinguish upper-tail from lower-tail behavior. Quantiles or separate measures of spread on each side can describe features that the MAD omits.\n\nThe interquartile range, defined as the difference between the 75th and 25th percentiles, is another robust measure of dispersion. Unlike the MAD, it uses two quantiles of the original observations rather than the median of centered absolute deviations. The two measures need not be proportional outside particular distribution families.\n\nFinally, a small MAD does not imply that extreme observations are unimportant. The statistic deliberately limits their influence; it is not designed to summarize maximum deviations, tail risk, or the frequency of rare extremes."
    }
  ],
  "links": [
    "statistics",
    "median",
    "absolute-value",
    "standard-deviation",
    "random-variable",
    "cumulative-distribution-function",
    "big-o-notation",
    "normal-distribution",
    "quantile",
    "consistent-estimator",
    "estimator-bias",
    "variance",
    "expected-value",
    "cauchy-distribution",
    "statistical-hypothesis-testing",
    "time-series",
    "linear-regression",
    "interquartile-range"
  ],
  "sources": [],
  "license": "https://creativecommons.org/licenses/by/4.0/"
}