A robust estimator with a three-cutoff score that caps, then reduces, extreme residual contributions. Distinguish its score, weight, influence and local solutions.
Hampel estimator
A Hampel estimator is a robust M-estimator whose three-cutoff score first grows with a residual, then caps its contribution, and finally reduces that contribution to zero. For a quant estimating a typical return or execution deviation, an increasingly extreme observation can therefore exert less pull on the fitted centre. That choice changes the statistical target: a robust centre need not equal the population mean of an asymmetric return distribution.
Three cutoffs, four residual regions
Consider location estimation from observations x1,…,xn. Let θ be a candidate centre and s>0 a scale in the same units as the observations. The standardised residual is
This is an odd function: ψ(−u)=−ψ(u). Small residuals contribute as in least squares; intermediate residuals have a capped signed contribution; larger ones move down the descending segment; those at or beyond c contribute zero. The formula is continuous at every cutoff. The statsmodels score definition gives these four regions explicitly.
For fixed scale, write the loss as ρ(u)=∫0uψ(v)dv. A location estimate can be defined by minimising
L(θ)=i=1∑nρ(sxi−θ).
Its stationary points satisfy ∑iψ(ui)=0. Solving that equation alone does not identify the desired minimum. The descending score makes ρ nonconvex. The robustbase vignette defines both the score and its integrated loss.
Watch the contribution shrink
Use the illustrative cutoffs a=1.5, b=3 and c=4.5. They are chosen for transparent arithmetic, not for a claimed efficiency, breakdown point or recommended market-data filter.
Standardised residual u
Region
Score ψ(u)
Weight w(u)
0.5
Linear centre
0.5
1
2
Capped score
1.5
0.75
3.75
Descending score
0.75
0.2
5
Beyond rejection cutoff
0
0
For example, ψ(3.75)=1.5(4.5−3.75)/(4.5−3)=0.75. At the negative residuals −0.5,−2,−3.75,−5, the scores are −0.5,−1.5,−0.75,0 respectively.
Illustrative Hampel score and weight with thresholds 1.5, 3 and 4.5. Residuals 0.5, 2, 3.75 and 5 have scores 0.5, 1.5, 0.75 and 0; weights are 1, 0.75, 0.2 and 0. Negative scores have opposite signs, while weights are symmetric.
Original mathematical illustration. The upper panel shows signed score contributions; the lower panel shows weights. Thresholds are illustrative, not an efficiency calibration or a financial-data recommendation.
The iterative fitting weight is w(u)=ψ(u)/u for u=0, with w(0)=1 by continuity. A capped score is therefore a declining weight: at u=2, the contribution is 1.5, but the weight is 0.75. R's MASS documentation explicitly notes that its psi callback returns this ratio when requested in its weight mode; a function's name alone does not establish what it returns. See the argument contract.
Scale and starting point are part of the method
These cutoffs apply to standardised residuals, not raw percentage returns or dollar deviations. An inflated scale can move a questionable observation back into the central region. A robust scale, such as a suitably rescaled median absolute deviation, can limit that failure. A zero scale needs explicit treatment; division by zero is not an estimator. Fixing a scale from a preliminary fit and updating scale during iteration are different procedures and must be stated.
Nonconvexity also has a concrete cost. With the same cutoffs, fixed s=1 and synthetic observations −0.5,0,0.5,10, both θ=0 and θ=10 solve the score equation and are strict local minima. Their losses differ:
L(0)=4.75,L(10)=13.5.
Here ρ reaches its plateau at ρ(4.5)=4.5. At θ=0, the two half-unit residuals cost 0.125 each and the remote observation costs 4.5. At θ=10, three remote residuals each cost 4.5. Even θ=20 solves the score equation, because every residual is rejected, but its loss is 18 on a flat region. A tiny score residual is therefore insufficient evidence of a useful solution. Robust initialisation, comparison of candidate losses and convergence checks matter; the MASS fitting notes warn about multiple local minima.
Score, influence and filtering are different objects
The influence function measures an estimator's first-order response to infinitesimal contamination. It is not simply the plotted score. For a regular location functional with fixed s, satisfying the population score equation, let U=(X−θ)/s. When differentiation under expectation is valid and E[ψ′(U)]=0,
IF(x)=E[ψ′(U)]sψ((x−θ)/s).
The score supplies the shape; the model and its normalising denominator determine the sensitivity. An estimated scale can require a joint location-and-scale calculation. Atkinson and coauthors distinguish these cases. A bounded or redescending score alone is not a universal guarantee about finite contamination or which numerical solution an algorithm finds.
The Hampel identifier is a related usage of the name: it flags points far from a rolling median relative to a scaled rolling MAD. A Hampel filter replaces flagged points, typically with that local median, as in MathWorks' documentation. This window-based screening and replacement rule is distinct from fitting the three-part M-estimator above.
For financial data, a zero fitting contribution is not proof that a record is erroneous. Genuine tail losses may be central to the risk question even when a robust centre discounts them. Financial Return Characteristics develops the heavy-tail and volatility-clustering context; the public preview introduces the lesson, with full teaching requiring membership.