Week 13 — Robust inference, influence, and M-estimation

Where this week starts

Every procedure this course has built rests on something being exactly true: the exact tests of Week 4 need the sampling model to be the model, the three statistics of Week 5 need a smooth and correctly specified likelihood, the randomization tests of Week 10 need the randomization to have happened, and the rank procedures of Week 12 need only continuity but buy that by changing what is estimated. This week takes the case none of them addresses head on: the model is nearly right. Most observations behave exactly as it says and a small remainder does not, because a digit was transposed, an instrument drifted, or the tail is heavier than the model admits.

Week 12 left this half-finished. Rank procedures answer “what if I do not know the shape” by keeping only the ordering, which moves the estimand: the rank-sum test targets an exceedance probability, not a mean. Robust inference asks something narrower — keep the target roughly where it was, and make the procedure’s behaviour continuous in the underlying distribution, so a small perturbation of FF produces only a small perturbation of the estimate and its standard error.

The organizing move is to stop treating an estimator as a function of a sample and treat it as a function of a distribution. Once θ̂=T(Fn)\hat\theta = T(F_n) is a functional evaluated at the empirical distribution, you can differentiate TT in the direction of a contaminating point mass. That derivative is the influence function, and the rest follows: the asymptotic variance is the integral of its square, the damage one outlier can do is its supremum, and the estimating equation behind it is M-estimation, whose variance under a wrong model is the sandwich. By the end, “is this estimator robust” should have split into three questions — against which neighbourhood, at what cost in efficiency at the clean model, and for which functional.

Why this matters beyond the theorem

Here is the stake, in the smallest example that shows it. A laboratory records ten replicate readings of the same reference specimen, in coded units: 4,7,7,7,8,9,10,14,14,164, 7, 7, 7, 8, 9, 10, 14, 14, 16. The sample mean is 9.69.6 and the sample standard deviation 3.8643.864, so the standard error is 3.864/10=1.2223.864 / \sqrt{10} = 1.222 and the 9595 per cent tt interval, using the 0.9750.975 quantile 2.2622.262 of tt on nine degrees of freedom, is 9.6±2.262×1.222=(6.84,12.36)9.6 \pm 2.262 \times 1.222 = (6.84, 12.36). Now suppose the last reading, truly 1616, is typed as 6161. The mean becomes 14.114.1, the standard deviation 16.77616.776, the standard error 5.3055.305, and the interval 14.1±12.00=(2.10,26.10)14.1 \pm 12.00 = (2.10, 26.10) — over four times wider, and centred where no honest reading of the data puts it.

Nothing in the output announces the problem. The interval got wider, which reads as caution, so the mistake looks like a noisy instrument rather than overconfidence, and any decision calibrated to that precision is calibrated to a fiction produced by one keystroke. The lesson is not that outliers should be hunted and deleted. It is that a procedure whose output can be moved an unbounded distance by one of nn observations has an operating characteristic nobody stated — and that other procedures exist for which this corruption changes nothing at all.

What you will be able to do

  • Write an estimator as a statistical functional and compute its influence function as the derivative at a contaminating point mass, stating the differentiability that computation requires.
  • Derive the influence functions of the mean and the median at a stated distribution, and read the gross-error sensitivity and the asymptotic variance off them.
  • Compute breakdown points for the mean, the trimmed mean, the median, and a Huber estimator with fixed scale, and say what a breakdown point does and does not promise.
  • Define an M-estimator by its estimating equation, solve that equation numerically on a small sample, and identify the functional it targets when the assumed model is false.
  • Derive the sandwich variance, state the conditions under which it is valid, and explain why it repairs the standard error rather than the estimand.
  • Quantify the efficiency surrendered at the clean model in exchange for bounded influence.

Terms and notation worth fixing

Symbol or term Meaning as used in this course
FF, FnF_n the distribution generating the data, and the empirical distribution of X1,,XnX_1, \dots, X_n
T(F)T(F) a statistical functional: a number attached to a distribution. The plug-in estimator is T(Fn)T(F_n)
Fε=(1ε)F+εHF_\varepsilon = (1 - \varepsilon) F + \varepsilon H a gross-error neighbourhood: a fraction ε\varepsilon of the mass replaced by an arbitrary HH
δx\delta_x the distribution putting all its mass at the single value xx
IF(x;T,F)\mathrm{IF}(x; T, F) the influence function: the derivative of TT at FF in the direction of δx\delta_x
γ*\gamma^{*} gross-error sensitivity, supx|IF(x;T,F)|\sup_x \lvert \mathrm{IF}(x; T, F) \rvert: the worst first-order damage one observation can do
ε*\varepsilon^{*} breakdown point: the largest fraction of the sample that may be replaced arbitrarily while the estimate stays bounded
ψ\psi the estimating function. An M-estimator θ̂\hat\theta solves i=1nψ(Xi,θ)=0\sum_{i=1}^{n} \psi(X_i, \theta) = 0
AA, BB the sandwich ingredients A=EF[ψ/θ]A = -E_F[\partial \psi / \partial \theta] and B=EF[ψ2]B = E_F[\psi^2], both evaluated at the target value

Throughout, θ0\theta_0 means the value the estimating equation targets in the population, T(F)T(F), while d\overset{d}{\longrightarrow} and P\overset{P}{\longrightarrow} mean convergence in distribution and in probability — every limit below is asymptotic and says nothing by itself about n=10n = 10.

Contamination neighbourhoods and the influence function

Robustness is always robustness against a stated set of alternatives, and the standard set is Tukey’s gross-error model. Fix a central model FF — usually a normal — and a contamination fraction ε\varepsilon, and consider every Fε=(1ε)F+εHF_\varepsilon = (1 - \varepsilon) F + \varepsilon H with HH completely arbitrary; sampling from it is the same as flipping a coin with success probability ε\varepsilon per observation and drawing from HH when it lands. A procedure is robust over the neighbourhood if its behaviour degrades gracefully across the whole of it, and two summaries of “gracefully” are worth having: an infinitesimal one from differentiating at ε=0\varepsilon = 0, and a global one, the largest ε\varepsilon it survives.

From estimators to statistical functionals

A statistical functional is a rule TT carrying a distribution to a number: the mean μ(F)=ydF(y)\mu(F) = \int y \, dF(y), the median m(F)=F1(1/2)m(F) = F^{-1}(1/2) (well defined whenever FF is strictly increasing near that quantile), the variance σ2(F)=(yμ(F))2dF(y)\sigma^2(F) = \int (y - \mu(F))^2 \, dF(y). Substituting the empirical distribution FnF_n, which puts mass 1/n1/n at each observed value, recovers X\bar{X} and the sample median — the plug-in principle you met with the bootstrap in Week 11, to a different end.

The functional view earns its keep because it lets you ask something meaningless for a formula in x1,,xnx_1, \dots, x_n: what happens to the output if the input distribution is nudged? It also forces the distinction the week depends on. If the family {Fθ}\{F_\theta\} contains the truth and T(Fθ)=θT(F_\theta) = \theta for every θ\theta, the functional is Fisher consistent and the two notions of target agree. Outside the family T(F)T(F) still exists and the estimator still converges to it, but it is now whatever number the functional assigns to the true FF, and calling that “the parameter” is a choice to be defended rather than assumed.

Differentiating a functional at a point mass

Take the contaminating distribution to be a point mass at xx, so Fε=(1ε)F+εδxF_\varepsilon = (1 - \varepsilon) F + \varepsilon \delta_x, and differentiate at zero contamination. The influence function of TT at FF is

IF(x;T,F)=limε0T((1ε)F+εδx)T(F)ε,\mathrm{IF}(x; T, F) = \lim_{\varepsilon \downarrow 0} \frac{T\big((1 - \varepsilon) F + \varepsilon \delta_x\big) - T(F)}{\varepsilon},

when the limit exists. Read it as: if a vanishingly small fraction of the population were replaced by copies of xx, the functional would move at this rate per unit of contamination. Two consequences make it central. First, IF(y;T,F)dF(y)=0\int \mathrm{IF}(y; T, F) \, dF(y) = 0 whenever the derivative is linear in the contaminating direction, since contaminating FF by FF itself changes nothing; the influence function is therefore centred, like a score. Second, the von Mises expansion: under conditions strong enough to make the remainder negligible,

n(T(Fn)T(F))=1ni=1nIF(Xi;T,F)+nRn,\sqrt{n} \, \big(T(F_n) - T(F)\big) = \frac{1}{\sqrt{n}} \sum_{i=1}^{n} \mathrm{IF}(X_i; T, F) + \sqrt{n} \, R_n ,

so that if nRnP0\sqrt{n} \, R_n \overset{P}{\longrightarrow} 0 and IF2dF\int \mathrm{IF}^2 \, dF is finite, the central limit theorem gives

n(T(Fn)T(F))dN(0,IF(y;T,F)2dF(y)).\sqrt{n} \, \big(T(F_n) - T(F)\big) \overset{d}{\longrightarrow} N\!\left(0, \int \mathrm{IF}(y; T, F)^2 \, dF(y)\right).

State the conditions rather than waving at them. Differentiability along point-mass paths — Gateaux differentiability, which is exactly what the display above defines — is not by itself enough to kill the remainder, because FnF_n approaches FF along paths that are not of that form. What does the work is differentiability uniformly over the relevant class of directions, Hadamard differentiability, together with a square-integrable influence function. Where that fails, as for the sample maximum, the normal limit does not hold — the boundary case that broke the bootstrap in Week 11, for the same reason.

Gross-error sensitivity and the breakdown point

The influence function is local, so the natural local summary of danger is its supremum, γ*=supx|IF(x;T,F)|\gamma^{*} = \sup_x \lvert \mathrm{IF}(x; T, F) \rvert. A functional with finite γ*\gamma^{*} is bias-robust at FF: to first order in ε\varepsilon, no single contaminating value moves it more than εγ*\varepsilon \gamma^{*}. The mean, with infinite γ*\gamma^{*}, has no such bound.

Sensitivity says nothing about a contamination fraction that is not small. For that, use the finite-sample replacement breakdown point: the largest fraction m/nm/n such that, whatever values are substituted for any mm of the nn observations, the estimate stays bounded. The sample mean has breakdown 00, since one replaced observation carries it anywhere. The α\alpha-trimmed mean, which discards the fraction α\alpha at each tail before averaging, has breakdown αn/n\lfloor \alpha n \rfloor / n, tending to α\alpha; the median has (n1)/2/n\lfloor (n-1)/2 \rfloor / n, tending to 1/21/2. No translation-equivariant estimator beats one half, because at half contamination there is no way to tell which half is the model.

A line rising from the origin to one half, one half. A dot at the origin is labelled sample mean, a dot at the far end is labelled median, and a dashed horizontal line at one half marks the ceiling no equivariant estimator passes.

Breakdown fraction of the trimmed mean rises linearly with the amount trimmed, from the sample mean at zero to the median at one half.

Neither summary implies the other. A high breakdown point is no promise of small bias below breakdown: an estimator can survive 4040 per cent contamination and still be badly biased at 1010 per cent. And a bounded influence function promises nothing at ε=0.3\varepsilon = 0.3, being a statement about a derivative at zero.

M-estimators and the sandwich variance

Influence functions diagnose estimators; M-estimation constructs them. Define the estimator implicitly, as the root of an estimating equation, and choose that equation so the influence function comes out bounded. Everything about the result — its target, its influence function, its asymptotic variance, its computation — reads off the estimating function directly.

Estimating equations and the Huber psi function

An M-estimator θ̂\hat\theta is any root of

i=1nψ(Xi,θ̂)=0,\sum_{i=1}^{n} \psi(X_i, \hat\theta) = 0 ,

and when ψ=ρ/θ\psi = \partial \rho / \partial \theta for some ρ\rho, this is the stationarity condition for minimizing iρ(Xi,θ)\sum_i \rho(X_i, \theta). Three instances fix the idea: ρ(x,θ)=(xθ)2/2\rho(x, \theta) = (x - \theta)^2 / 2 gives ψ(x,θ)=xθ\psi(x, \theta) = x - \theta and the sample mean; ρ(x,θ)=|xθ|\rho(x, \theta) = \lvert x - \theta \rvert gives ψ(x,θ)=sign(xθ)\psi(x, \theta) = \mathrm{sign}(x - \theta) and the sample median, the equation being solved in the generalized sense of a sign change because ψ\psi is a step; and ρ\rho the negative log-likelihood gives ψ\psi equal to the score, so M-estimation contains Weeks 5 and 6 as a special case.

Huber’s proposal is the compromise between the first two. With a tuning constant k>0k > 0,

ρk(u)=12u2for |u|k,ρk(u)=k|u|12k2for |u|>k,\rho_k(u) = \tfrac{1}{2} u^2 \quad \text{for } \lvert u \rvert \le k, \qquad \rho_k(u) = k \lvert u \rvert - \tfrac{1}{2} k^2 \quad \text{for } \lvert u \rvert > k ,

whose derivative is the clipped identity

ψk(u)=ufor |u|k,ψk(u)=ksign(u)for |u|>k.\psi_k(u) = u \quad \text{for } \lvert u \rvert \le k, \qquad \psi_k(u) = k \, \mathrm{sign}(u) \quad \text{for } \lvert u \rvert > k .

The pieces meet so that ρk\rho_k is continuously differentiable at |u|=k\lvert u \rvert = k: both one-sided derivatives equal kk and both expressions give k2/2k^2/2. Squared error near the centre, absolute error in the tails.

Two panels. On the left the squared-error parabola and the Huber loss coincide near zero and separate beyond k, where the Huber loss goes linear. On the right the identity line and the Huber psi function, which flattens at plus or minus k.

The Huber loss follows the parabola near zero and becomes linear beyond the tuning constant, so its derivative is flat past that point.

The functional an M-estimator targets is the root θ0=T(F)\theta_0 = T(F) of ψ(y,θ)dF(y)=0\int \psi(y, \theta) \, dF(y) = 0, assumed unique. Differentiating that relation as before gives every M-estimator’s influence function in one line:

IF(x;T,F)=ψ(x,θ0)A,A=ψθ(y,θ0)dF(y).\mathrm{IF}(x; T, F) = \frac{\psi(x, \theta_0)}{A}, \qquad A = -\int \frac{\partial \psi}{\partial \theta}(y, \theta_0) \, dF(y) .

An M-estimator’s influence function is its own ψ\psi, rescaled: bounded ψ\psi means bounded influence, and that sentence is the design principle of the whole subject. For the mean, ψ/θ=1\partial \psi / \partial \theta = -1 gives A=1A = 1 and IF(x)=xμ\mathrm{IF}(x) = x - \mu. For the Huber ψ\psi, ψk\psi_k' is one on the interior and zero outside, so A=PF(|Xθ0|k)A = P_F(\lvert X - \theta_0 \rvert \le k) provided FF puts no mass at θ0±k\theta_0 \pm k, and γ*=k/A\gamma^{*} = k / A, finite for every finite kk. When ψ\psi jumps, read AA off the population function instead of pointwise: for the median ψ/θ\partial \psi / \partial \theta is zero almost everywhere, which would give A=0A = 0, yet λ(θ)=EFsign(Xθ)=12F(θ)\lambda(\theta) = E_F \, \mathrm{sign}(X - \theta) = 1 - 2 F(\theta) gives A=λ(m)=2f(m)A = -\lambda'(m) = 2 f(m) and the influence function sign(xm)/(2f(m))\mathrm{sign}(x - m) / (2 f(m)) derived from scratch below.

The tuning constant is the price list: small kk approaches the median, large kk the mean. The table reports asymptotic variances of n(θ̂θ0)\sqrt{n}(\hat\theta - \theta_0) with σ=1\sigma = 1, computed from E[ψ2]/(E[ψ])2E[\psi^2] / (E[\psi'])^2 at each distribution; the clean-normal entries for the mean and median are the exact values 11 and π/2\pi/2, the rest numerical evaluations of the same integrals.

Estimator at the exact normal at 0.9N(0,1)+0.1N(0,9)0.9 \, N(0,1) + 0.1 \, N(0,9)
sample mean 1.001.00 1.801.80
Huber, k=1.345k = 1.345 1.051.05 1.301.30
sample median 1.571.57 1.801.80

Read the columns together, because either alone misleads. At the clean model the mean wins and the median needs about 5757 per cent more observations to match it; under ten per cent contamination by a distribution three times as spread out, the mean and median are essentially tied and the Huber estimator beats both. Nothing is uniformly best — the risk-function situation of Week 1, with the neighbourhood playing the part of the parameter space.

The sandwich, its conditions, and what it does not repair

Expand the estimating equation about θ0\theta_0. Writing ψi(θ)=ψ(Xi,θ)\psi_i(\theta) = \psi(X_i, \theta) and assuming θ̂Pθ0\hat\theta \overset{P}{\longrightarrow} \theta_0,

0=1ni=1nψi(θ̂)=1ni=1nψi(θ0)+(1ni=1nψi(θ0))n(θ̂θ0)+oP(1),0 = \frac{1}{\sqrt{n}} \sum_{i=1}^{n} \psi_i(\hat\theta) = \frac{1}{\sqrt{n}} \sum_{i=1}^{n} \psi_i(\theta_0) + \left( \frac{1}{n} \sum_{i=1}^{n} \psi_i'(\theta_0) \right) \sqrt{n} \, (\hat\theta - \theta_0) + o_P(1) ,

and since the bracket converges in probability to A-A, while the first term has mean zero by the very definition of θ0\theta_0 and so obeys the central limit theorem, rearranging gives

n(θ̂θ0)dN(0,A1BA1),B=ψ(y,θ0)2dF(y).\sqrt{n} \, (\hat\theta - \theta_0) \overset{d}{\longrightarrow} N\!\left(0, A^{-1} B A^{-1}\right), \qquad B = \int \psi(y, \theta_0)^2 \, dF(y) .

The conditions, each of which can fail: θ0\theta_0 is the unique root of ψ(y,θ)dF(y)=0\int \psi(y, \theta) \, dF(y) = 0, so the target is identified; θ̂\hat\theta is consistent for it, which for a monotone ψ\psi follows from the monotonicity and otherwise has to be established separately, usually by a uniform law of large numbers for n1iψ(Xi,θ)n^{-1} \sum_i \psi(X_i, \theta) together with identification of the root, which is how redescending ψ\psi functions are handled; ψ(x,)\psi(x, \cdot) is differentiable near θ0\theta_0 for FF-almost every xx, with a derivative dominated there by an integrable function; A0A \ne 0; and B<B < \infty. The Huber ψ\psi is not differentiable at ±k\pm k, so the pointwise expansion above is unavailable; the standard repair expands the population function λ(θ)=ψk(yθ)dF(y)\lambda(\theta) = \int \psi_k(y - \theta) \, dF(y), differentiable as soon as FF has a density near θ0±k\theta_0 \pm k, and controls the empirical remainder by an equicontinuity argument. The limit is unchanged, but the reasoning is not the one written above.

Estimate both ingredients by plugging in:

Â=1ni=1nψθ(Xi,θ̂),B̂=1ni=1nψ(Xi,θ̂)2,\hat{A} = -\frac{1}{n} \sum_{i=1}^{n} \frac{\partial \psi}{\partial \theta}(X_i, \hat\theta), \qquad \hat{B} = \frac{1}{n} \sum_{i=1}^{n} \psi(X_i, \hat\theta)^2 ,

so the estimated variance of θ̂\hat\theta is Â1B̂Â1/n\hat{A}^{-1} \hat{B} \hat{A}^{-1} / n, the name coming from the matrix version in which BB is the meat between two slices of A1A^{-1}. Now the punchline. If the model is correct and ψ\psi is its score, the information equality — itself requiring the regularity that permits differentiating under the integral sign — gives A=B=I(θ0)A = B = I(\theta_0) and the sandwich collapses to I(θ0)1I(\theta_0)^{-1}, the usual maximum likelihood variance. When the model is wrong that equality fails and only the sandwich is right.

A flat dashed line at 0.32 labelled model-based, and a rising curve labelled sandwich passing through 0.32, 0.45, 0.55 and 0.63 as the ratio of true variance to mean goes from one to four.

Model-based and sandwich standard errors separate as the true variance departs from the variance the model assumes.

The figure is the simplest exact instance. A count response is modelled as Poisson with mean μ=5\mu = 5 and n=50n = 50, so the score equation is the one defining the sample mean, but the true variance is τμ\tau \mu for a dispersion τ1\tau \ge 1. The model-based standard error is μ/n=5/50=0.32\sqrt{\mu / n} = \sqrt{5/50} = 0.32 whatever τ\tau is, while the sandwich returns τμ/n=0.32τ\sqrt{\tau \mu / n} = 0.32 \sqrt{\tau}: 0.450.45 at τ=2\tau = 2 and 0.630.63 at τ=4\tau = 4, so the model-based width is out by a factor of two at τ=4\tau = 4.

Note

Here the sandwich repaired the standard error and the estimand survived, because the Poisson score equation targets the mean whatever the variance is. That is the favourable case, not the general one. In a logistic regression with an omitted covariate, the fitted coefficient targets a marginal log-odds ratio that generally differs from the conditional one the model was written to describe, and the sandwich gives an impeccable standard error for a quantity nobody set out to estimate.

Worked example — influence functions for the mean and the median

Let X1,,XnX_1, \dots, X_n be independent with distribution FF whose density ff is continuous and strictly positive near its median mm, so that mm is the unique solution of F(m)=1/2F(m) = 1/2. Compare the influence functions of the mean and median functionals at this FF, then check the comparison against the ten laboratory readings from the top of the page.

Step 1: the mean, exactly. The mean functional is linear in FF, so μ(Fε)=(1ε)μ+εx\mu(F_\varepsilon) = (1 - \varepsilon) \mu + \varepsilon x and the difference quotient is xμx - \mu for every ε\varepsilon, not only in the limit. Hence IF(x;μ,F)=xμ\mathrm{IF}(x; \mu, F) = x - \mu, which grows without bound in |x|\lvert x \rvert, so γ*=\gamma^{*} = \infty.

Step 2: the median, implicitly. The contaminated median satisfies Fε(mε)=1/2F_\varepsilon(m_\varepsilon) = 1/2, that is (1ε)F(mε)+ε𝟏{xmε}=1/2(1 - \varepsilon) F(m_\varepsilon) + \varepsilon \, \mathbf{1}\{x \le m_\varepsilon\} = 1/2. Fix xmx \ne m, so the indicator is locally constant in ε\varepsilon, and differentiate at ε=0\varepsilon = 0 using F(m)=1/2F(m) = 1/2 and continuity of ff at mm:

F(m)+f(m)m(0)+𝟏{xm}=0m(0)=1/2𝟏{xm}f(m).-F(m) + f(m) \, m'(0) + \mathbf{1}\{x \le m\} = 0 \quad \Longrightarrow \quad m'(0) = \frac{1/2 - \mathbf{1}\{x \le m\}}{f(m)} .

For x>mx > m the indicator is zero and the derivative is 1/(2f(m))1 / (2 f(m)); for x<mx < m it is 1/(2f(m))-1 / (2 f(m)). Hence IF(x;m,F)=sign(xm)/(2f(m))\mathrm{IF}(x; m, F) = \mathrm{sign}(x - m) / (2 f(m)) and γ*=1/(2f(m))\gamma^{*} = 1 / (2 f(m)), finite. Notice where the conditions do their work: if f(m)=0f(m) = 0 the derivative blows up, and if FF has an atom at mm the implicit relation is not differentiable at all. Bounded influence for the median is a property of FF as much as of the median.

Step 3: what the two say about variance. Squaring and integrating gives (yμ)2dF=σ2\int (y - \mu)^2 dF = \sigma^2 for the mean, reproducing the central limit theorem, and 1/(4f(m)2)1 / (4 f(m)^2) for the median. At N(θ,σ2)N(\theta, \sigma^2), f(m)=1/(σ2π)f(m) = 1 / (\sigma \sqrt{2\pi}), so the median’s asymptotic variance is πσ2/21.571σ2\pi \sigma^2 / 2 \approx 1.571 \sigma^2 and its sensitivity is σ2π/21.253σ\sigma \sqrt{2\pi} / 2 \approx 1.253 \sigma; the asymptotic relative efficiency of the median to the mean at the normal is 2/π0.6372/\pi \approx 0.637.

Three curves against the position of a contaminating observation: the mean's influence is a diagonal line with no ceiling, the median's is a step flat at plus or minus 1.25, and the Huber estimator's flattens at plus or minus 1.64.

Influence functions of the mean, the median, and the Huber estimator at the standard normal model.

Step 4: the same contrast on ten numbers. Replacing one observation of nn by a value xx changes the sample mean by exactly (xxold)/n(x - x_{\text{old}}) / n, which for the transposed digit is (6116)/10=4.5(61 - 16)/10 = 4.5: the mean moves from 9.69.6 to 14.114.1, the unbounded linear response the influence function predicts. The sample median is 8.58.5 before and after, because the fifth and sixth ordered values, 88 and 99, were not touched.

What this licenses: a quantitative statement of how far one contaminating value can move each estimator, and a variance comparison at any FF where f(m)f(m) is known. What it does not license: any claim that the median is “better”. At the clean normal it is nearly 5757 per cent more expensive in sample size, and the sample median at finite nn is a non-smooth function of the data, depending on only one or two order statistics rather than on all of them the way the influence-function expansion suggests.

The same reasoning, transferred

Run the identical derivation at a skewed model. Let X1,,XnX_1, \dots, X_n be exponential with rate λ\lambda, so f(y)=λeλyf(y) = \lambda e^{-\lambda y} for y>0y > 0. The median solves 1eλm=1/21 - e^{-\lambda m} = 1/2, giving m=log2/λm = \log 2 / \lambda, and the density there is f(m)=λeλm=λ/2f(m) = \lambda e^{-\lambda m} = \lambda / 2. Substituting into the formula from Step 2 gives IF(x;m,F)=sign(xm)/λ\mathrm{IF}(x; m, F) = \mathrm{sign}(x - m) / \lambda, so γ*=1/λ\gamma^{*} = 1/\lambda and the median’s asymptotic variance is 1/(4f(m)2)=1/λ21 / (4 f(m)^2) = 1/\lambda^2. For the mean, IF(x)=x1/λ\mathrm{IF}(x) = x - 1/\lambda with infinite sensitivity and asymptotic variance Var(X)=1/λ2\mathrm{Var}(X) = 1/\lambda^2.

What stayed the same is the argument: differentiate the defining relation, evaluate the density at the target, read off the two summaries. What changed is decisive. The two functionals no longer agree — the mean is 1/λ1/\lambda, the median 0.693/λ0.693/\lambda, a factor of 1/log21.441/\log 2 \approx 1.44 apart — so switching to the median does not estimate the same quantity more safely, it estimates a different quantity. And the median buys no variance reduction here, both asymptotic variances being 1/λ21/\lambda^2; the entire gain is bounded influence. At an asymmetric model the choice of functional is a modelling decision, not a technical safeguard.

Second worked example — a Huber estimate on a contaminated sample

Take the corrupted readings x=(4,7,7,7,8,9,10,14,14,61)x = (4, 7, 7, 7, 8, 9, 10, 14, 14, 61) and fit the Huber location estimator with the scale held fixed, which is what makes the arithmetic checkable by hand. The scale comes from a preliminary high-breakdown estimate: the median absolute deviation of these readings about their median is 1.51.5, the same before and after the corruption, so the consistency-corrected scale is 1.5/0.6745=2.221.5 / 0.6745 = 2.22 and the standard tuning gives k=1.345×2.22=2.99k = 1.345 \times 2.22 = 2.99. Round it to k=3k = 3 in the measurement’s own units, treat it as fixed, and solve

i=110ψ3(xiθ)=0.\sum_{i=1}^{10} \psi_3(x_i - \theta) = 0 .

Step 1: an iteration you can run by hand. Adding θ\theta to each clipped residual puts the estimating equation in fixed-point form: θ(m+1)=θ(m)+1niψ3(xiθ(m))\theta^{(m+1)} = \theta^{(m)} + \frac{1}{n} \sum_i \psi_3(x_i - \theta^{(m)}), which is the mean of the readings winsorized — pulled in — to the window [θ(m)3,θ(m)+3][\theta^{(m)} - 3, \theta^{(m)} + 3]. From θ(0)=8.5\theta^{(0)} = 8.5, the median, the iterates are 8.88.8, 8.928.92, 8.9688.968, 8.98728.9872, 8.994888.99488.

Step 2: solve it exactly instead. From the first step onward the classification never changes: one reading (44) sits below the window, six (7,7,7,8,9,107, 7, 7, 8, 9, 10) inside, three (14,14,6114, 14, 61) above. There the update is the affine map θ[(θ3)+48+3(θ+3)]/10=0.4θ+5.4\theta \mapsto [(\theta - 3) + 48 + 3(\theta + 3)]/10 = 0.4 \theta + 5.4, whose unique fixed point is θ̂=9.0\hat\theta = 9.0. Confirm it directly: at θ=9\theta = 9 the values of ψ3(xi9)\psi_3(x_i - 9) are 3,2,2,2,1,0,1,3,3,3-3, -2, -2, -2, -1, 0, 1, 3, 3, 3, summing to zero. The contraction factor 0.40.4 is exactly 1Â1 - \hat{A} with Â=6/10\hat{A} = 6/10, which is why the plain iteration converges steadily but not quickly.

Step 3: compare the four estimates. On the corrupted data the sample mean is 14.114.1, the median 8.58.5, the ten per cent trimmed mean 9.59.5, the Huber estimate 9.09.0. Repeat on the uncorrupted readings, whose last value is 1616: mean 9.69.6, median 8.58.5, trimmed mean 9.59.5, and Huber estimate again 9.09.0 — because 1616 and 6161 both lie beyond θ̂+k=12\hat\theta + k = 12 and clip to the same +3+3. The estimating function cannot tell them apart, which is the whole design.

Two number lines carrying the same nine readings. On the clean line the mean sits at 9.6, the Huber estimate at 9.0 and the median at 8.5; on the corrupted line only the mean moves, jumping to 14.1 as the tenth reading leaves the scale.

The same ten readings before and after one digit transposition, with the mean, median, and Huber estimate marked on each.

Step 4: a standard error that survives too. With θ̂=9\hat\theta = 9 and k=3k = 3 the squared clipped residuals are 9,4,4,4,1,0,1,9,9,99, 4, 4, 4, 1, 0, 1, 9, 9, 9, summing to 5050, so B̂=5.0\hat{B} = 5.0; six of the ten readings lie strictly within 33 of θ̂\hat\theta, so Â=0.6\hat{A} = 0.6. Then Â1B̂Â1=5.0/0.36=13.89\hat{A}^{-1} \hat{B} \hat{A}^{-1} = 5.0 / 0.36 = 13.89 and the standard error of θ̂\hat\theta is 13.89/10=1.18\sqrt{13.89 / 10} = 1.18, giving the approximate interval 9.0±1.96×1.18=(6.69,11.31)9.0 \pm 1.96 \times 1.18 = (6.69, 11.31) against the corrupted-data tt interval (2.10,26.10)(2.10, 26.10). On the uncorrupted readings every one of those numbers is identical, since 1616 and 6161 clip to the same value.

psi <- function(u, k) pmax(-k, pmin(u, k))

huber_location <- function(x, k, start = median(x), tol = 1e-12) {
  theta <- start
  repeat {
    step <- mean(psi(x - theta, k))
    theta <- theta + step
    if (abs(step) < tol) break
  }
  theta
}

sandwich_se <- function(x, theta, k) {
  meat  <- mean(psi(x - theta, k)^2)
  bread <- mean(abs(x - theta) < k)
  sqrt(meat / bread^2 / length(x))
}

x <- c(4, 7, 7, 7, 8, 9, 10, 14, 14, 61)
huber_location(x, k = 3)            # 9
sandwich_se(x, theta = 9, k = 3)    # 1.1785

What this licenses: an estimate and an interval for the Huber functional of FF that a single gross error cannot move, and a diagnostic — the gap between 9.09.0 and 14.114.1 — that flags the corruption without anyone deleting a number. What it does not license: the 1.961.96 is an asymptotic quantile used at n=10n = 10 and B̂\hat{B} is a noisy average of ten terms, so the interval is optimistic; the Huber functional equals the mean of FF only when FF is symmetric about it, so under one-sided contamination the estimate is a boundedly biased version of the clean mean; and Â\hat{A} needs a convention when a residual falls exactly at ±k\pm k, though here none does.

The misreading to avoid

The sentence to dismantle gets written in methods sections every week: “we used robust standard errors, so misspecification is not a concern.” Put more carefully — “the sandwich estimator is consistent under misspecification” — it is true and still leads to the same mistake, because the phrase quietly omits consistent for what.

The correct version. The M-estimator converges to θ0\theta_0, the root of ψ(y,θ)dF(y)=0\int \psi(y, \theta) \, dF(y) = 0 under the true FF, and the sandwich gives a valid standard error for that θ0\theta_0. If the model is right, θ0\theta_0 is the parameter you wanted. If the model is wrong, θ0\theta_0 is whatever the estimating equation defines at the true FF — for a likelihood score, the value minimizing Kullback-Leibler divergence from FF to the model family — and a valid standard error for the wrong quantity is not a repair. The sandwich fixes the variance, not the estimand. The overdispersed-Poisson case is benign only because the estimand happens to survive; the omitted-covariate logistic case is not, and the two outputs look identical.

A second misreading rides along: “robust methods are strictly safer, so use them by default.” Robustness is a purchase, not a discount, and the table above prices it — about 5757 per cent more sample size for the median at an exactly normal model, about five per cent for a well-tuned Huber estimator. A third variant substitutes deletion for estimation: find the outlier, drop it, run the tt procedure, and report a standard error computed as though the deletion had not been a data-dependent choice. That is the selective-inference error of Week 9 in new clothing.

Finally, “distribution-free” and “robust” are not synonyms, and neither means assumption-free. The M-estimator here still assumes independence, still needs a scale, still needs a unique root, and still reports an asymptotic approximation. Robustness buys insensitivity to one stated departure — contamination of the central model — and nothing else comes free with it.

Practice on your own

  1. Derive the influence function of the variance functional σ2(F)=(yμ(F))2dF(y)\sigma^2(F) = \int (y - \mu(F))^2 dF(y) at a distribution with finite fourth moment, by writing σ2(Fε)\sigma^2(F_\varepsilon) out and differentiating at ε=0\varepsilon = 0. Check that it integrates to zero under FF, and say what its growth in xx implies for the sample standard deviation, which moves from 3.8643.864 to 16.77616.776 between the two samples above.
  2. Compute the finite-sample replacement breakdown point of the midrange (x(n)+x(1))/2(x_{(n)} + x_{(1)})/2 and of the twenty per cent trimmed mean at n=10n = 10. Then construct a distribution and a contamination fraction of 0.10.1 at which the trimmed mean, despite its healthy breakdown point, is worse than that number alone would suggest.
  3. Take XX normal with mean θ\theta and known variance σ2\sigma^2, and ψ(x,θ)=(xθ)/σ2\psi(x, \theta) = (x - \theta)/\sigma^2, the score. Show A=B=1/σ2A = B = 1/\sigma^2, so the sandwich collapses to σ2\sigma^2. Now let the data have variance τ2σ2\tau^2 \ne \sigma^2 with ψ\psi unchanged: recompute AA and BB, and confirm the sandwich returns τ2\tau^2 while the model-based variance still reports σ2\sigma^2.
  4. Re-solve the estimating equation of the second worked example by hand with k=1.5k = 1.5 instead of k=3k = 3. Can you predict from the shape of ψk\psi_k, before computing, which way the estimate moves?
  5. Run the contamination study below and compare its columns against the asymptotic variances tabulated earlier. Then repeat with the contaminating component shifted rather than widened, using rnorm(n, mean = 8) for the contaminated draws, and explain why the ordering changes.
set.seed(2027)
draw <- function(n, eps, spread) {
  bad <- rbinom(n, 1, eps)
  rnorm(n, mean = 0, sd = ifelse(bad == 1, spread, 1))
}
one_run <- function(n, eps, spread) {
  z <- draw(n, eps, spread)
  c(mean = mean(z), trimmed = mean(z, trim = 0.1),
    median = median(z), huber = huber_location(z, k = 1.345))
}
study <- replicate(4000, one_run(50, 0.10, 3))
50 * apply(study, 1, var)   # compare with the asymptotic variances in the table

Where to read more

  • The asymptotic machinery behind M-estimation — estimating equations, the delta method, and the sandwich — is developed at graduate level in MIT OpenCourseWare 18.655 Mathematical Statistics, the natural place to see the regularity conditions written out in full.
  • For the fundamentals this week perturbs — the sample mean, its standard error, and the tt interval whose fragility opened the unit — see Penn State STAT 415.
  • The optional Hogg, McKean, and Craig alignment for this week is Chapter 10.6 through 10.9. The book is optional and never required for this course; availability and licence terms for every source listed here remain unconfirmed.
  • Computing needs nothing beyond The R Project for Statistical Computing and Quarto; every block on this page runs in base R and stats.
  • Course pages: the notes overview, the syllabus, the schedule, and the resources page.

Where this goes next

The last piece of this week is a bridge you have half-built already. Choosing a procedure by how badly it can behave across a whole neighbourhood, rather than by how well it behaves at one distribution, is a minimax argument: the neighbourhood plays the part the parameter space plays in Week 1’s risk functions, and Huber’s original result was that his estimator minimizes the maximum asymptotic variance over a gross-error neighbourhood of the normal. Week 14 takes that home — Bayes rules as minimizers of posterior expected loss, admissibility, minimaxity through least-favourable priors, and the Stein phenomenon. Influence functions will not appear there, but the habit of judging an estimator by a whole risk curve rather than one number will.

Carry two threads forward. As soon as a procedure is defined by an estimating equation rather than by a model, you owe the reader a statement of which functional it targets; and every robustness gain is paid for in efficiency at the clean model, at a price computable in advance. Both return in Week 15, where one target is worked five ways with the rank-based route among them. If the influence-function derivations felt like sleight of hand, revisit the plug-in of Week 11, and use the notes overview to see where this unit sits after Week 12.