# Existence of a Smoothed Median Function

The median of a finite set of data depends on the data in a continuous, but non-smooth way; this can be demonstrated by considering the median of the data set $$\{ 0, 1, x \}$$ as $$x$$ varies.

I wanted to know whether people have derived median-like statistics which depend smoothly on the data. By median-like, I mean roughly that

• they recover location parameters,
• they have some level of robustness associated to them, and ideally,
• they recover the median in some limit.

For example, it would be nice to have a parametrised family of functions $$\{ \text{med}_\varepsilon \}_{\varepsilon > 0}$$ which are each median-like, and such that as $$\varepsilon \to 0$$, one has that $$\text{med}_\varepsilon ( \mathcal{D} ) \to \text{median} ( \mathcal{D} )$$.

To clarify: I am particularly interested in knowing whether this exists in the literature already. If people have their own ideas for how to derive statistics with these properties, I'll gladly hear them out, but I would prefer to hear about tried-and-tested ideas.

• There is a huge number of such statistics: accounts can be found by searching for robust or resistant statistics.
– whuber
Commented Oct 9, 2019 at 12:57
• @whuber could you recommend a search term which would help to emphasise that I'm interested in the smooth dependence of the statistic on the data? A cursory google of `smooth robust statistics' wasn't particularly useful in this regard.
– πr8
Commented Oct 9, 2019 at 20:19
• I"m having a hard time thinking of any such statistics that aren't smooth. That's not to say there aren't, but only to suggest that searching broadly for resistant or robust statistical estimators is likely to produce many examples of smooth ones in the sense you describe. Another search term would be "order statistic," because many of these estimators are functions of order statistics.
– whuber
Commented Oct 9, 2019 at 21:41
• @πr8 You may want to look at empirical influence functions of robust estimators; in particular you may find those for commonly used M-estimators do what you want. Commented Oct 10, 2019 at 1:04

Two standard families that do what you're asking for are Huber's M-estimators and (symmetrically) trimmed means. Trimmed means trim a percentage of $$\alpha$$ largest and smallest observations and take the mean of the rest. $$\alpha=0$$ gives the mean and $$\alpha$$ approaching 50% converges to the median.
Huber's M-estimators are implicitly defined as minimising $$\sum_{i=1}^n\rho(x_i,\theta)$$ over $$\theta$$. The mean is obtained by $$\rho(x,\theta)=(x-\theta)^2$$, the median by $$\rho(x,\theta)=|x-\theta|$$. Huber proposed $$\rho$$-functions that behave like squares around zero and like the absolute value outside some interval $$[-c,c]$$ (with standardisation so that the whole thing is continuous). These are another "bridge" between means and medians and have a number of optimality features for distributions "close" but not equal to the normal distribution, as can be found in the Robust Statistics literature. The choice of $$[-c,c]$$ in practice depends on the scaling of the data, and $$\rho$$ is often chosen as function of $$\frac{|x-\theta|}{MAD}$$, where MAD is the median absolute deviation from the median.
• The MAD can be non-smooth as the median, so it'll be non-smooth with MAD-scaling. Without scaling Huber's M-estimator is smooth as far as I know (I don't think it's difficult to prove but I won't do it; it also depends on what degree of smoothness you want), however if $[-c,c]$ is chosen too small it will behave pretty much as the median and smoothness around $\theta$ will only formally help. There are smooth ways of standardising, but these are more complex. Commented Oct 9, 2019 at 22:47
• Note that in the literature there is a "smoothed version" of Huber's M, see here: stat.ethz.ch/~stahel/hampel/HamFHR11.pdf. However "smoothness" there refers to $\psi=\rho'$ rather than smoothness in the observations, which is related, though. Commented Oct 9, 2019 at 22:50