Quant Memo
Core

The Median-of-Means Estimator

A way to estimate an average that stays accurate even with heavy-tailed data or a handful of corrupted points, by splitting the data into groups, averaging each group, and taking the median of those group averages.

Prerequisites: The Law of Large Numbers

The plain sample average is the textbook way to estimate a population mean, but it has a weakness: a single extreme value, or data drawn from a distribution with a heavy tail, can drag the average far from the truth, and the usual confidence-interval math (which assumes something close to a Gaussian) becomes unreliable. The median-of-means estimator fixes both problems at once with a strikingly simple recipe: split your data into several groups, average each group separately, then take the median of those group averages, not their overall mean.

An analogy: polling with district results, not raw ballots

Imagine estimating a candidate's true support by splitting a country into, say, 11 districts, computing the average support in each district, and then reporting the median district average rather than pooling every single ballot into one giant average. If one district's count gets corrupted by a data-entry error, or one district happens to contain a freak local event, it can only throw off its own district average — and the median across 11 districts shrugs off one or two bad districts, as long as most districts are still telling the truth. Averaging every individual ballot nationally, by contrast, lets a single corrupted district bleed its error into the final number in direct proportion to how many ballots it contributed.

The estimator, one symbol at a time

Given nn data points, choose a number of groups kk (a design choice, often based on how much corruption or heavy-tailedness you expect) and split the data into kk roughly equal blocks of size n/kn/k. Compute the ordinary sample mean Xˉj\bar X_j within each block j=1,,kj = 1, \dots, k. The median-of-means estimator is

μ^MoM=median(Xˉ1,Xˉ2,,Xˉk).\hat\mu_{\text{MoM}} = \operatorname{median}\left(\bar X_1, \bar X_2, \dots, \bar X_k\right).

In plain English: instead of one giant average of everything, compute kk smaller averages and then take their middle value. Each block average Xˉj\bar X_j is itself a sum of n/kn/k points, so by the law of large numbers each one is already a reasonably good, roughly symmetric estimate of the true mean when n/kn/k isn't too small — and taking the median across kk such estimates means more than half the blocks would have to be badly corrupted or badly unlucky before the final answer moves much, which is a far stronger guarantee than what a single plain average offers.

Worked example 1: one corrupted block among five

Ten daily P&L observations, split into k=5k=5 blocks of 2: block averages come out $102, $98, $95, $101, and $5000 (the last block happened to include a data-feed glitch). The plain overall mean across all 10 points would be wildly distorted by that one glitch. The median-of-means estimator instead sorts the five block averages — $95, $98, $101, $102, $5000 — and takes the middle one: $101. One corrupted block out of five barely moved the final answer, because the median only cares about which block average sits in the middle, not how extreme the other four are.

Worked example 2: choosing k for a heavy-tailed return series

Suppose you're estimating the mean of a strategy's daily P&L, but the distribution has occasional huge tail days that make the plain sample mean's confidence interval unreliable (this is common with heavy-tailed return series). With n=200n = 200 days and k=20k = 20 blocks of 10 days each, you compute 20 block averages. If, say, 3 of those 20 blocks happen to contain an extreme tail day each, the plain overall mean is contaminated by all 3; the median of the 20 block averages, however, is unaffected as long as fewer than 10 of the 20 blocks (half) are extreme — a much more forgiving threshold, and the resulting confidence interval around the median-of-means estimate is provably tighter than the naive one when the underlying distribution has heavy tails.

\$95 \$98 \$101 ← median \$102 \$5000
Sorted block averages from five groups: the median (\$101) sits with the well-behaved majority, entirely unmoved by the one corrupted block averaging \$5000.

What this means in practice

Median-of-means is used when you need a mean estimate with guaranteed accuracy even under heavy tails or a bounded fraction of corrupted data, without assuming near-Gaussian behavior — it comes up in robust return-series analysis, distributed computing (each machine computes one block average), and as a building block in more advanced robust estimators for regression and covariance. Its main cost is losing some efficiency relative to the plain mean when the data really is well-behaved: fewer effective points feed the final answer, because each block only contributes one summary number.

Splitting data into groups, averaging each group, then taking the median of those averages gives a mean estimate that only a majority-corrupted dataset can meaningfully distort — trading a little efficiency on clean data for real protection against heavy tails or a bounded number of bad points.

The choice of kk (number of blocks) matters a lot and is easy to get wrong: too few blocks means each block average is barely more forgiving than the plain mean and one bad block can still be half of everything; too many blocks means each block average is itself computed from very few points and becomes noisy, undermining the assumption that each one is already a decent estimate. In practice kk should be chosen based on a rough prior belief about how many corrupted points or extreme tail events you expect, not picked arbitrarily or left at a software default.

Related concepts

Practice in interviews

Further reading

  • Lugosi and Mendelson (2019), Mean estimation and regression under heavy-tailed distributions
  • Nemirovsky and Yudin (1983), median-of-means origins
ShareTwitterLinkedIn