# Trimmed sample means for robust uniform mean estimation and regression

Roberto I. Oliveira, Lucas Resende

<figure><img src="image_1.png" /></figure>

## To cite this version:

Roberto I. Oliveira, Lucas Resende. Trimmed sample means for robust uniform mean estimation and regression. Annals of Statistics, 2025, 53 (5), pp.2153-2178. 10.1214/25-AOS2536. hal-05415121

HAL Id: hal-05415121

https://hal.science/hal-05415121v1

Submitted on 13 Dec 2025

HAL is a multi-disciplinary open access
archive for the deposit and dissemination of sci-
entific research documents, whether they are pub-
lished or not. The documents may come from
teaching and research institutions in France or
abroad, or from public or private research centers.

L'archive ouverte pluridisciplinaire HAL, est
destinée au dépôt et à la diffusion de documents
scientifiques de niveau recherche, publiés ou non,
émanant des établissements d'enseignement et de
recherche français ou étrangers, des laboratoires
publics ou privés.

<figure><img src="image_2.png" /></figure>
# TRIMMED SAMPLE MEANS FOR ROBUST UNIFORM MEAN ESTIMATION AND REGRESSION

Roberto I. Oliveira
IMPA

Rio de Janeiro, Brazil
rimfo@impa.br

Lucas Resende
IMPA

Rio de Janeiro, Brazil
lucas.resende@impa.br

April 16, 2025

## ABSTRACT

It is well-known that trimmed sample means are robust against heavy tails and data contamination. This paper analyzes the performance of trimmed means and related methods in two novel contexts. The first one consists of estimating expectations of functions in a given family, with uniform error bounds; this is closely related to the problem of estimating the mean of a random vector under a general norm. The second problem considered is that of regression with quadratic loss. In both cases, trimmed-mean-based estimators are the first to obtain optimal dependence on the (adversarial) contamination level. Moreover, they also match or improve upon the state of the art in terms of heavy tails. Experiments with synthetic data show that a natural “trimmed mean linear regression” method often performs better than both ordinary least squares and alternative methods based on median-of-means.

**Keywords** Sub-Gaussian estimators · Robust estimators · Regression.

## 1 Introduction

The sample mean is probably the most fundamental way of aggregating information in Statistics [1]. Mathematically, it can be understood as a way to approximate an expected value from a random sample. Aspects of this approximation, including its convergence for large sample sizes, are described by the Law of Large Numbers and various Limit Theorems.

In practice, sample means are often directly to estimate population parameters that correspond to expectations: means, (co)variances and other moments are natural examples. A second use is in M-estimation. If a population parameter can be expressed as a minimizer of

$$L_P(\theta) := \mathbb{E}_{X \sim P} \ell(X, \theta) \quad (\theta \in \Theta) \qquad (1)$$

for some suitable function $\ell$, it is natural to estimate this parameter by minimizing

$$\hat{L}_n(\theta) := \frac{1}{n} \sum_{i=1}^{n} \ell(X_i, \theta) \quad (\theta \in \Theta) \qquad (2)$$

instead, where $(X_1, \dots, X_n)$ is a random sample from P. A related setting is “statistical learning,” where the goal is to find a near minimizer of $L_P$. One way to do this is to minimize the sample loss (2) instead: this is the well-known procedure of empirical risk minimization.

In all of the above cases, sample means are used because as sample-based approximations of the corresponding expectations. However, these are often not the best such approximations. For instance, a single outlier can change the value of the sample mean arbitrarily. Robust Statistics [2, 3] takes this issue as its starting point, and designs estimators that can withstand a proportion of outliers.
More subtly, the sample mean is also not optimal in terms of a phenomenon not captured by classical (asymptotic) Robust Statistics: its fluctuations over finite samples can be suboptimal. Consider, for instance, the basic problem of estimating the expectation of a one-dimensional random variable with unit variance. Asymptotically, the sample mean is Gaussian, but Catoni's seminal work [4] showed its non-asymptotic bounds are much worse (as Chebyshev's inequality is essentially optimal). What is really striking is that there are other, less obvious estimators with so-called "sub-Gaussian" finite-sample error bounds [4, 5, 6]. Some of these estimators can also be made robust to contamination [7].

Catoni's discovery led to a surge of interest in finite-sample mean estimation for vectors [8, 9, 10, 11, 12, 13], matrices [14, 15, 16] and other objects under (relatively) heavy tails and contamination [17], and also on computationally efficient methods with these properties [7, 18, 19]; see §1.3 for more on related work.

Many of the above papers look at adversarial contamination of the data. The idea is to obtain estimators that work well even when a small portion of the sample is manipulated arbitrarily. This is a less favorable model for outliers than the Huber contamination model from classical Robust Statistics. We compare and contrast the two models in the end of §1.3. For now, we simply notice that the sample mean is extremely vulnerable to contamination in either sense.

## 1.1 The trimmed mean

In this paper, we show that classical idea of trimmed means allows us to deal both with heavy-tailed finite samples and with adversarial contamination.

Suppose one is given $x_{1:n} = (x_1, \dots, x_n) \in \mathbf{X}^n$ and a function $f: \mathbf{X} \to \mathbb{R}$. If the $x_i$ are distributed according to a probability distribution $P$ over $\mathbf{X}$, the sample mean corresponds to the following approximation:

$$Pf = \mathbb{E}_{X \sim P} f(X) \approx \frac{1}{n} \sum_{i=1}^{n} f(x_i),$$

which has the aforementioned problems. By contrast, for an integer $1 \le k < \frac{n}{2}$, the k-trimmed mean over $x_{1:n}$ is:

$$\hat{T}_{n,k}(f, x_{1:n}) := \frac{1}{n-2k} \sum_{i=k+1}^{n-k} f(x_{(i)}), \quad (3)$$

where $(\cdot)$ is a permutation of $[n]$ such that

$$f(x_{(1)}) \le \cdots \le f(x_{(n)}).$$

That is, the trimmed mean is the arithmetic mean of the terms that remain once the $k$ largest and $k$ smallest values of $f(x_i)$ have been removed. A large $k$ makes this estimator more robust to outliers, but also introduces some bias.

The trimmed mean is a classical estimator in Robust Statistics in the sense of Huber [3, 20, 21, 22, 23, 24, 25]. More recently, variants of the trimmed mean have been used to estimate high dimensional means [10] and covariances [26] with non-asymptotic guarantees. The PhD thesis [27] also proves optimality properties of the trimmed mean for estimating the mean of a single function $f$ [27, Chapter 2].

## 1.2 This work

The main contribution of the present paper is to show that trimmed means lead to state-of-the-art finite-sample performance in three statistical problems. The first of these is what we call uniform mean estimation: it is a kind of “metaproblem” that appears in several statistical settings. The second problem is the estimation of the mean of a random vector under an arbitrary norm. The third and final problem is that of regression with quadratic loss.

### 1.2.1 Uniform mean estimation

To motivate this problem, we first note that bounding the supremum of an empirical process

$$\sup_{f \in \mathcal{F}} \left| \frac{1}{n} \sum_{i=1}^{n} f(X_i) - Pf \right|$$

is a crucial step in the analysis of many problems in Statistics and Machine Learning [28, 29]. For instance, one simple way to analyze the empirical risk minimizer – i.e. the minimizer of the empirical loss in (2) –, it is standard to show that

$$L_P(\hat{\theta}_n) - \inf_{\theta \in \Theta} L_P(\theta) \le 2 \sup_{f \in \mathcal{F}} \left| \frac{1}{n} \sum_{i=1}^{n} f(X_i) - Pf \right| \quad (4)$$
where $\mathcal{F} = \{\ell(\theta, \cdot) : \theta \in \Theta\}$.

Now suppose we to replace the sample means in (2) by some other estimator of $\mathbb{E}_{X \sim P} \ell(\theta, X)$. Abstractly, this leads to the problem of bounding

$$ \sup_{f \in \mathcal{F}} |\hat{E}_f(X_1, \dots, X_n) - Pf| $$

where now each $\hat{E}_f$ should be designed so as to minimize the above supremum. In other words: given a family of functions $\mathcal{F}$, we want to design estimators $\hat{E}_f(X_1, \dots, X_n)$ for each the expectations of $Pf$, $f \in \mathcal{F}$, so as to minimize the worst-case error. Reference [30] by Minsker is the only previous paper we are aware of on this problem.

Our main result on uniform mean estimation is Theorem 3.1, which shows that trimmed means give the best known bounds for this problem in the adversarial contamination setting. In particular, we improve the main result of [30] and obtain minimax-optimal dependence on moment parameters and the contamination level. Theorem 3.1 and some related work are discussed in detail in Section 3.

### 1.2.2 Vector mean estimation under arbitrary norms

In this problem, we assume that we have a (potentially corrupted) iid sample $X_1, \dots, X_n$ from a high-dimensional distribution $P$ over $\mathbb{R}^d$, whose mean $\mu_P$ we want to estimate. The error in our estimate will be measured by an arbitrary norm $\| \cdot \|$.

As already noted by Minsker [30], vector mean estimation is closely related to uniform mean estimation with the function class $\mathcal{F}$ corresponding to the dual unit ball of the norm $\| \cdot \|$. Using this connection, we present in Section 4 a trimmed-mean-based estimator for these vector means. Specifically, we obtain an estimator $\hat{\mu}_{n,k}$ whose error $\|\hat{\mu}_{n,k} - \mu_P\|$ is bounded by

$$ C \left( \mathbb{E}_{X_{1:n} \stackrel{i.i.d.}{\sim} P} \left[ \left\| \frac{1}{n} \sum_{i=1}^{n} X_i - \mu_P \right\| \right] + \inf_{1 \le q \le 2} \nu_q \left( \frac{\log(1/\alpha)}{n} \right)^{1-\frac{1}{q}} + \inf_{p>1} \nu_p \varepsilon^{1-\frac{1}{p}} \right) \quad (5) $$

with probability $1 - \alpha$, where the $\nu_p$ are one-dimensional moment parameters of the distribution $P$. We will see that this result improves all known results for mean estimation under general norms [8, 12] and slightly improves the best bounds for the Euclidean norm [10]. Moreover, our bound has minimax-optimal dependence on the contamination level. Unfortunately, the estimator we devise is not computationally efficient.

### 1.2.3 Regression with quadratic risk: theory and heuristics

The third problem we consider is that of finding a function $f \in \mathcal{F}$ making $\mathbb{E}_{(X,Y) \sim P} (Y - f(X))^2$ as small as possible, given a (possibly corrupted) sample from $P$.

Under suitable technical conditions, we show that a trimmed-mean-based regression method achieves optimal dependence on the contamination level and on moment parameters. This method obtains “fast” rates, as in previous work by Lugosi and Mendelson [9] and Lecué and Lerasle [31], with better dependence on problem parameters. In particular, we once again obtain minimax bounds for the dependence on the contamination level. This result is discussed in Section 5 along with the related literature.

Subsequently, we present in Section 7 trimmed-mean-based heuristics for robust linear regression. Experiments in the main text and the supplementary material show that our algorithm outperforms a similar method based on the median-of-means principle put forward by [31]. These experiments also give us insights on how to optimize the performance of these heuristics.

## 1.3 More background

Before continuing, we give a general overview of the literature related to our paper. Sections 3, 4 and 5 have more specific pointers to the literature.

Catoni’s original breakthrough on mean estimation [4] was motivated by his work with Audibert on robust linear regression [32]. Similarly, the literature has focused both on fundamental mean estimation problems and on their applications to various statistical tasks.

The problem of estimating vector means under the Euclidean norm has attracted much attention. Lugosi and Mendelson [33] were the first to achieve sub-Gaussian bounds for heavy-tailed finite samples using a method based on the so-called “median-of-means” construction. Starting with Hopkins [11], a number of papers has presented computationally efficient
versions of their method [12, 34, 35]. Lugosi and Mendelson have also put forward a high-dimensional trimmed mean estimator [10]; in particular, our analysis is indebted to their approach. Mean estimation for general norms [8, 36]; is discussed in Section 4 below. See also [17] for a survey of this area.

Robust methods for other statistical problems have also been considered in various works [31, 32, 37, 38, 39]. We mention specifically the case of regression with quadratic loss, which was considered in Lugosi and Mendelson [9] and Lecu´e and Lerasle [31] via approaches based on median-of-means. These papers are further discussed in Section 5, where we present our own results on this problem.

We briefly mention some additional lines of research. The estimation of covariance matrices is a special case of mean estimator; see [15] and the minimax-optimal bounds in [16, 26]. Computationally efficient methods for Robust Statistics in high dimensions include the breakthrough by Diakonikolas et al. [7], and also [18, 19, 35] and many other references.

Finally, we discuss the adversarial contamination model that we consider along with [7, 10, 12, 18, 19, 35]. This is a model for outliers in an i.i.d. sample which allows arbitrary changes to a small fraction of sample points before the statistician gets to see it (see §2.3 for a formal definition). This is a more demanding model than Huber’s classical contamination model [2, 3], where the uncontaminated data distribution P is usually assumed known, but a small, random fraction of the sample is replaced with another i.i.d. sample from a different (unknown) distribution. There are at least two reasons why studying the adversarial model makes sense. One is that that there settings where the assumption that outliers are i.i.d. from some distribution is not realistic. The second reason is that, when the uncontaminated data distribution P is unknown, then minimax-optimal lower bounds for the adversarial model are achieved (up to constant factors) by Huber-style contamination (see e.g. by Minsker [30, Lemma 5.4]). In other words, if we do not know P , then the two contamination models are (nearly) equally difficult for the statistician from a minimax perspective.

1.4 Organization

The remainder of the paper is organized as follows. Notation and terminology are presented in Section 2. Our theoretical results on uniform mean estimation, vector mean estimation and regression are presented in Sections 3, 4 and 5 (respectively), in which we also give additional background on these problems. Experiments on a regression heuristic based on trimmed means are summarized in Section 7 using algorithms described in Section 6. The main proof elements for our results are discussed in Section 8. The appendix contains additional technical lemmata and the statements of some results we need. The supplementary material contains additional lemmata and a detailed description of our experiments.

2 Notation and terminology

2.1 Basics

N = { 1 , 2 , 3 , . . . } is the set of positive integers. For n ∈ N , define [ n ] := { 1 , 2 , . . . , n } . The cardinality of a finite set S is denoted by # S .

2.2 Probabilities, expectations and samples

Given a probability space ( Z , Z , P ), we write Z ∼ P to denote that Z is a random element of ( Z , Z ) with distribution P . If f : Z → R is measurable, we use P f, P f ( Z ) or E$_{Z}$$_{∼}$$_{P}$ f ( Z ) to denote the expectation (integral) of f according to P . For p ≥ 1, we write L $^{p}$( P ) = L $^{p}$( Z , Z , P ) for the corresponding L p space.

Given n ∈ N , the elements of Z n are denoted by z$_{1}$$_{:}$$_{n}$ = ( z$_{1}$, z$_{2}$, . . . , z$_{n}$ ). We write

$$
Z_{1:n} = (Z_1, \dots, Z_n)^{i.i.d.} \sim P
$$

if the Z$_{i}$ are independent and identically distributed (i.i.d.) random elements of ( Z , Z ) with common law P .

2.3 Adversarial contamination

This model comes from the CS literature [7]. Given n ∈ N and ( Z , Z , P ) as above, and also a parameter ε ∈ [0 , 1), a random element Z ε 1: n of Z n is a ε -contaminated i.i.d. sample from P if the following condition holds:

$$
\text{there exist } Z_{1:n} \stackrel{i.i.d.}{\sim} P \text{ such that } \#\{i \in [n] : Z_i^\epsilon \neq Z_i\} \leq \epsilon n.
$$
## 2.4 Compatible measures and empirical processes

We need a technical condition to ensure the various suprema we consider are well defined. Given $p \ge 1$, we say that a probability measure $P$ over $(\mathbb{Z}, \mathcal{Z})$ and a family $\mathcal{F}$ of $\mathcal{Z}$-measurable functions from $\mathbb{Z}$ to $\mathbb{R}$ are $p$-compatible if $\mathcal{F} \subset L^p(P)$ and there exists a countable subset $\mathcal{D} \subset \mathcal{F}$ such that any $f \in \mathcal{F}$ is the limit of a sequence in $\mathcal{D}$ that converges pointwise and in $L^p(P)$ norm. For 1-compatible $\mathcal{F}$ and $P$, we define the expectation of the empirical process indexed by $\mathcal{F}$,

$$ \mathrm{Emp}_n(\mathcal{F}, P) := \mathbb{E}_{Z_{1:n} \stackrel{i.i.d.}{\sim} P} \left[ \sup_{f \in \mathcal{F}} \left| \frac{1}{n} \sum_{i=1}^{n} f(Z_i) - Pf \right| \right] \quad (6) $$

and the Rademacher complexity,

$$ \mathrm{Rad}_n(\mathcal{F}, P) := \mathbb{E}_{\substack{\epsilon_{1:n} \stackrel{i.i.d.}{\sim} U(\{-1,1\}) \\ Z_{1:n} \stackrel{i.i.d.}{\sim} P}} \left[ \sup_{f \in \mathcal{F}} \left| \frac{1}{n} \sum_{i=1}^{n} \epsilon_i f(Z_i) \right| \right], \quad (7) $$

where it is implicit in the expectation that the $Z_{1:n}$ and $\epsilon_{1:n}$ are independent. Definitions (6) and (7) are related by the first part of the following classical results:

**Theorem 2.1.** Assume that a measure $P$ over $(\mathbf{X}, \mathcal{X})$ is 1-compatible with a family of measurable functions $\mathcal{G}$ from $\mathbf{X}$ to $\mathbb{R}$.

1. (Symmetrization and Desymmetrization; [29, Lemma 11.4]) $\mathrm{Emp}_n(\mathcal{G}) \le 2\mathrm{Rad}_n(\mathcal{G})$. Moreover, if $Pg = 0$ for all $g \in \mathcal{G}$, then $\mathrm{Rad}_n(\mathcal{G}) \le 2\mathrm{Emp}_n(\mathcal{G})$.

2. (Ledoux-Talagrand contraction; [29, Theorem 11.6]) If $\tau: \mathbb{R} \to \mathbb{R}$ is $L$-Lipschitz and satisfies $\tau(0) = 0$, and we set $\tau \circ \mathcal{G} := \{\tau \circ g : g \in \mathcal{G}\}$, then $\mathrm{Rad}_n(\tau \circ \mathcal{G}) \le L \mathrm{Rad}_n(\mathcal{G})$.

## 3 Uniform mean estimation via trimmed means

This section discusses the following problem first posed by Minsker [30].

**Problem 1 (Uniform mean estimation).** One is given a measurable space $(\mathbf{X}, \mathcal{X})$; and family $\mathcal{F}$ of measurable functions from $\mathbf{X}$ to $\mathbb{R}$; and a family $\mathcal{P}$ of probability distributions over $(\mathbf{X}, \mathcal{X})$ such that $\mathcal{F}$ and $\mathcal{P}$ are 1-compatible for all $P \in \mathcal{P}$. For a sample size $n \in \mathbb{N}$; a contamination parameter $\epsilon \in [0, 1/2)$; and a confidence level $1 - \alpha \in (0, 1)$; the goal is to find a family of measurable functions (estimators)

$$ \{E_f : \mathbf{X}^n \to \mathbb{R} : f \in \mathcal{F}\} $$

with the following property: for any $P \in \mathcal{P}$, if $X_{1:n}^\epsilon$ is a $\epsilon$-contaminated sample from $P$ (cf. §2.3), then:

$$ \mathbb{P} \left\{ \sup_{f \in \mathcal{F}} |E_f(X_{1:n}^\epsilon) - Pf| \le \Phi_P \right\} \ge 1 - \alpha; \quad (8) $$

with $\Phi_P = \Phi_P(\mathcal{F}, \alpha, n, \epsilon)$ as small as possible.

We assume implicitly that the supremum in the above event is a random variable (i.e. it is a measurable function). Importantly, the estimators $E_f$ are not allowed to depend on the specific measure $P \in \mathcal{P}$, but may depend on $\mathcal{P}, \mathcal{F}, \alpha, n$ and $\epsilon$. In fact, the dependence on $\alpha$ is unavoidable in our setting even if $\mathcal{F}$ consists of a single function [5, Theorem 3.2]. On the other hand, it is not known if an optimal mean estimator must depend on $\epsilon$, and we put this question to one side for the remainder of the paper.

Minsker [30] motivates Problem 1 via maximum likelihood estimation, and he also applies his result to vector mean estimation (discussed in the next section). Of course, many results exist on this Problem for the case where $E_f$ is the sample mean and $\epsilon = 0$: this includes Gaussian approximations [40, 41] and concentration inequalities [42, 43]. However, the whole point of this paper is that we do not expect sample means to be optimal estimators, even when there is no contamination.

In what follows, we consider bounds on $\Phi_P(\mathcal{F}, \alpha, n, \epsilon)$ in terms of moment conditions and measures of “complexity” of the class $\mathcal{F}$. For 1-compatible $\mathcal{F}$ and $P$ as above, and exponents $p \ge 1$, we define the following (potentially infinite) moment quantities:

$$ \nu_p(\mathcal{F}, P) := \sup_{f \in \mathcal{F}} (P |f - Pf|^p)^{\frac{1}{p}} = \sup_{f \in \mathcal{F}} \|f - Pf\|_{L^p(P)}. \quad (9) $$
As for our complexity measure of $\mathcal{F}$ under $P$, we take the expectation of the supremum of the empirical process over an uncontaminated sample (6). The question we address is: how small can we expect $\Phi_P(\mathcal{F}, \alpha, n, \varepsilon)$ to be in terms of the above parameters? The next theorem offers an answer to this question.

**Theorem 3.1** (Proof in §8.2). In the setting of Problem 1, let $\mathcal{P}$ denote the family of all probability distributions $P$ over $(\mathbf{X}, \mathcal{X})$ that are 1-compatible with $\mathcal{F}$ and such that $\text{Emp}_n(\mathcal{F}, P) < +\infty$. If

$$ \phi := \frac{1}{n} \left( \lfloor \varepsilon n \rfloor + \left\lfloor \ln \frac{2}{\alpha} \right\rfloor \vee \left\lfloor \frac{\left(\frac{1}{2} - \varepsilon\right) \wedge \varepsilon}{2} n \right\rfloor \right) < \frac{1}{2}, $$

then the family of estimators

$$ E_f(x_{1:n}) := \hat{T}_{n,\phi n}(f; x_{1:n}) \quad (x_{1:n} \in \mathbf{X}^n, f \in \mathcal{F}), $$

satisfies the following property: if $X_{1:n}^{\varepsilon}$ is an $\varepsilon$-contaminated sample from some $P \in \mathcal{P}$, then

$$ \mathbb{P} \left\{ \sup_{f \in \mathcal{F}} |\hat{T}_{n,\phi n}(f, X_{1:n}^{\varepsilon}) - Pf| \le \Phi_P \right\} \ge 1 - \alpha, $$

where $\Phi_P = \Phi_P(\mathcal{F}, \alpha, n, \varepsilon)$ is defined as follows:

$$ \Phi_P = C_{\varepsilon} \left( 8\text{Emp}_n(\mathcal{F}, P) + \inf_{q \in [1,2]} \nu_q(\mathcal{F}, P) \left( \frac{\ln \frac{3}{\alpha}}{n} \right)^{1-\frac{1}{q}} + \inf_{p \ge 1} \nu_p(\mathcal{F}, P) \varepsilon^{1-\frac{1}{p}} \right), $$

$$ \text{with } C_{\varepsilon} := 384 \left( 1 + \frac{\varepsilon}{\varepsilon \wedge \left(\frac{1}{2} - \varepsilon\right)} \right). $$

To understand this result, consider first the case where $\mathcal{F} = \{f\}$ consists of a single function. The value of $\Phi_P$ is (up to constant factors) a sum of two terms: a random fluctuations term and a contamination term:

$$ \inf_{1 \le q \le 2} \nu_p(\{f\}, P) \left( \frac{1}{n} \ln \frac{1}{\alpha} \right)^{1-\frac{1}{q}} \quad \text{and} \quad \inf_{p \ge 1} \nu_q(\{f\}, P) \varepsilon^{1-\frac{1}{p}}, \quad \text{respectively.} \quad (10) $$

The necessity of these two terms follows from [5, Theorem 3.1] and [30, Lemma 5.4]$^1$. Therefore, the trimmed mean achieves minimax-optimal bounds in the single function case (this is proven by other means in [27, Chapter 2]).

It is interesting to contrast this result with what is known about the median of means (MoM) construction [5, 44], which is often used to obtain robust mean estimators. MoM consists of splitting the sample into $K$ parts, taking the sample mean of each part, and then taking the median of the $K$ means. For $K \approx \varepsilon n + \ln(1/\alpha)$, this estimator achieves:

$$ \Phi_P(n, \alpha, \varepsilon) = C \inf_{1 \le p \le 2} \nu_p(\{f\}, P) \left( \frac{1}{n} \ln \frac{1}{\alpha} + \varepsilon \right)^{1-\frac{1}{p}}, $$

with $C > 0$ universal; this follows e.g. [45, Lemma 2] (for $\varepsilon = 0$) combined with the fact that taking $K \gg \varepsilon n$ naturally makes the estimator robust (as observed in e.g. [31]). In general, this bound is strictly worse than the optimal (10).

Consider now general function classes $\mathcal{F}$. To the best of our knowledge, the only paper dealing specifically with Problem 1 is [30] by Minsker. That paper presents an estimator based on a combination of influence functions and median of means. His estimator is optimally robust (i.e. has an optimal contamination term) under $p$-th moment conditions in the range $p \in [2, 3]$. Theorem 3.1 improves on Minsker's results [30] in terms of the moment conditions in the bounds. For instance, when $\varepsilon = 0$ our bound implies a non-trivial “sub-Gaussian” error bound

$$ \Phi_P \le C_{\varepsilon} \left( 8\text{Emp}_n(\mathcal{F}, P) + \nu_2(\mathcal{F}, P) \sqrt{\frac{\ln \frac{3}{\alpha}}{n}} \right) $$

when both $\text{Emp}_n(\mathcal{F}, P)$ and $\nu_2(\mathcal{F}, P)$ are finite. By contrast, Minsker [30] requires higher moment assumptions and some knowledge of $\nu_2(\mathcal{F}, P)$ to obtain a similar bound. These seem to be intrinsic aspects of his analysis, as it relies on Barry-Esseen bounds (which require higher moments) and on a version of Catoni's estimator (which demand some knowledge of the variance). We also go beyond Minsker by obtaining nontrivial results when $\nu_2(\mathcal{F}, P) = +\infty$, and improved dependence on the contamination level under $p$-th moment assumptions for $p > 3$.

In the next section, we compare previous results on vector mean estimation by several authors, and show that our application of Theorem 3.1 in this setting leads to improved results.

<footnote>$^1$The lower bound in [30, Lemma 5.4] is given for $p \in [2, 3]$, but the same proof works for all $p > 1$.</footnote>
**Remark 1.** Theorem 3.1 has other potential applications besides the ones we discuss at length in this paper. As one example, we mention the problem of estimating probability distributions according to integral probability metrics [46]. Let $\mathcal{F}$ be an arbitrary family of measurable functions from $\mathbf{X}$ to $\mathbb{R}$, and let $\Delta_{\mathcal{F}}$ denote the set of all probability distributions over $\mathbf{X}$ that integrate all $f \in \mathcal{F}$. $\mathcal{F}$ defines an integral probability (semi)metric over $\Delta_{\mathcal{F}}$ via the recipe:

$$D_{\mathcal{F}}(P, Q) := \sup_{f \in \mathcal{F}} \left| \int_{\mathbf{X}} f(x) (Q - P)(dx) \right| (P, Q \in \Delta_{\mathcal{F}}).$$

Popular examples of such metrics include the $L^1$ Wassermann metric and kernel-based metrics discussed in [46, 47]. Estimating $D_{\mathcal{F}}(P, Q)$ from contaminated random samples from $P$ and $Q$ can be reduced to Problem 1.

**Remark 2** (Is the complexity term optimal?). An important theoretical problem is whether the complexity term $\text{Emp}_n(\mathcal{F}, P)$ that appears in [30] and our bound is necessary. We only know that this is the case for mean estimation for Gaussian vectors [36]. On the other hand, our Theorem follows from a more general result that does not even require $\text{Emp}_n(\mathcal{F}, P) < +\infty$ or $\nu_p(\mathcal{F}, P) < +\infty$ for any $p > 1$; see Theorem 8.1 for details.

# 4 Vector mean estimation via trimmed means

In this section, we apply the results of Section 3 to the problem of estimating the mean of a random vector. As we will see, our results are optimal for the Euclidean norm, and improve the state-of-the-art for more general norms.

**Problem 2** (Vector mean estimation). Let $(\mathbf{X}, \|\cdot\|)$ be a separable, reflexive Banach space with dual $\mathbf{X}^*$; $\mathcal{X}$ is the Borel $\sigma$-field on $\mathbf{X}$. $\mathcal{P}$ denotes the family of probability measures over $(\mathbf{X}, \mathcal{X})$ with $P\|\cdot\| = \mathbb{E}_{\mathbf{X}\sim\mathcal{P}}\|X\| < +\infty$, so that for all $P \in \mathcal{P}$ there exists a unique $\mu_P \in \mathbf{X}$, called the mean of $P$, such that $f(\mu_P) = \mathbb{E}_{\mathbf{X}\sim\mathcal{P}} f(X)$ for all $f \in \mathbf{X}^*$.

For a sample size $n \in \mathbb{N}$; a contamination parameter $\varepsilon \in [0, 1/2)$; and a confidence level $1 - \alpha \in (0, 1)$; the goal is to find a function $\hat{\mu}: \mathbf{X}^n \to \mathbf{X}$ such that, if $X_{1:n}^\varepsilon$ is a $\varepsilon$-contaminated sample from some $P \in \mathcal{P}$,

$$\mathbb{P}\{\|\hat{\mu}(X_{1:n}^\varepsilon) - \mu_P\| \le \Phi_P(n, \alpha, \varepsilon)\} \ge 1 - \alpha, \quad (11)$$

with $\Phi_P(n, \alpha, \varepsilon)$ as small as possible.

To avoid technicalities, we will interpret the probability (11) as an inner probability. Moreover, we allow out estimator $\hat{\mu}$ to depend on $1 - \alpha$ and $\varepsilon$, as discussed in the paragraph following Theorem 3.1.

Our main result on Problem 2 is the following theorem.

**Theorem 4.1.** In the setting of Problem 2, let $\mathbf{B}^*$ denote the dual unit ball of $\mathbf{X}$. For $1 \le k < \frac{n}{2}$, define $\hat{\mu}_{n,k}: \mathbf{X}^n \to \mathbf{X}$ so that

$$\hat{\mu}_{n,k}(x_{1:n}) \in \arg \min_{\mu \in \mathbf{X}^*} \left( \sup_{f \in \mathbf{B}^*} \left| \hat{T}_{n,k}(f, x_{1:n}) - f(\mu) \right| \right) \quad (x_{1:n} \in \mathbf{X}^n).$$

If

$$\phi := \frac{1}{n} \left( \lfloor \varepsilon n \rfloor + \lfloor \ln \frac{2}{\alpha} \rfloor \vee \lfloor \frac{\left(\frac{1}{2} - \varepsilon\right) \wedge \varepsilon}{2} n \rfloor \right) < \frac{1}{2},$$

then $\hat{\mu}_{n,\phi n}$ satisfies

$$\mathbb{P}\{\|\hat{\mu}_{n,\phi n}(X_{1:n}^\varepsilon) - \mu_P\| \le \Phi_P(n, \alpha, \varepsilon)\} \ge 1 - \alpha,$$

where

$$\Phi_P = 2C_\varepsilon \left( 8\mathbb{E} \left\| \frac{1}{n} \sum_{i=1}^{n} X_i - \mu_P \right\| + \inf_{q \in [1,2]} \nu_q \left( \frac{\ln \frac{3}{\alpha}}{n} \right)^{1-\frac{1}{q}} + \inf_{p \ge 1} \nu_p \varepsilon^{1-\frac{1}{p}} \right),$$

with $C_\varepsilon$ as in Theorem 3.1 and $\nu_p$ is the largest $L^p$ norm of a one-dimensional marginal of $X - \mu_P$:

$$\nu_p = \nu_p(\mathbf{B}^*, P) := \sup_{f \in \mathbf{B}^*} (P |f(X - \mu_P)|^p)^{\frac{1}{p}}.$$

The proof of this result is a straightforward application of Theorem 3.1; see Appendix D for details. We also show in that Section that $\hat{\mu}_{n,k}$ is a measurable function when $\mathbf{X} = \mathbb{R}^d$ for some $d \in \mathbb{N}$.
Theorem 4.1 allows us to recover and improve the best known results in the literature. For the case where $(\mathbf{X}, \|\cdot\|)$ is a Hilbert space and $P\|\cdot\|^2 < +\infty$, the estimator by Lugosi and Mendelson [10, Theorem 2] achieves a slightly worse error rate<fnref n="2" />

$$ \Phi_P^{\text{LM}} = C_{\varepsilon} \left( \sqrt{\frac{\text{tr}(\Sigma_P)}{n}} + \nu_2 \sqrt{\frac{1}{n} \ln \frac{3}{\alpha}} + \inf_{p \ge 2} \nu_p \varepsilon^{1-\frac{1}{p}} \right), $$

where $\Sigma_P$ is the covariance matrix (in particular, $\nu_2$ is the largest eigenvalue of $\Sigma_P$). Notice that

$$ \sqrt{\frac{\text{tr}(\Sigma_P)}{n}} = \sqrt{\mathbb{E} \left\| \frac{1}{n} \sum_{i=1}^{n} X_i - \mu_P \right\|^2} \ge \mathbb{E} \left\| \frac{1}{n} \sum_{i=1}^{n} X_i - \mu_P \right\| $$

by Jensen's inequality. Our estimator also allows for a broader range of $p$ in the contamination term.

For general Banach spaces, the best result up to this paper was achieved by median-of-means-based estimator of Depersin and Lecué [36], which obtains

$$ \Phi_P^{\text{DL}} = C \left( \mathbb{E} \left\| \frac{1}{n} \sum_{i=1}^{n} X_i - \mu_P \right\| + \nu_2 \sqrt{\varepsilon + \frac{\ln \frac{3}{\alpha}}{n}} \right) $$

under restrictions on $\varepsilon$ that imply $\varepsilon < 1/16$. In contrast to this, our theorem has better dependence on $\varepsilon$ and the moment parameters $\nu_q$; in fact, our dependence is optimal because of (10).

To the best of our knowledge, Theorem 4.1 is also the first result on vector mean estimation that does not require second moments, in either setting considered above.

**Remark 3.** Similarly to [36], the estimator $\hat{\mu}_{n,k}$ is the minimizer of a convex function. We believe that the optimization heuristics from [36] could be adapted to compute our estimator. A more interesting question that is beyond the scope of this work is whether our estimator can be provably computed in polynomial time. Computationally efficient estimators based on median-of-means are given in [11, 12, 34].

**Remark 4.** In [36], Depersin and Lecué study the behavior of a median of means estimator for a variant of Problem 2 where $P$ is symmetrical around $\mu_P$ and no moment assumptions are made. Their assumptions [36, Assumption 3] are suitable for their method, but not for the trimmed mean, which seems to require at least weak moment assumptions. Therefore, we do not pursue this direction in this article.

# 5 Quadratic risk minimization

This section discusses the problem of regression with quadratic loss as studied by Lugosi and Mendelson [9] and Lecué and Lerasle [31]. In this setting, we consider probability measures $P$ over product spaces $\mathbf{X} \times \mathbb{R}$; and we use $P_{\mathbf{X}}$ and $P_{\mathbb{R}}$ to denote the respective marginals.

**Problem 3 (Regression with quadratic loss).** One is given a measurable space $(\mathbf{X}, \mathcal{X})$; a convex family $\mathcal{F}$ of measurable functions from $\mathbf{X}$ to $\mathbb{R}$; and a family of probability measures $\mathcal{P}$ over $(\mathbf{X} \times \mathbb{R}, \mathcal{X} \times \mathcal{B})$ with the following property: for all $P \in \mathcal{P}$, $\mathcal{F}$ and $P_{\mathbf{X}}$ are 2-compatible; $\mathcal{F}$ is closed in $L^2(P_{\mathbf{X}})$; and $P_{\mathbb{R}}$ has a finite second moment.

In this setup, define (for each $P \in \mathcal{P}$):

$$ f_P^* := \arg \min_{f \in \mathcal{F}} \mathbb{E}_{(X,Y) \sim P} (f(X) - Y)^2. \qquad (12) $$

For a sample size $n \in \mathbb{N}$, a contamination parameter $\varepsilon \in [0, 1/2)$; and a confidence level $1 - \alpha \in (0, 1)$; find a mapping

$$ F_n : (\mathbf{X} \times \mathbb{R})^n \to \mathcal{F} $$

with the following property: for any $P \in \mathcal{P}$, if $Z_{1:n}^{\varepsilon} := \{(X_i^{\varepsilon}, Y_i^{\varepsilon})\}_{i \in [n]}$ is an $\varepsilon$-contaminated sample from $P$ (cf. §2.3), then the function $\hat{f}_n^{\varepsilon} := F_n(Z_{1:n}^{\varepsilon})$ achieves

$$ \mathbb{P} \left\{ \left\| \hat{f}_n^{\varepsilon} - f_P^{\star} \right\|_{L^2(P_{\mathbf{X}})} \le \Phi_P \right\} \ge 1 - \alpha, \qquad (13) $$

with $\Phi_P := \Phi_P(\mathcal{F}, \alpha, n, \varepsilon)$ as small as possible.

<footnote n="2">²The dependence of their theorem on $\varepsilon$ is worse than shown here, but the bound we present can be deduced from their methods. On the other hand, [10, Theorem 2] seems to be missing the condition $\varepsilon < 1/2$, which is needed for nontrivial bounds.</footnote>
Let us make some technical comments about this problem. Firstly, as in the previous sections, we allow $\hat{f}_n^\epsilon$ to depend on the contamination level and on the desired confidence level, for the same reasons pointed out right after Theorem 3.1.

Secondly, to avoid delicate measurability issues regarding $F_n$, the probability in (13) should be interpreted as a inner probability.

Thirdly, it follows from the fact that $\mathcal{F}$ is convex and closed in $L^2(P_X)$ that $f_P^*$ is uniquely defined up to a $P_X$-null set. With these observations, it is clear that Problem 3 is well-posed.

A fourth comment is that we will also consider a variant of Problem 3 where the goal is to minimize excess risk. Letting:

$$R_P(f) := P(f(X) - Y)^2 (f \in \mathcal{F}),$$

one can check that

$$\forall f \in \mathcal{F} : \|f - f_P^*\|_{L^2(P_X)}^2 \le R_P(f) - R_P(f_P^*).$$

Therefore, results on the excess risk of $f = \hat{f}_n^\epsilon$ also bound the distance between $\hat{f}_n^\epsilon$ and $f_P^*$. Our main result on the regression problem, Theorem 5.1 below, will give both types of bounds. In what follows we present the definitions and conditions we need to present our solution to Problem 3. The following concrete example will serve to illustrate our discussion.

*Example 1 (Linear regression with independent errors).* Let $\mathbf{X} = \mathbb{R}^d$ with the Borel $\sigma$-field $\mathcal{X}$. We consider the family of linear functions

$$\mathcal{F} := \{f_{\beta}(\cdot) = \langle \cdot, \beta \rangle : \beta \in \mathbb{R}^d\}.$$

$\mathcal{P}$ consists of the family of distributions $P$ such that $\mathbb{E}_{(X,Y)\sim P}[\|X\|_2^2 + Y^2] < +\infty$ and, given $(X, Y) \sim P$, there exists $\beta_P^* \in \Theta$ with:

$$Y = \langle \beta_P^*, X \rangle + \xi_P, \text{ where } \xi_P \text{ is mean zero and independent from } X.$$

In this case, $f_P^*(\cdot) = \langle \cdot, \beta_P^* \rangle$ and the excess risk is:

$$R_P(f_{\beta}) - R_P(f_P^*) = \|\langle \cdot, \beta - \beta_P^* \rangle\|_{L^2(P_X)}^2 = \langle \beta - \beta_P^*, \Sigma_P(\beta - \beta_P^*) \rangle,$$

where $\Sigma_P = \mathbb{E}_{(X,Y)\sim P} XX^T$ is the population design matrix. We set $\sigma_P^2 = \mathbb{E} \xi_P^2$.

## 5.1 Relevant parameters

As with uniform mean estimation, the analysis of Problem 3 will depend on moment bounds and complexity parameters of the function class $\mathcal{F}$. As in previous work, the right parameters to consider are localized [8, 31, 48, 49].

### 5.1.1 Some notation

For $f \in \mathcal{F}$, let

$$\ell_f(x, y) := (f(x) - y)^2((x, y) \in \mathbf{X} \times \mathbb{R}). \qquad (14)$$

The excess risk of $f$ is

$$R_P(f) - R_P(f_P^*) = P(\ell_f - \ell_{f_P^*}).$$

Now let $\xi_P(x, y) := y - f_P^*(x)$ denote the “regression residual” at the optimal $f_P^*$ (this coincides with the $\xi_P$ in Example 1), and set:

$$m_f(x, y) = m_{f,P}(x, y) := \xi_P(x, y) (f(x) - f_P^*(x)) (f \in \mathcal{F}, (x, y) \in \mathbf{X} \times \mathbb{R}). \qquad (15)$$

Then the difference

$$\ell_f(x, y) - \ell_{f_P^*}(x, y) = (f(x) - f_P^*(x))^2 - 2m_{f,P}(x, y)$$

consists of a “quadratic term” and a “multiplicative term.” As in [50], we note that analyzing the standard empirical risk minimizer – or other risk minimization procedures – requires lower bounds on the quadratic part and upper bounds on the multiplier part.
### 5.1.2 Localization, complexities and critical radii

Since Massart [48] it has been known that local analyses of regression problems lead to the best results. Following Lecué and Mendelson [50], we consider the local parameters that are relevant to the analysis of quadratic and multiplier parts of our process. What makes these parameters “local” is that they are parameterized by the distance to $f_P^*$. Specifically, define, for $r > 0$:

$$ 
\begin{aligned}
\mathcal{F}_q(r, P) &:= \{f - f_P^* : f \in \mathcal{F}, \|f - f_P^*\|_{L^2(P_x)} = r\}, \\
\mathcal{F}_m(r, P) &:= \{m_{f,P} - Pm_{f,P} : f \in \mathcal{F}, \|f - f_P^*\|_{L^2(P_x)} \le r\}.
\end{aligned}
$$

As in [31], we use Rademacher complexities (7) to measure the size of these function families. Given constants $\delta_q, \delta_m > 0$, we define the critical radii

$$ 
\begin{aligned}
r_q(\delta_q, \mathcal{F}, P) &:= \inf\{r > 0 : \mathcal{F}_q(r, P) \neq \emptyset \text{ and } \mathrm{Rad}_n(\mathcal{F}_q(r, P), P) \le \delta_q r\}, \\
r_m(\delta_m, \mathcal{F}, P) &:= \inf\{r > 0 : \mathrm{Rad}_n(\mathcal{F}_m(r, P), P) \le \delta_m r^2\},
\end{aligned}
$$

where (by convention) the infimum of an empty set is $+\infty$. Typically, we will take $\delta_q, \delta_m < 1$. In this case, the intuition is that $r_q$ is the smallest radius $r$ at which the quadratic process is significantly larger than $r^2$. The other critical radius $r_m$ is the smallest radius $r$ at which the multiplier empirical processes becomes small when compared to $r^2$.

**Remark 5** (Critical radii in linear regression with independent errors). In Example 1, one can check that:

$$ \mathrm{Rad}_n(\mathcal{F}_q(r, P), P) \le r \sqrt{\frac{\mathrm{tr}(\Sigma_P)}{n}} \quad \text{and} \quad \mathrm{Rad}_n(\mathcal{F}_m(r, P), P) \le r \sigma_P \sqrt{\frac{\mathrm{tr}(\Sigma_P)}{n}}. $$

Therefore, $r_q(\delta_q, \mathcal{F}, P) = 0$ when $n \ge \mathrm{tr}(\Sigma_P)/\delta_q^2$. Moreover,

$$ r_m(\delta_m, \mathcal{F}, P) \le \frac{\sigma_P}{\delta_m} \sqrt{\frac{\mathrm{tr}(\Sigma_P)}{n}}. $$

If there is no condition on $n$, it is possible that $r_q(\delta_q, \mathcal{F}, P) = +\infty$; for instance, this will be the case if $P_x$ is Gaussian and $n \le c \mathrm{tr}(\Sigma_P)/\delta_q^2$.

### 5.1.3 Moment parameters

Our results also require the introduction of two moment-related quantities. The first of these is:

$$ \theta_0(\mathcal{F}, P) := \sup \left\{ \frac{\|f - f_P^*\|_{L^2(P_x)}}{\|f - f_P^*\|_{L^1(P_x)}} : f \in \mathcal{F}, \|f - f_P^*\|_{L^1(P_x)} > 0 \right\} \quad (16) $$

As shown in Proposition 2 of [51], a bound on $\theta_0(\mathcal{F}, P) < +\infty$ is essentially equivalent to a “small ball condition” on the functions $f - f_P^*$:

$$ \mathbb{P}_{X \sim P_x} \{|f(X) - f_P^*(X)| \ge c_0 \|f - f_P^*\|_{L^2(P_x)}\} \ge \alpha_0 \quad (17) $$

for $c_0, \alpha_0 > 0$. This will give a convenient way to control the quadratic part of the excess risk.

The second moment parameter applies to the multiplier part. Given $p \ge 1$, let

$$ \kappa_p(\mathcal{F}, P) := \sup \left\{ \frac{\|m_{f,P} - Pm_{f,P}\|_{L^p(P)}}{\|f - f_P^*\|_{L^2(P_x)}} : f \in \mathcal{F}, \|f - f_P^*\|_{L^2(P_x)} > 0 \right\}. $$

**Remark 6** (Moment conditions and linear regression). In the setting of Example 1,

$$ 
\begin{aligned}
\theta_0(\mathcal{F}, P)^{-1} &= \inf_{\beta \in \mathbb{R}^d : \langle \beta, \Sigma_P \beta \rangle = 1} \|\langle \cdot, \beta \rangle\|_{L^1(P_x)} \quad \text{and} \\
\kappa_p(\mathcal{F}, P) &= \left( \frac{\|\xi_P\|_{L^p(P)}}{\sigma_P} \right) \sup_{\beta \in \mathbb{R}^d : \langle \beta, \Sigma_P \beta \rangle = 1} \|\langle \cdot, \beta \rangle\|_{L^p(P_x)}.
\end{aligned}
$$

In particular, for $p > 2$ the parameter $\kappa_p(\mathcal{F}, P)$ depends on hypercontractivity properties of the random variable $\xi_P$ and of the one-dimensional marginals of $X \sim P_x$.
## 5.2 Results and comparisons

We present a trimmed-mean-based estimator for Problem 3 that satisfies improved bounds. Like [31], we use the observation that

$$f_P^* = \arg \min_{f \in \mathcal{F}} P \ell_f = \arg \min_{f \in \mathcal{F}} \left( \sup_{g \in \mathcal{F}} P (\ell_f - \ell_g) \right),$$

and define $F_n$ via

$$\forall z_{1:n} \in (\mathbf{X} \times \mathbb{R})^n : F_n(z_{1:n}) \in \arg \min_{f \in \mathcal{F}} \left( \sup_{g \in \mathcal{F}} \hat{T}_{n, \phi n} (\ell_f - \ell_g, z_{1:n}) \right) \quad (18)$$

with the convention $\hat{f}_n^\varepsilon := F_n(Z_{1:n}^\varepsilon)$.

**Theorem 5.1 (Proof in Appendix E).** In the setting of Problem 3, let $\mathcal{P}$ denote the family of all probability distributions $P$ over $(\mathbf{X}, \mathcal{X})$ that are 2-compatible with $\mathcal{F}$. Given $\alpha \in (0, 1)$ and $\varepsilon > 0$ define

$$\phi := \frac{\lfloor \varepsilon n \rfloor + \lfloor \ln \frac{3}{\alpha} \rfloor + \lfloor \frac{\varepsilon n}{2} \rfloor}{n} \quad \text{and assume } \phi + \frac{1}{2n} \ln \frac{3}{\alpha} \le \frac{1}{96 \theta_0^2}. \quad (19)$$

Then, there is an event $E$ with probability at least $1 - \alpha$ where

$$\| \hat{f}_n^\varepsilon - f_P^* \|_{L^2(P_{\mathbf{X}})} \le \Phi_P \quad (20)$$

with $\Phi_P = \Phi_P(\mathcal{F}, \alpha, n, \varepsilon)$ given by

$$\Phi_P := 49152 \left[ r_q \left( \frac{1}{32\theta_0(\mathcal{F}, P)}, \mathcal{F}, P \right) \vee 16r_m \left( \frac{1}{448\theta_0^2(\mathcal{F}, P)}, \mathcal{F}, P \right) \right] \quad (21) \\ + 49152 \theta_0(\mathcal{F}, P)^2 \left[ \inf_{1 \le q \le 2} \kappa_q(\mathcal{F}, P) \left( \frac{\ln \frac{3}{\alpha}}{n} \right)^{1-\frac{1}{q}} + \inf_{p \ge 1} \kappa_p(\mathcal{F}, P) \varepsilon^{1-\frac{1}{p}} \right].$$

Moreover, in the same event $E$ the following inequality holds:

$$R_P(\hat{f}_n^\varepsilon) - R_P(f_P^*) \le \left(1 + \frac{1}{16\theta_0(\mathcal{F}, P)^2}\right) \Phi_P^2. \quad (22)$$

Let us explain how this result compares with previous work on robust regression.

A seminal early contribution by Audibert and Catoni [32] gives an estimator for robust least squares problems, where $\mathcal{F}$ is (a subset of) the linear hull of finite family of functions. Unlike our paper, [32] does not consider contamination, requires restricting their regression method to a bounded set, and achieves dimension-dependent bounds.

Lugosi and Mendelson [9] gives regressors with “sub-Gaussian guarantees” in Problem 3 under weak moment assumptions, and for more general $\mathcal{F}$ than [32]. Their method is based on a median-of-means construction. Approaches based on solving min-max problems such as (18) are also present in the literature [31, 36, 51]. Improving upon [51], Lecué and Lerasle [31] obtained the best known results for this problem: their bound for $\Phi_P(\mathcal{F}, \alpha, n, \varepsilon)$ in Problem 3 takes the following form (up to constant factors):

$$\theta_0(\mathcal{F}, P)^2 \left( r_q(\delta_q, \mathcal{F}, P) \vee r_m(\delta_m, \mathcal{F}, P) + \kappa_2(\mathcal{F}, P) \sqrt{\varepsilon + \frac{1}{n} \ln \left( \frac{1}{\alpha} \right)} \right), \quad (23)$$

with smaller values of $\delta_m$ and $\delta_q$ than we require. Our bound compares favorably with (23) because it has better dependence on the moment parameters $\kappa_p(\mathcal{F}, P)$. In particular, Remark 9 shows that the contamination term involving $\varepsilon$ in our theorem is optimal.

**Remark 7.** Lecué and Lerasle [31] also consider regularized versions of Problem 3 and do not assume equally distributed random variables. In this paper, we do not consider either generalization.

**Remark 8.** As in [31], Theorem 5.1 requires a restriction that $\varepsilon \le c \theta_0(\mathcal{F}, P)^{-2}$ for some positive $c > 0$. Appendix F explains why some such restriction is necessary for any method, and shows this relates to §7.2.

**Remark 9.** We also notice that the contamination and the fluctuation terms in Theorem 5.1 are optimal up to constants. To see this recall that if $\mu$ is the mean of a square-integrable random variable $Y$ taking values on $\mathbb{R}$, then

$$\mu = \arg \min_{\mu' \in \mathbb{R}} \mathbb{E}(Y - \mu')^2.$$

Thus, in this setup, quadratic risk minimization over the class $\mathcal{F}$ of constant functions can be used to estimate the mean. Since Theorem 5.1 matches the optimal fluctuation and contamination terms for mean estimation, it must be optimal.
# 6 Algorithms for robust linear regression

We now present some heuristics for linear regression that are related to the theoretical results in Theorem 5.1. Our main finding, presented in §7, is that trimmed-mean-based methods tend to outperform ordinary least squares and robust alternatives based on median-of-means.

Before describing our heuristics, we note that Theorem 5.1 does not translate directly into a practical method. First of all, the definition of $\hat{f}_n^\epsilon$ requires a choice of confidence level $1 - \alpha$, which is (theoretically) unavoidable for any estimator [5, Theorem 3.2]. Theorem 5.1 also requires some knowledge of the contamination level $\epsilon$, which is also unavoidable for trimmed-mean-based methods. Finally, the min-max problem (18) defining $\hat{f}_n^\epsilon$ poses computational challenges.

Nevertheless, we will argue that there are practical ways to choose the trimming parameter $k$ and to compute regressors that circumvent these challenges. This requires several algorithmic choices that we describe below.

In our experiments, we compare our method to the following procedures: a variant of the Median of-Means regression procedure of [31]; regression with Huber loss; quantile regression for the median quantile; and ordinary least squares. The Supplementary Material discusses these methods in great detail.

## 6.1 Preliminaries

We work in the setting of linear regression, corresponding to Example 1 above. For $\beta \in \mathbb{R}^d$, we write $\ell_\beta(x, y) := (\langle\beta, x\rangle - y)^2$ to denote the loss associated with the linear regression function $\langle\beta, \cdot\rangle$ on a point $(x, y) \in \mathbb{R}^d \times \mathbb{R}$. Given a trimming parameter $k \in [n]$; points $z_i = (x_i, y_i) \in \mathbb{R}^d \times \mathbb{R}$, $i \in [n]$; and vectors $\beta^m, \beta^M \in \mathbb{R}^d$, we may write:

$$ \hat{T}_{n,k} (\ell_{\beta^m} - \ell_{\beta^M}; z_{1:n}) = \frac{1}{n-2k} \sum_{i \in I_k(\beta^m, \beta^M, z_{1:n})} ((\langle x_i, \beta^m \rangle - y_i)^2 - (\langle x_i, \beta^M \rangle - y_i)^2), $$

where $I_k(\beta^m, \beta^M, z_{1:n})$ – called the active set for $(\beta^m, \beta^M, z_{1:n})$ – is the set of indices $i \in [n]$ that appear in the trimmed mean, i.e., the set obtained once the $k$ largest and $k$ smallest values of $(\langle x_i, \beta^m \rangle - y_i)^2 - (\langle x_i, \beta^M \rangle - y_i)^2$ are removed (with ties broken arbitrarily). Our heuristic will be described in two steps. First, we describe how to optimize the choice of $\beta^m$ and $\beta^M$ for a specific $k$. Second, we present a cross-validation procedure to choose the trimming parameter.

## 6.2 Optimization for a fixed trimming level

Assume that the trimming parameter is fixed at some value $k$. To find a good regressor for this trimming level, we apply the Plug-in Method described in Algorithm 1. It relies on the existence of a black-box function Fit that on input $((x_i, y_i))_{i \in I}$ (with $I \subset [n]$ nonempty) will return a vector

$$ \beta((x_i, y_i)_{i \in I}) \in \arg\min_{\beta \in \mathbb{R}^d} \frac{1}{|I|} \sum_{i \in I} (\langle \beta, x_i \rangle - y_i)^2. $$

The idea is that the set $I$ will correspond to the set of active indices, of size $(1 - 2\phi)n = n - 2k$. The algorithm alternates between optimizing $\beta^m$ and $\beta^M$ for a fixed set $I$, and updating $I$ to be the current active set. The output of the algorithm is vector produced in the iterations that minimizes the trimmed mean estimate of the loss.

In our experiments, we set the number of iterations to $T_{max} = 20$ and implement Fit via the lstsq procedure from the numpy.linalg library in Python. The initial choices for $\beta_0^m, \beta_0^M$ are random perturbations of OLS solutions on the full data; see Appendix G for details. Before continuing, we note that other optimization heuristics are possible, including variants of the ADMM procedure in [31]. As discussed in Appendix H, we choose the Plug-in method because it outperforms the alternatives in experiments.

## 6.3 Trimming level selection via cross-validation

We now consider the problem of choosing the trimming level $k$ for best-possible performance. We here call $\phi \in [0, 1]$ a trimming ratio and $k$ a trimming level, both quantities are related by $k = \lfloor \phi n \rfloor$. Following [31] we choose $k$ via a cross-validation procedure. Let $(z_i)_{i=1}^n = (x_i, y_i)_{i=1}^n$ be the data points. Assume that $\phi_1 \le \phi_2 \le \cdots \le \phi_m$ is an ordered grid of possible choices for $\phi$. Let $v \le n$ be the number of folds: that is, $[n]$ is partitioned into sets $\{B_l\}_{l=1}^v$ with respective sizes $n_l := |B_l| \in \{\lfloor n/v \rfloor, \lfloor n/v \rfloor + 1\}$. The procedure works as follows.
**input**: $(x_1, y_1), \dots, (x_n, y_n) \in \mathbb{R}^d \times \mathbb{R}$: the data
$\beta_0^m, \beta_0^M \in \mathbb{R}^d$: initial guesses
$\phi$: trimming ratio
$T_{\max}$: number of iterations

**output**: $\beta_{\phi}^*$: an approximate solution for the min-max problem

$t \leftarrow 0$
$k \leftarrow \lfloor \phi n \rfloor$ (obtain trimming level)

**while** $t < T_{\max}$ **do**
  $I_t^m \leftarrow I_k(\beta_t^m, \beta_t^M, z_{1:n})$ (get active indices)
  $\beta_{t+1}^m \leftarrow \text{Fit}(\{(x_i, y_i)\}_{i \in I_t^m})$
  $I_t^M \leftarrow I_k(\beta_{t+1}^m, \beta_t^M, z_{1:n})$ (update active indices)
  $\beta_{t+1}^M \leftarrow \text{Fit}(\{(x_i, y_i)\}_{i \in I_t^M})$
  $t \leftarrow t + 1$

**end**
$\beta_{\phi}^* \leftarrow \arg \min \{\hat{T}_{n,k}(\ell_{\beta}, z_{1:n}) : \beta \in \bigcup_{t=1}^{T_{\max}} \{\beta_t^m, \beta_t^M\}\}$.

<caption>**Algorithm 1:** Plug-in algorithm.</caption>

1. For each choice of $(j, l) \in [m] \times [v]$, let $\beta_{\phi_j}^*([n] - B_l)$ be the output of Algorithm 1 on the $n - n_l$ data points $(x_i, y_i)_{i \notin B_l}$.

2. For each choice of $(j, l) \in [m] \times [v]$, estimate the loss of $\beta_{\phi_j}^*([n] - B_l)$ via a trimmed mean with ratio $\phi_j$ on the fold $B_l$:

$$L(j, l) := \hat{T}_{n_l, \phi_j n_l} (\ell_{f_{j,l}}, (z_i)_{i \in B_l}).$$

3. For each $j \in [m]$, associate a loss with trimming ratio $\phi_j$ via

$$L(j) := \text{median}(L(j, l) : l \in [v]).$$

4. Choose $\phi^* = \phi_{j^*}$ where $j^* = \arg \max_{j=2, \dots, m} \frac{L(j-1)}{L(j)}$.

5. Compute the final estimator $\beta_{\phi^*}^*$ by running Algorithm 1 with trimming ratio $\phi^*$ on the full dataset $(z_i)_{i \in [n]}$.

Intuitively, the choice of trimming ratio $\phi^* = \phi_{j^*}$ corresponds to the point at which increasing $j$ induces the largest drop in the loss. This is inspired by the Slope Heuristic [52]. Another natural choice is to choose $j^*$ as minimizer of $L(j)$; this method is inspired by [31] and considered in the SM. We note in passing that we have fixed $v = 5$ as the number of folds in all our experiments.

## 6.4 Other benchmarks

We compare the performance of the trimmed mean estimator against four benchmarks: ordinary least squares, quantile regression, a variant of the Median of Means (MoM) procedure from [31], and Huber regression.

OLS and quantile regression are classical methods. OLS has no parameters, and quantile regression depends only on the quantile level, which we fix at $q = 1/2$ (median regression). We rely on the implementation of these methods in `sklearn`.

MoM requires splitting the $n$ data points into $K$ buckets of approximately equal size. This parameter $K$ is a close analogue of the trimming parameter $k$ in our procedure, and we adapted to MoM the optimization and cross validation procedures described for TM. In brief:

* To adapt Algorithm 1, we use a different concept of active set. Consider the blocks $A_1, \dots, A_K \subset [n]$ used by the median-of-means construction. Then the active set $I_k(\beta^m, \beta^M)$ is the block of indices $A_r$ for which

$$M_r := \frac{1}{\#A_r} \sum_{i \in A_r} (\ell_{\beta^m}(x_i, y_i) - \ell_{\beta^M}(x_i, y_i))$$

realized the median over all $\{M_s : s \in [K]\}$ with ties between blocks broken arbitrarily.
* When performing the optimization iterations, the blocks of median-of-means are resampled uniformly at random at each step.

* The cross validation procedure is now over choices of $K_j$. However, the loss estimate $L(j, l)$ are performed via a MoM estimator using the data in fold $B_l$ with $K_j/v$ blocks.

These procedures are detailed and contrasted with potential alternatives in Appendix H. Importantly, the original algorithm in [31] was designed for sparse linear regression in a $d \gg n$ setting. By contrast, we consider $d \ll n$, and our algorithmic choices for MoM were optimized for this case. This explains why our version of the MoM method is somewhat different from that in [31].

Finally, Huber regression [3] is a robust regression method where the loss function interpolates between quadratic error and absolute error. A shape parameter $M \ge 1$ controls this interpolation; we select it via cross validation from a grid described in the next section. However, instead of using the slope heuristic we take $j^* = \arg \min_{j=1,...,m} L(j)$ (Appendix G explains this choice). We use the `sklearn` implementation of this method.

# 7 Experiments with linear regression

We perform experiments in two data generation setups. Setup A (§7.1) favors robust methods and is analogous to [31]. Setup B (§7.2) is closely related to Remark 8 and favors the OLS. In our experiments, the cross-validation procedure (§6.3) uses $v = 5$ folds and selects the TM ratio $\phi$ among the values in

$$ \Lambda := \left\{ \varepsilon' + \frac{1}{30} : \varepsilon' \in \left\{ 0, \frac{2}{100}, \frac{4}{100}, \frac{6}{100}, \frac{8}{100}, \frac{10}{100}, \frac{15}{100}, \frac{20}{100}, \frac{30}{100}, \frac{40}{100} \right\} \right\}. $$

The number of buckets $K$ for MoM from the values in $\{[2\phi n + 1] : \phi \in \Lambda\}$. The shape parameter $M$ for Huber regression is selected over 10 evenly spaced values between 1 and 1.35 (Huber [3] recommends $M = 1.35$ to obtain as much robustness as possible while retaining high statistical efficiency on Gaussian data). Each parameter combination underwent 96 runs of the experiment.

## 7.1 Setup A

Let $d \ge 1$ be an integer and $X_1, X_2, \dots, X_n$ be i.i.d. standard Gaussian's. Define $Y_i = \langle X_i, \beta^* \rangle + \xi_i \forall i \in [n]$, where $\beta^* = \frac{1}{\sqrt{d}} [1, 1, \dots, 1] \in \mathbb{R}^d$ and $\xi_i$ are i.i.d. errors. The distribution of $\xi_i$ follows the skewed generalized t distribution proposed in [53], which has parameters $\mu, \sigma, \beta, \alpha$, and $\lambda$. We vary the parameters $\alpha > 0$ and $\lambda \in (-1, 1)$, which control moments and skew, respectively. We set $\mu = 0, \sigma = 1$, and $\beta = 2$ so that when $\lambda = 0$ the distribution yields the classical Student's t with $2\alpha$ degrees of freedom and the Gaussian taking $\alpha = \infty$. Taking $\lambda \ne 0$ adds skew to these distributions, with direction given by the sign of $\lambda$. The contamination model for Setup A is defined as follows: a set of indices $O \subset [n]$ of size $\lceil \varepsilon n \rceil$ is chosen uniformly at random, and then one sets

$$ (X_i^\varepsilon, Y_i^\varepsilon) = (X_i, Y_i) \quad \forall i \notin O \text{ and } (X_i^\varepsilon, Y_i^\varepsilon) = (\beta^*, 10000) \quad \forall i \in O. $$

Table 1 presents our results on four contamination levels. When $\varepsilon > 0$, we not display the results for OLS because they are much larger than other benchmarks. We make the following observations:

* In extreme cases where $\xi$ doesn't even have first moment (i.e., $\alpha = 0.5$), quantile regression and MoM perform better; MoM is the best of the two at the largest contamination level we consider.

* When $\alpha \ge 1$, Huber regression and the TM have comparable performance, and TM does better at more skewed distributions.

More extensive experiments on variants of Setup A are presented in Appendix H.

## 7.2 Setup B

This distribution and contamination model are a caricature of missing data and favors OLS. Let $p \in (0, 1]$. Take independent

$$ X'_{1:n} \stackrel{\text{i.i.d.}}{\sim} \text{Normal}(0_d, I_{d \times d}), \quad \xi_{1:n} \stackrel{\text{i.i.d.}}{\sim} \text{Normal}(0, 1) \text{ and } B'_{1:n} \stackrel{\text{i.i.d.}}{\sim} \text{Ber}(p). $$

As before, let $\beta^* = \frac{1}{d}[1, 1, \dots, 1]$. The uncontaminated data is given by

$$ X_i := B_i \frac{X'_i}{\sqrt{p}} \text{ and } Y_i = \langle X_i, \beta^* \rangle + \xi_i \forall i \in [n]. $$
<table><caption>Table 1: Average $\|\hat{\beta}_n - \beta^*\|_2$ for several moment and skew configurations.</caption><thead><tr><th rowspan="2">λ</th><th rowspan="2"></th><th colspan="4">α = 0.5</th><th colspan="4">α = 1</th><th colspan="4">α = ∞</th></tr><tr><th>0.0</th><th>0.3</th><th>0.6</th><th>0.9</th><th>0.0</th><th>0.3</th><th>0.6</th><th>0.9</th><th>0.0</th><th>0.3</th><th>0.6</th><th>0.9</th></tr></thead><tbody><tr><td rowspan="4">ε = 0 (no cv)</td><td>HUBER</td><td>0.47</td><td>0.49</td><td>0.60</td><td>0.86</td><td><strong>0.36</strong></td><td><strong>0.40</strong></td><td><strong>0.50</strong></td><td><strong>0.60</strong></td><td>0.28</td><td>0.28</td><td>0.31</td><td>0.33</td></tr><tr><td>MOM</td><td>3.13</td><td>3.64</td><td>4.35</td><td>5.65</td><td>0.95</td><td>1.05</td><td>1.12</td><td>1.31</td><td>0.53</td><td>0.54</td><td>0.58</td><td>0.59</td></tr><tr><td>OLS</td><td>16.03</td><td>19.23</td><td>24.11</td><td>29.44</td><td>0.79</td><td>0.86</td><td>1.05</td><td>1.25</td><td><strong>0.27</strong></td><td><strong>0.27</strong></td><td><strong>0.29</strong></td><td><strong>0.31</strong></td></tr><tr><td>QUANTILE</td><td><strong>0.45</strong></td><td><strong>0.46</strong></td><td><strong>0.53</strong></td><td><strong>0.77</strong></td><td>0.39</td><td>0.48</td><td>0.66</td><td>0.85</td><td>0.33</td><td>0.34</td><td>0.38</td><td>0.42</td></tr><tr><td rowspan="4">ε = 0.1</td><td>TM</td><td>1.33</td><td>1.46</td><td>1.83</td><td>2.44</td><td>0.47</td><td>0.48</td><td>0.54</td><td>0.64</td><td>0.29</td><td>0.28</td><td>0.29</td><td>0.31</td></tr><tr><td>HUBER</td><td><strong>0.52</strong></td><td>0.54</td><td>0.63</td><td><strong>0.90</strong></td><td><strong>0.42</strong></td><td><strong>0.47</strong></td><td>0.64</td><td>0.82</td><td>0.33</td><td>0.33</td><td>0.36</td><td>0.39</td></tr><tr><td>MOM</td><td>2.72</td><td>3.07</td><td>2.05</td><td>2.64</td><td>1.52</td><td>1.48</td><td>1.60</td><td>1.71</td><td>0.89</td><td>0.90</td><td>0.94</td><td>0.93</td></tr><tr><td>QUANTILE</td><td>0.52</td><td><strong>0.53</strong></td><td><strong>0.62</strong></td><td>0.91</td><td>0.44</td><td>0.54</td><td>0.73</td><td>0.93</td><td>0.37</td><td>0.39</td><td>0.43</td><td>0.47</td></tr><tr><td rowspan="4">ε = 0.2</td><td>TM</td><td>1.18</td><td>1.80</td><td>1.95</td><td>2.71</td><td>0.50</td><td>0.51</td><td><strong>0.62</strong></td><td><strong>0.72</strong></td><td><strong>0.32</strong></td><td><strong>0.32</strong></td><td><strong>0.33</strong></td><td><strong>0.36</strong></td></tr><tr><td>HUBER</td><td>0.61</td><td>0.64</td><td>0.76</td><td><strong>1.08</strong></td><td><strong>0.49</strong></td><td><strong>0.54</strong></td><td>0.72</td><td>0.93</td><td>0.40</td><td>0.38</td><td>0.42</td><td>0.46</td></tr><tr><td>MOM</td><td>1.09</td><td>1.17</td><td>1.19</td><td>1.34</td><td>0.99</td><td>0.99</td><td>1.05</td><td>1.11</td><td>2.18</td><td>1.86</td><td>1.88</td><td>2.93</td></tr><tr><td>QUANTILE</td><td><strong>0.61</strong></td><td><strong>0.63</strong></td><td><strong>0.75</strong></td><td>1.10</td><td>0.51</td><td>0.59</td><td>0.80</td><td>1.01</td><td>0.43</td><td>0.43</td><td>0.48</td><td>0.53</td></tr><tr><td rowspan="4">ε = 0.4</td><td>TM</td><td>0.85</td><td>0.90</td><td>1.14</td><td>1.64</td><td>0.50</td><td>0.54</td><td><strong>0.65</strong></td><td><strong>0.80</strong></td><td><strong>0.37</strong></td><td><strong>0.37</strong></td><td><strong>0.40</strong></td><td><strong>0.43</strong></td></tr><tr><td>HUBER</td><td>0.98</td><td>1.07</td><td>1.31</td><td>1.84</td><td>0.77</td><td><strong>0.86</strong></td><td>1.08</td><td>1.35</td><td><strong>0.62</strong></td><td><strong>0.60</strong></td><td><strong>0.64</strong></td><td><strong>0.70</strong></td></tr><tr><td>MOM</td><td>1.01</td><td><strong>1.03</strong></td><td><strong>1.01</strong></td><td><strong>1.06</strong></td><td>1.01</td><td>0.99</td><td><strong>0.99</strong></td><td><strong>1.02</strong></td><td>0.97</td><td>0.98</td><td>0.97</td><td>0.98</td></tr><tr><td>QUANTILE</td><td><strong>0.97</strong></td><td>1.03</td><td>1.30</td><td>1.84</td><td><strong>0.76</strong></td><td>0.86</td><td>1.14</td><td>1.41</td><td>0.63</td><td>0.61</td><td>0.68</td><td>0.74</td></tr><tr><td></td><td>TM</td><td>2.04</td><td>2.29</td><td>2.58</td><td>3.50</td><td>1.01</td><td>1.13</td><td>1.34</td><td>1.78</td><td>0.74</td><td>0.68</td><td>0.72</td><td>0.80</td></tr></tbody></table>

<figure><img src="image_3.png" /><figcaption>Figure 1: Experiments varying the contamination proportion using Setup B, left panel with $p = 0.05$ and right panel with $p = 0.09$.</figcaption></figure>

The contamination model is defined as follows. Take a subset $O \subset \{i \in [n] : B_i = 1\}$ that satisfies $|O| \le \varepsilon n$ and is as large as possible. Set $B_i^\varepsilon = 0$ when $B_i = 0$ or $i \in O$, and $B_i^\varepsilon = 1$ otherwise. The contaminated sample is

$$X_i^\varepsilon = B_i^\varepsilon \frac{X_i'}{\sqrt{p}} \quad \text{and} \quad Y_i^\varepsilon = \langle X_i^\varepsilon, \beta^* \rangle + \xi_i \quad \forall i \in [n].$$

Figure 1 displays the performance of all methods in consideration in Setup B with $d = 5$ and $n = 1000$. It contrasts with Table 1 since the OLS is no longer losing to the robust estimators in most cases. Intuitively, OLS ignores points with $B_i^\varepsilon = 0$. The performance of TM, OLS, Huber and Quantile are similar, whereas MoM can often be significantly worse.

## 8 Proofs

This section presents the main mathematical arguments in the paper. Some not-too-enlightening details are left to the supplementary material.
## 8.1 Trimming and truncation: a master theorem

The main results in this paper follow from the “master theorem” presented in this section. It may be viewed as an abstract and extended version of the arguments in [10], which were specific for mean estimation in Hilbert spaces. In this subsection, $P$ is a fixed probability measure over a measurable space $(\mathbf{X}, \mathcal{X})$, and $X_{1:n}^\epsilon$ is an $\epsilon$-contaminated sample from $P$. For a given $M > 0$, let

$$ \tau_M(x) := \begin{cases} M, & \text{if } x > M \\ x, & \text{if } -M \le x \le M \\ -M, & \text{if } x < -M \end{cases}. \qquad (24) $$

be called the truncation function. If $\mathcal{G}$ is a family of functions, we let

$$ \mathcal{G}^o := \{g - Pg : g \in \mathcal{G}\}, \quad \mathcal{G}_M^o := \{\tau_M \circ (g - Pg) : g \in \mathcal{G}\} $$

and also $\mathrm{rem}_M(\mathcal{G}, P) := \sup_{g \in \mathcal{G}} |P\tau_M \circ g|$.

**Theorem 8.1 (Master theorem for trimmed mean).** Let $m \in \mathbb{N}$ and $\mathcal{F}_1, \mathcal{F}_2, \dots, \mathcal{F}_m$ be families of functions that are 1-compatible with $P$. Also let $X_{1:n}^\epsilon$ be an $\epsilon$-contaminated i.i.d. sample from $P$. Assume that for every $j \in [m]$ there exist $M_j > 0$, $b_j \in \{0, 1\}$ and $t_j \in \mathbb{N} \cup \{0\}$ satisfying one of the following conditions:

* either $b_j = 0$, $t_j = 0$ and $\mathcal{F}_j^o$ is a.s. uniformly bounded by $M_j$, i.e. $|f_j - Pf_j| \le M_j$ almost surely for all $f_j \in \mathcal{F}_j$;

* or $b_j = 1$ and we have the bound

$$ \sup_{f_j \in \mathcal{F}_j} P \left\{ |f_j(X) - Pf_j| > \frac{M_j}{2} \right\} + \frac{8 \mathrm{Rad}_n(\tau_{M_j} \circ \mathcal{F}_j^o, P)}{M_j} \le \frac{t_j}{8n}. \qquad (25) $$

Also let $\phi$ be such that

$$ \frac{|\epsilon n| + \sum_{j=1}^{m} t_j}{n} \le \phi < \frac{1}{2}. $$

Let $x_j \ge 0$ for each $j \in [m]$. Then, with probability at least $1 - \sum_{j=1}^m (b_j e^{-t_j} + e^{-x_j})$, for every linear combination $f = \sum_{j=1}^m a_j f_j$, $f_j \in \mathcal{F}_j$,

$$ |\hat{T}_{n,\phi n}(f; X_{1:n}^\epsilon) - Pf| \le \sum_{j=1}^{n} |a_j| \{2\mathrm{Emp}_n(\tau_{M_j} \circ \mathcal{F}_j^o, P) + \eta_j\}, $$

where

$$ \eta_j = \left(6\phi + \frac{3x_j}{n}\right) M_j + \mathrm{rem}_{M_j}(\mathcal{F}_j^o, P) + \nu_2(\tau_{M_j} \circ \mathcal{F}_j^o, P) \sqrt{\frac{2x_j}{n}}. $$

*Proof of Theorem 8.1.* We start with some notation and conventions. For brevity, we will occasionally omit $P$ from our notation; for instance, we write $\mathrm{Emp}_n(\mathcal{F})$ instead of $\mathrm{Emp}_n(\mathcal{F}, P)$. We also let $X_{1:n}^{\epsilon, \text{i.i.d.}} \sim P$ be a sample from $P$ with $\#\{i \in [n] : X_i \ne X_i^\epsilon\} \le |\epsilon n|$.

$\hat{P}_n$ denotes the empirical measure of the clean sample, meaning:

$$ \hat{P}_n g = \frac{1}{n} \sum_{i=1}^{n} g(X_i) \text{ for } g : \mathbf{X} \to \mathbb{R}, $$

and we use $\hat{T}_{n,\phi n}^\epsilon(g) := \hat{T}_{n,\phi n}(g; X_{1:n}^\epsilon)$ to denote the trimmed mean computed over the contaminated sample.

The core observation of our proof is that if $k \in \mathbb{N}$ is properly defined and the $M_j$ are big enough, the “trimmed empirical process” of linear combinations on a contaminated sample is close to the linear combination of truncated empirical processes on the clean sample, i.e.

$$ f = \sum_{j=1}^{m} a_j f_j \mapsto \hat{T}_{n,k}^\epsilon(f) - Pf \approx \sum_{j=1}^{m} a_j \hat{P}_n \tau_{M_j}(f_j(X_i) - Pf_j), \qquad (26) $$
which is well understood and satisfies Bernstein-type concentration bounds. This will require two lemmata that we state next. Let $\mathcal{G}$ be a family of functions and $M > 0$, define

$$V_M(\mathcal{G}) := \sup_{g \in \mathcal{G}} \sum_{i=1}^{n} \mathbf{1}\{|g(X_i)| > M\}, \qquad (27)$$

in words, $V_M(\mathcal{G})$ counts the number of large values of $g$ for the worst-case function $g \in \mathcal{G}$.

The following “Counting Lemma” – an abstract version of [10, Lemma 1] – gives a way to bound the probability that the counting function $V_{M_j}(\mathcal{F}_j^o)$ exceeds a certain value $t_j$. This will be useful whenever $\mathcal{F}_j^o$ is not uniformly bounded.

**Lemma 8.2** (Counting lemma; proof in Appendix A). Let $\mathcal{G}$ be a countable family of functions, $t \in \mathbb{N}$ and $n > 1$. Assume $M > 0$ is such that:

$$\sup_{g \in \mathcal{G}} P \left\{ |g(X)| > \frac{M}{2} \right\} + \frac{8 \mathrm{Rad}_n(\tau_M \circ \mathcal{G}, P)}{M} \le \frac{t}{8n}. \qquad (28)$$

Then $V_M(\mathcal{G}) \le t$ with probability at least $1 - e^{-t}$.

The next lemma says that if the counting functions $\{V_{M_j}(\mathcal{F}_j^o)\}_{j \in [m]}$ are all small, then (26) can be justified.

**Lemma 8.3** (Bounding lemma; proof in Appendix A). Let $m \in \mathbb{N}$ and $\mathcal{G}_1, \dots, \mathcal{G}_m$ be families of functions from $\mathbf{X}$ to $\mathbb{R}$. Also let $t_1, t_2, \dots, t_m \in \mathbb{N}$ and $M_1, M_2, \dots, M_m \ge 0$ be such that $V_{M_j}(\mathcal{G}_j) \le t_j$ for each $j \in [m]$. If $\phi$ satisfies

$$\frac{|\epsilon n| + \sum_{j=1}^{m} t_j}{n} \le \phi < \frac{1}{2},$$

then for any linear combination

$$g := \sum_{j=1}^{m} a_j g_j \text{ with } a_j \in \mathbb{R} \text{ and } g_j \in \mathcal{G}_j \text{ for each } j \in [m],$$

we have

$$\left| \hat{T}_{n, \phi n}^{\epsilon}(g) - \sum_{j=1}^{m} a_j \hat{P}_n(\tau_{M_j} \circ g_j) \right| \le 6\phi \sum_{j=1}^{m} |a_j| M_j. \qquad (29)$$

We come back to the proof of Theorem 8.1. Since the families $\mathcal{F}_j$ are 1-compatible with $P$, we may assume they are countable. Our hypotheses ensure that Lemma 8.2 can be applied to each $V_{M_j}(\mathcal{F}_j^o)$ (with the corresponding $t_j$) whenever $b_j = 1$. On the other hand, when $b_j = 0$, the class $\mathcal{F}_j^o$ is bounded and $V_{M_j}(\mathcal{F}_j^o) = 0 \le t_j$ is automatic. Combining this with Lemma 8.3 (taking $\mathcal{G}_j = \mathcal{F}_j^o$ for every $j \in [m]$) we have, with probability at least $1 - \sum_{j=1}^{m} b_j e^{-t_j}$, for all $f = \sum_{j=1}^{m} a_j f_j$,

$$\left| \hat{T}_{n, \phi n}^{\epsilon}(f) - Pf \right| \le \left| \sum_{j=1}^{m} a_j \hat{P}_n \tau_{M_j} (f_j - Pf_j) \right| + 6\phi \sum_{j=1}^{m} |a_j| M_j.$$

We can bound

$$\left| \sum_{j=1}^{m} a_j \hat{P}_n \tau_{M_j} (f_j - Pf_j) \right| \le \sum_{j=1}^{m} |a_j| \left\{ \sup_{f_j \in \mathcal{F}_j} \left| (\hat{P}_n - P) \tau_{M_j} (f_j - Pf_j) \right| + \mathrm{rem}_{M_j}(\mathcal{F}_j^o, P) \right\}$$

We bound the suprema on the RHS using Bousquet’s version of Talagrand’s concentration inequality for each class $\mathcal{F}_j^o$ (Theorem B.1) and observing that

$$|\tau_{M_j}(f_j - Pf_j) - P\tau_{M_j}(f_j - Pf_j)| \le 2M_j.$$

We finish using $\sqrt{a+b} \le \sqrt{a} + \sqrt{b}$ and $\sqrt{ab} \le a + \frac{b}{4}$ to bound:

$$\sqrt{\frac{8x_j M_j}{n} \mathrm{Emp}_n(\tau_{M_j} \circ \mathcal{F}_j^o, P)} \le \frac{2x_j}{n} M_j + \mathrm{Emp}_n(\tau_{M_j} \circ \mathcal{F}_j^o, P).$$

□
## 8.2 Bounds for uniform mean estimation

We now prove our main result on uniform mean estimation, Theorem 3.1. This will require converting the error bounds in Theorem 8.1 into moment-based quantities. The next lemma does this; it is somewhat stronger than what we need.

**Lemma 8.4 (Proof in the supplementary material).** Let $\mathcal{F}_j, t_j, b_j, x_j$ and $M_j$ satisfy the hypothesis of Theorem 8.1, define

$$ \bar{\varepsilon} := \frac{\left(\frac{1}{2} - \varepsilon\right) \wedge \varepsilon}{1 + \sum_{j=1}^{m} b_j}, \quad t_j = b_j (\lceil x_j \rceil \vee \lceil \bar{\varepsilon}n \rceil) \quad \text{and} \quad \phi := \frac{\lceil \bar{\varepsilon}n \rceil + \sum_{j=1}^{m} t_j}{n}. $$

Also assume $\phi < \frac{1}{2}$, $x_j \ge \frac{1}{3}$ for all $j$ with $b_j = 1$ and let

$$ C_j^{\varepsilon} := 192 \left( 1 + \frac{\sum_{l=1}^{m} t_l}{t_j} + \frac{\varepsilon}{\bar{\varepsilon}} \right). $$

Then, for every $j$ with $b_j = 1$, it is possible to choose $M_j$ satisfying (25) such that

$$ 2\text{Emp}_n(\tau_{M_j} \circ \mathcal{F}_j^o, P) + \eta_j \le C_j^{\varepsilon} \left\{ \begin{aligned} & 8\text{Emp}_n(\mathcal{F}_j, P) + \inf_{q \in [1,2]} \nu_q(\mathcal{F}_j, P) \left(\frac{x_j}{n}\right)^{1-\frac{1}{q}} \\ & + \inf_{p \ge 1} \nu_p(\mathcal{F}_j, P) \left(\frac{2\varepsilon}{1 + \sum_{l=1}^m b_l}\right)^{1-\frac{1}{p}} \end{aligned} \right\}. \quad (30) $$

*Proof of Theorem 3.1.* Apply Theorem 8.1 using $m = 1$, $b_1 = 1$, $x_1 := \ln \frac{3}{\alpha}$ with $t_1$ and $M_1$ as chosen in the Lemma 8.4. Inspection reveals that this leads to the bound claimed in Theorem 3.1. $\square$

## A Proofs of the counting and bounding lemmata

*Proof of Lemma 8.2.* As in [10, Lemma 1], we replace $V_M(\mathcal{G})$ by a smoother empirical process upper bound to which we will be able to apply Ledoux-Talagrand contraction and Bousquet's version of Talagrand's concentration inequality. Specifically, we define

$$ \eta_M(r) := \left( \frac{2}{M} \left( r - \frac{M}{2} \right)_+ \right) \wedge 1 (r \in \mathbb{R}), $$

which is $2/M$-Lipschitz and satisfies

$$ \forall r \ge 0 : \mathbf{1}\{r > M\} \le \eta_M(r) \le \mathbf{1}\{r > M/2\}. $$

Notice that $\eta_M = \eta_M \circ \tau_M$, a fact that will be useful later.

To continue, we note that

$$ \forall g \in \mathcal{G} : P(\eta_M \circ |g|)^2 \le P(\eta_M \circ |g|) \le P\left\{|g(X)| > \frac{M}{2}\right\}. \quad (31) $$

One consequence of this is that

$$ V_M(\mathcal{G}) = \sup_{g \in \mathcal{G}} \sum_{i=1}^{n} \mathbf{1}\{|g(X_i)| > M\} \le \sup_{g \in \mathcal{G}} \sum_{i=1}^{n} \eta_M \circ |g(X_i)| \le n \sup_{g \in \mathcal{G}} P\{|g(X)| > \frac{M}{2}\} + nW $$

where $W$ is the empirical process

$$ W := \sup_{g \in \mathcal{G}} \left| \frac{1}{n} \sum_{i=1}^{n} (\eta_M \circ |g(X_i)| - P(\eta_M \circ |g|)) \right|. $$

Therefore,

$$ \mathbb{P}\{V_M(\mathcal{G}) > t\} \le \mathbb{P}\left\{W > \frac{t}{n} - \sup_{g \in \mathcal{G}} P\{|g(X)| > \frac{M}{2}\}\right\}, $$
and the present lemma will follow once we bound the RHS above by $e^{-t}$. To do so, we apply Bousquet's version of Talagrand's concentration inequality (Theorem B.1) to the class $\eta_M \circ |\mathcal{G}| = \{\eta_M(|g|) : g \in \mathcal{G}\}$ with $C = 1$ (as $0 \le \eta_M \le 1$). Letting $v = n\sigma^2(\eta_M \circ |\mathcal{G}|) + 2\text{Emp}_n(\eta_M \circ |\mathcal{G}|, P)$ be as in Theorem B.1, we deduce

$$ \mathbb{P} \left\{ W > \text{Emp}_n(\eta_M \circ |\mathcal{G}|, P) + \sqrt{\frac{2vt}{n}} + \frac{t}{3n} \right\} \le e^{-t}. $$

Therefore, we will be done once we show that

$$ t \ge n \sup_{g \in \mathcal{G}} P \left\{ |g(X)| > \frac{M}{2} \right\} + n \text{Emp}_n(\eta_M \circ |\mathcal{G}|, P) + \sqrt{2vtn} + \frac{t}{3}. $$

To prove this last inequality, we bound the empirical process via symmetrization, contraction ($\eta_M$ is $2/M$-Lipschitz), the fact that $\eta_M \circ |\cdot| = \eta_M \circ |\tau_M|$, and our assumption (28) relating $t$, $M$ and $n$:

$$ \begin{aligned} \text{Emp}(\eta_M \circ |\mathcal{G}|, P) &\le 2\text{Rad}_n(\eta_M \circ |\mathcal{G}|, P) \\ (\eta_M \circ |\cdot| = \eta_M \circ |\tau_M|) &= 2\text{Rad}_n(\eta_M \circ |\tau_M \circ \mathcal{G}|, P) \end{aligned} $$

$$ (\text{contraction} + \eta_M \circ |\cdot| \text{ is } 2/M\text{-Lip.}) \le \frac{4}{M} \text{Rad}_n(\tau_M \circ \mathcal{G}, P) $$

To bound $\sigma^2(\eta_M \circ |\mathcal{G}|)$, we use (31):

$$ \sigma^2(\eta_M \circ |\mathcal{G}|) = \sup_{g \in \mathcal{G}} P(\eta_M(|g|) - P\eta_M(|g|))^2 \le \sup_{g \in \mathcal{G}} P\left\{|g(X)| > \frac{M}{2}\right\}. $$

As a consequence, the variance parameter $v$ in Bousquet's version of Talagrand's concentration inequality can be bounded using (28):

$$ nv \le n \sup_{g \in \mathcal{G}} P \left\{ |g(X)| > \frac{M}{2} \right\} + \frac{8n \text{Rad}_n(\tau_M \circ \mathcal{G}, P)}{M} \le \frac{t}{8}. $$

Combining the above bounds, we arrive at

$$ \frac{t}{3} + \sqrt{2vtn} + n \text{Emp}_n(\eta_M \circ |\mathcal{G}|, P) + n \sup_{g \in \mathcal{G}} P \left\{ |g(X)| > \frac{M}{2} \right\} \le \frac{t}{3} + \frac{t}{2} + \frac{t}{8} $$

which is enough to conclude the proof. $\square$

**Proof of Lemma 8.3.** Define $\tilde{g}_j := a_j g_j$ and $\tilde{M}_j := |a_j| M_j$ for each $j \in [m]$, so that $g = \sum_{j=1}^m \tilde{g}_j$. We also have
$$ \forall j \in [m] : \tau_{\tilde{M}_j} \circ \tilde{g}_j = a_j \tau_{M_j} \circ g_j. \quad (32) $$

Our assumption on $V_{M_j}(\mathcal{G}_j)$ implies that for each $j \in [m]$ there are at most $t_j$ indices such that $|\tilde{g}_j(X_i)| > \tilde{M}_j$. Therefore, the set

$$ B^{\varepsilon} := \{i \in [n] : X_i \neq X_i^{\varepsilon} \text{ or } |\tilde{g}_j(X_i)| > \tilde{M}_j \text{ for some } j \in [m]\} $$

has cardinality bounded by:

$$ \#B^{\varepsilon} \le \lfloor \varepsilon n \rfloor + \sum_{j=1}^{m} t_j \le \phi n < \frac{n}{2}. \quad (33) $$

Now define $M := \sum_{j=1}^m \tilde{M}_j$. Since $g = \sum_{j=1}^m \tilde{g}_j$, we conclude from (33) that there are at most $\phi n$ indices $i \in [n]$ with $|g(X_i^{\varepsilon})| > M$. Since the $\phi n$ largest and smallest values of $g(X_i^{\varepsilon})$ are excluded from the trimmed mean, we obtain:

$$ \hat{T}_{n,\phi n}^{\varepsilon}(g) = \hat{T}_{n,\phi n}^{\varepsilon}(\tau_M \circ g). \quad (34) $$

In what follows, we use this identity to compare the trimmed mean of a sum to a sum of truncated empirical means. More specifically, we let $\hat{P}_n^{\varepsilon}$ denote the empirical measure of the contaminated sample, and use (32) and (34) to bound:

$$ \left| \hat{T}_{n,\phi n}^{\varepsilon}(g) - \sum_{j=1}^{m} a_j \hat{P}_n(\tau_{M_j} \circ g_j) \right| \le \left| \hat{T}_{n,\phi n}^{\varepsilon}(\tau_M \circ g) - \hat{P}_n^{\varepsilon}(\tau_M \circ g) \right| + \left| \hat{P}_n^{\varepsilon}(\tau_M \circ g) - \sum_{j=1}^{m} \hat{P}_n(\tau_{\tilde{M}_j} \circ \tilde{g}_j) \right|. \quad (35) $$
To bound the first term in the RHS, notice that the empirical mean of $\tau_M(g(X_i^\varepsilon))$ is an average over all sample points in the contaminated sample, whereas $\hat{T}_{n,\phi n}^\varepsilon(\tau_M \circ g)$ is an average over a subset of these points of size $(1-2\phi)n$. Since all terms in both averages are bounded by $M$ in absolute value, we conclude:

$$ \hat{P}_n^\varepsilon(\tau_M \circ g) = (1 - 2\phi) \hat{T}_{n,\phi n}^\varepsilon(\tau_M \circ g) + 2\phi\eta $$

for some $|\eta| \le M$, from which it follows that:

$$ \left| \hat{P}_n^\varepsilon(\tau_M \circ g) - \hat{T}_{n,\phi n}^\varepsilon(\tau_M \circ g) \right| \le 2\phi (|\eta| + |\hat{T}_{n,\phi n}^\varepsilon(\tau_M \circ g)|) \le 4\phi M. \quad (36) $$

We now consider the difference

$$ \hat{P}_n^\varepsilon(\tau_M \circ g) - \sum_{j=1}^m \hat{P}_n(\tau_{\tilde{M}_j} \circ \tilde{g}_j) = \frac{1}{n} \sum_{i=1}^n \left[ \tau_M \circ g(X_i^\varepsilon) - \sum_{j=1}^m \tau_{\tilde{M}_j} \circ \tilde{g}_j(X_i) \right] \quad (37) $$

The $n$ terms inside the square brackets in the RHS are bounded in absolute value by $M + \sum_{j=1}^m \tilde{M}_j = 2M$. Recalling (33), we claim that if $i \in [n]\setminus B^\varepsilon$, the corresponding term in the RHS of (37) is zero. To see this, fix some $i$ and note that:

* on the one hand, for each $j \in [m]$, $|\tilde{g}_j(X_i)| \le \tilde{M}_j$ and so $\tau_{\tilde{M}_j} \circ \tilde{g}_j(X_i) = \tilde{g}_j(X_i)$;

* on the other hand, since $X_i = X_i^\varepsilon$, and using the above bounds, we have $|g(X_i^\varepsilon)| = |g(X_i)| \le M$ and

$$ \tau_M \circ g(X_i^\varepsilon) = g(X_i) = \sum_{j=1}^m \tilde{g}_j(X_i). $$

It follows from the claim that:

$$ \forall i \in [n] : \left| \tau_M \circ g(X_j^\varepsilon) - \sum_{j=1}^n \tau_{\tilde{M}_j} \circ \tilde{g}_j(X_i) \right| \le 2M1\{i \in B^\varepsilon\}, $$

and combining this with (33) and (37) gives:

$$ \left| \hat{P}_n^\varepsilon(\tau_M \circ g) - \sum_{j=1}^m \hat{P}_n(\tau_{\tilde{M}_j} \circ \tilde{g}_j) \right| \le \frac{2M}{n} \#B^\varepsilon \le 2M\phi $$

The lemma follows from plugging the preceding display together with inequality (36) into the RHS of (35). $\square$

## B Bousquet's version of Talagrand's concentration inequality

We state here the following classical result we use in our proofs. Recall the definitions from §2.4.

**Theorem B.1** (Bousquet's version of Talagrand's concentration inequality [43]). Assume that a measure $P$ over $(X, \mathcal{X})$ is $1$-compatible with a family of functions $\mathcal{G}$ and $|g - Pg| \le C \forall g \in \mathcal{G}$ for some constant $C > 0$. Define:

$$ W := \sup_{g \in \mathcal{G}} \left| \frac{1}{n} \sum_{i=1}^{n} (g(X_i) - Pg) \right| \quad \text{where } X_{1:n} \stackrel{i.i.d.}{\sim} P $$

Also set $\sigma^2(\mathcal{G}) := \sup_{g \in \mathcal{G}} P(g - Pg)^2$ and $v := 2C \text{Emp}_n(\mathcal{G}, P) + \sigma^2(\mathcal{G})$. Then

$$ \forall x > 0 : \mathbb{P} \left\{ W \ge \text{Emp}_n(\mathcal{G}, P) + \sqrt{\frac{2xv}{n}} + \frac{Cx}{3n} \right\} \le e^{-x}. $$
C Moment conditions for the trimmed mean: proof of Lemma 8.3

*Proof of Lemma 8.3.* Our goal is to find, for the values $j$ with $b_j = 1$, $M_j$ such that (25) holds and the bound (30) is valid. To start, define

$$b = \sum_{j=1}^{m} b_j \text{ and } t = \sum_{j=1}^{m} t_j.$$

**First step:** choose $M_j$ as a function of $t_j$ and $\mathcal{F}_j$.

Notice that contraction and symmetrization gives

$$M_j \ge \frac{256 n}{t_j} \mathrm{Emp}_n(\mathcal{F}_j) \Rightarrow \frac{8 \mathrm{Rad}_n(\tau_{M_j} \circ \mathcal{F}_j^o)}{M_j} \le \frac{16 \mathrm{Emp}_n(\mathcal{F}_j)}{M_j} \le \frac{t_j}{16n}.$$

So, (25) follows if we can define

$$M_j = m_j(t_j) \lor \left( \frac{256n}{t_j} \mathrm{Emp}_n(\mathcal{F}_j) \right),$$

with $m_j(t_j)$ such that

$$\forall f \in \mathcal{F}_j : P \left\{ |f(X) - Pf| > \frac{m_j(t_j)}{2} \right\} \le \frac{t_j}{16n}.$$

We can explicitly find a choice of $m_j(t)$. Markov's inequality gives, for every $p \ge 1$,

$$\sup_{f \in \mathcal{F}_j} \mathbb{P} \left( |f(X) - Pf| > \frac{m_j(t_j)}{2} \right) \le 2^p \frac{\nu_p^p(\mathcal{F}_j)}{m_j(t_j)^p}$$

and so we can take $m_j(t_j) = 2\nu_p(\mathcal{F}_j) \left(\frac{16n}{t_j}\right)^{\frac{1}{p}}$. Thus, we define

$$M_j = M_j(t) := \left( 2\nu_p(\mathcal{F}_j) \left( \frac{16n}{t_j} \right)^{\frac{1}{p}} \right) \lor \left( \frac{256n}{t_j} \mathrm{Emp}_n(\mathcal{F}_j) \right) \\ \le 32\nu_p(\mathcal{F}_j) \left( \frac{t_j}{n} \right)^{-\frac{1}{p}} + \frac{256n}{t_j} \mathrm{Emp}_n(\mathcal{F}_j). \qquad (38)$$

**Second step:** bound $2\mathrm{Emp}_n(\tau_{M_j} \circ \mathcal{F}_j^o, P) + \eta_j$.

Given our choice of $M_j$ we bound the terms of $\eta_j$. We can easily bound

$$\mathrm{rem}_{M_j}(\mathcal{F}_j^o) = \sup_{f \in \mathcal{F}_j} P(f-Pf) \mathbf{1}_{|f-Pf| > M_j} \le \frac{\nu_p^p(\mathcal{F}_j)}{M_j^{p-1}} \le \frac{\nu_p^p(\mathcal{F}_j)}{m_j(t_j)^{p-1}} \le \nu_p(\mathcal{F}_j) \left(\frac{t_j}{n}\right)^{1-\frac{1}{p}}$$

and, using contraction and symmetrization,

$$\mathrm{Emp}_n(\tau_{M_j} \circ \mathcal{F}_j^o) \le 2\mathrm{Rad}_n(\tau_{M_j} \circ \mathcal{F}_j^o) \le 2\mathrm{Rad}_n(\mathcal{F}_j^o) \le 4\mathrm{Emp}_n(\mathcal{F}_j).$$

We now bound the largest variance in $\tau_{M_j} \circ \mathcal{F}_j^o$ in terms of the moment parameters of $\mathcal{F}_j$. For $f \in \mathcal{F}_j$,

$$\mathbb{V}(\tau_{M_j} \circ (f - Pf)) \le P(\tau_{M_j} \circ (f - Pf))^2 \le P(M_j \wedge |f - Pf|^2),$$

where the first inequality follows from bounding the variance by the second moment, and the second is a consequence of $|\tau_{M_j} \circ (f - Pf)| = M_j \wedge |f - Pf|$. Now, for any $1 \le q \le 2$,

$$(M_j \wedge |f - Pf|)^2 \le M_j^{2-q} |f - Pf|^q,$$

so that

$$\mathbb{V}(\tau_{M_j} \circ (f - Pf)) \le M_j^{2-q} \|f - Pf\|_{L^q(P)}^q \le M_j^{2-q} \nu_q^q(\mathcal{F}_j).$$
It gives

$$ \nu_2 (\tau_{M_j} \circ \mathcal{F}_j^o) \sqrt{\frac{2x_j}{n}} \le \sqrt{2} \left(\frac{M_j x_j}{n}\right)^{1-\frac{q}{2}} \left(\nu_q(\mathcal{F}_j) \left(\frac{x_j}{n}\right)^{1-\frac{1}{q}}\right)^{\frac{q}{2}} $$

and we can bound, using Young's inequality and $\sqrt{2} < 2$,

$$ \begin{aligned} \nu_2 (\tau_{M_j} \circ \mathcal{F}_j^o) \sqrt{\frac{2x_j}{n}} &\le \sqrt{2} \left(1 - \frac{q}{2}\right) \frac{M_j x_j}{n} + \sqrt{2} \frac{q}{2} \nu_q(\mathcal{F}_j) \left(\frac{x_j}{n}\right)^{1-\frac{1}{q}} \\ &\le 2 \left( \frac{M_j x_j}{2n} + \nu_q(\mathcal{F}_j) \left(\frac{x_j}{n}\right)^{1-\frac{1}{q}} \right). \end{aligned} $$

Notice that

$$ 6\phi + \frac{4x_j}{n} = \left( \frac{6t}{t_j} + \frac{6\lfloor\varepsilon n\rfloor}{t_j} + \frac{4x_j}{t_j} \right) \frac{t_j}{n} \le \left( 4 + 6\frac{t}{t_j} + 6\frac{\varepsilon}{\bar{\varepsilon}} \right) \frac{t_j}{n}, $$

taking $C'_j = 32 \left(4 + 6\frac{t}{t_j} + 6\frac{\varepsilon}{\bar{\varepsilon}}\right)$ and using (38), we have

$$ M_j \left( 6\phi + \frac{4x_j}{n} \right) \le C'_j \left( \nu_p(\mathcal{F}_j) \left( \frac{t_j}{n} \right)^{1-\frac{1}{p}} + 8 \mathrm{Emp}_n(\mathcal{F}_j) \right) $$

Combining the bounds gives

$$ \begin{aligned} 2\mathrm{Emp}_n (\tau_{M_j} \circ \mathcal{F}_j^o, P) + \eta_j &\le 8\mathrm{Emp}_n(\mathcal{F}_j) + 2\nu_q(\mathcal{F}_j) \left(\frac{x_j}{n}\right)^{1-\frac{1}{q}} \\ &\quad + M_j \left(6\phi + \frac{4x_j}{n}\right) + \nu_p(\mathcal{F}_j) \left(\frac{t_j}{n}\right)^{1-\frac{1}{p}} \\ &\le 8(1 + C'_j)\mathrm{Emp}_n(\mathcal{F}_j) + 2\nu_q(\mathcal{F}_j) \left(\frac{x_j}{n}\right)^{1-\frac{1}{q}} \\ &\quad + (1 + C'_j)\nu_p(\mathcal{F}_j) \left(\frac{t_j}{n}\right)^{1-\frac{1}{p}} \end{aligned} $$

**Final step:** finish proof by case analysis on $t_j$.

Recall

$$ C_j^{\varepsilon} := 192 \left( 1 + \frac{t}{t_j} + \frac{\varepsilon}{\bar{\varepsilon}} \right). $$

Since $x_j \ge \frac{1}{3}$ and $q \in [1, 2]$ we have

$$ \lceil x_j \rceil^{1-\frac{1}{q}} \le (x_j + 1)^{1-\frac{1}{q}} \le 2x_j^{1-\frac{1}{q}}, $$

and we bound

$$ \left( \frac{x_j}{n} \right)^{1-\frac{1}{q}} \le 2 \left( \frac{x_j}{n} \right)^{1-\frac{1}{q}}. $$

We also have $\lceil a \rceil \le 2a$ when $a \ge 1$. Thus, if $\varepsilon n \ge 1$ (i.e., when there is a contaminated sample point) we have

$$ \frac{\lceil \bar{\varepsilon} n \rceil}{n} \le \frac{1}{n} \left\lceil \frac{\varepsilon n}{1+b} \right\rceil \le \frac{2\varepsilon}{1+b}. $$

The case $\varepsilon n < 1$ means that there is no contamination and we might replace $\varepsilon$ with 0, obtaining the same bound.

We now take the infimum over $q \in [1, 2]$ and $p \ge 1$. If $t_j = \lceil x_j \rceil$,

$$ 2\mathrm{Emp}_n (\tau_{M_j} \circ \mathcal{F}_j^o, P) + \eta_j \le 8C_j^{\varepsilon} \mathrm{Emp}_n(\mathcal{F}_j) + C_j^{\varepsilon} \inf_{q \in [1,2]} \nu_q(\mathcal{F}_j) \left(\frac{x_j}{n}\right)^{1-\frac{1}{q}}. $$
The case $t_j = [\epsilon n]$ gives

$$2\mathrm{Emp}_n(\tau_{M_j} \circ \mathcal{F}_j^o, P) + \eta \le 8C_j^\epsilon \mathrm{Emp}_n(\mathcal{F}_j) \\ + 4 \inf_{q \in [1,2]} \nu_q(\mathcal{F}_j) \left(\frac{x_j}{n}\right)^{1-\frac{1}{q}} + C_j^\epsilon \inf_{p \ge 1} \nu_p(\mathcal{F}_j) \left(\frac{2\epsilon}{1+b}\right)^{1-\frac{1}{p}}.$$

The final bound follows from considering the two possible values of $t_j$ and performing some overestimates. $\square$

### D Details on vector mean estimation

In this section we discuss how Theorem 3.1 can be used to prove Theorem 4.1. We also show that our estimator is measurable when $\mathbf{X} = \mathbb{R}^d$ for some $d \in \mathbb{N}$. Recall that in the context of Problem 2 one has a separable, reflexive Banach space $(\mathbf{X}, \| \cdot \|)$ with dual $\mathbf{X}^*$. We also let $P$ be a probability measure such that $P\| \cdot \| = \mathbb{E}_{\mathbf{X} \sim P} \|\mathbf{X}\| < \infty$. This means that the map $f \in \mathbf{X}^* \mapsto Pf$ is linear and bounded. As a result, there exists a unique $\mu_P \in \mathbf{X}^{**} = \mathbf{X}$, called the mean of $P$, such that

$$f(\mu_P) = Pf \text{ for all } f \in \mathbf{X}^*.$$

The problem of estimating $\mu_P$ is closely related to the problem of uniform mean estimation over the class $\mathcal{F}$ given by the dual unit ball of $\mathbf{X}^*$. To see this let $\hat{E}_f$ be any given estimator for $f \in \mathcal{F}$, let $\hat{\mu} : \mathbf{X}^n \to \mathbf{X}$ satisfy

$$\forall x_{1:n} \in \mathbf{X}^n : \hat{\mu}(x_{1:n}) \in \arg \min_{\mu \in \mathbf{X}} \left( \sup_{f \in \mathcal{F}} \left| \hat{E}_f(x_{1:n}) - f(\mu) \right| \right). \quad (39)$$

Then, for any given $x_{1:n} \in \mathbf{X}^n$,

$$\begin{align*}
\|\hat{\mu}(x_{1:n}) - \mu_P\| &= \sup_{f \in \mathcal{F}} |f(\hat{\mu}(x_{1:n}) - \mu_P)| \quad (\text{because } \mathcal{F} \text{ is the dual unit ball}) \\
&= \sup_{f \in \mathcal{F}} |f(\hat{\mu}(x_{1:n})) - f(\mu_P)| \\
&= \sup_{f \in \mathcal{F}} \left|f(\hat{\mu}(x_{1:n})) - \hat{E}_f(x_{1:n})\right| + \sup_{f \in \mathcal{F}} \left|\hat{E}_f(x_{1:n}) - f(\mu_P)\right| \\
&\le \sup_{f \in \mathcal{F}} \left|f(\mu_P) - \hat{E}_f(x_{1:n})\right| + \sup_{f \in \mathcal{F}} \left|\hat{E}_f(x_{1:n}) - f(\mu_P)\right| \\
&= 2 \sup_{f \in \mathcal{F}} \left|\hat{E}_f(x_{1:n}) - f(\mu_P)\right| \\
&= 2 \sup_{f \in \mathcal{F}} \left|\hat{E}_f(x_{1:n}) - Pf\right|
\end{align*}$$

where in the inequality we used the definition of $\hat{\mu}$ as a minimizer.

On the other hand, given a mean estimator $\hat{\mu}$ for $\mu_P$, we can easily construct estimators $\hat{E}_f(x_{1:n}) = f(\hat{\mu}(x_{1:n}))$ for each $f \in \mathcal{F}$, and obtain

$$\sup_{f \in \mathcal{F}} \left| \hat{E}_f(x_{1:n}) - f(\mu_P) \right| = \| \hat{\mu}(x_{1:n}) - \mu_P \|. $$

The previous reasoning gives us the proof of Theorem 4.1.

**Proof of Theorem 4.1.** Notice that the estimator $\hat{\mu}_{n,k}$ is in the form (39) with $\hat{E}_f$ given by $\hat{T}_{n,k}$. Thus, by the previous reasoning,

$$\|\hat{\mu}_{n,k}(X_{1:n}^{\epsilon}) - \mu_P\| \le 2 \sup_{f \in \mathcal{F}} \left| \hat{T}_{n,k}(f, X_{1:n}^{\epsilon}) - Pf \right|.$$

Selecting $k$ according to Theorem 3.1 we can bound the RHS, finishing the proof. $\square$
### D.1 Measurability of our estimator when $X = \mathbb{R}^d$

In this subsection we show that our vector mean estimator can be taken to be a measurable function when $X = \mathbb{R}^d$. We can write our estimator as

$$ \hat{\mu}_{n,k}(x_{1:n}) \in \arg \min_{\mu \in \mathcal{F}} \left( \sup_{f \in \mathcal{F}} \left| \hat{T}_{n,k}(f, x_{1:n}) - f(\mu) \right| \right), $$

we now must check if it is possible to define $\hat{\mu}_{n,k}(x_{1:n})$ in a way that the estimator is measurable. This is done in the next lemma.

**Lemma D.1.** Given $1 \le k < n/2$, there exists a measurable function $\hat{\mu}_{n,k} : (\mathbb{R}^d)^n \to \mathbb{R}$ such that

$$ \forall x_{1:n} \in (\mathbb{R}^d)^n : \hat{\mu}_{n,k}(x_{1:n}) \in \arg \min_{\mu \in \mathcal{F}} \left( \sup_{f \in \mathcal{F}} \left| \hat{T}_{n,k}(f, x_{1:n}) - f(\mu) \right| \right). \quad (40) $$

*Proof.* Recall the dual unit ball $\mathcal{F}$ is a symmetric class of functions, thus

$$ \sup_{f \in \mathcal{F}} \left| \hat{T}_{n,k}(f, x_{1:n}) - f(\mu) \right| = \sup_{f \in \mathcal{F}} \hat{T}_{n,k}(f, x_{1:n}) - f(\mu). $$

Define

$$ F(\mu, x_{1:n}) = \sup_{f \in \mathcal{F}} \hat{T}_{n,k}(f, x_{1:n}) - f(\mu), $$

which is convex in $\mu$ for fixed $x_{1:n}$ because it is a supremum of affine functions. $F$ is also a measurable function of $(\mu, x_{1:n})$ because the supremum can be taken over a countable dense subset $\mathcal{D} \subset \mathcal{F}$. For fixed $x_{1:n}$, the values $\hat{T}_{n,k}(f, x_{1:n})$ are uniformly bounded, and one can deduce from this that the set

$$ K(x_{1:n}) := \arg \min_{\mu \in \mathbb{R}^d} F(\mu, x_{1:n}) $$

is convex, compact (the dimension is finite), and nonempty.

It remains to show that we can take a measurable function $\hat{\mu}_{n,k}$ with $\hat{\mu}_{n,k}(x_{1:n}) \in K(x_{1:n})$. In order to use Kuratowski and Ryll-Nardzewski measurable selection theorem [54] we need to show that for every open set $U \subset \mathbb{R}^d$, the set

$$ A_U := \{x_{1:n} : K(x_{1:n}) \cap U \neq \emptyset\} $$

is measurable. If $U = \emptyset$ we are done. Otherwise, we can write $U = \bigcup_{i=1}^n K_i$ where $K_i$ is compact and has non-empty interior for every $i \in \mathbb{N}$. Thus, it suffices to show that

$$ A_K := \{x_{1:n} : K(x_{1:n}) \cap K \neq \emptyset\} $$

is measurable for every compact set $K$ with non-empty interior. Let $D$ be dense and countable in $\mathbb{R}^d$, and also assume that $K \cap D$ is dense in $K$. Notice that $K(x_{1:n}) \cap K \neq \emptyset$ if there is some minimizer of $F(\cdot, x_{1:n})$ in $K$. For a given $x_{1:n} \in (\mathbb{R}^d)^n$,

$$ \begin{align*} K(x_{1:n}) \cap K &\neq \emptyset \\ &\Leftrightarrow \\ &\exists \mu \in K \text{ such that } F(\mu, x_{1:n}) \leq F(\mu', x_{1:n}) \quad \forall \mu' \in \mathbb{R}^d \\ &\Leftrightarrow \\ &\exists \mu \in K \text{ such that } F(\mu, x_{1:n}) \leq F(\mu', x_{1:n}) \quad \forall \mu' \in D \\ &\Leftrightarrow \\ &\forall m \in \mathbb{N}, \exists \mu \in K \cap D \text{ such that } F(\mu, x_{1:n}) \leq F(\mu', x_{1:n}) + \frac{1}{m} \quad \forall \mu' \in D. \end{align*} $$

The first equivalence follows from our previous observation. The second equivalence follows noticing that $F$ is continuous on $\mu$. The last equivalence is less obvious and uses that $K$ is compact:

* (⇒): assume $\mu \in K$ is such that $F(\mu, x_{1:n}) \leq F(\mu', x_{1:n}) \forall \mu' \in D$; since $K \cap D$ is dense in $K$ there exists $(\mu_k)_{k=1}^\infty \subset K \cap D$ satisfying $\mu_k \to \mu$ as $k \to \infty$. Since $F$ is continuous on $\mu$ we have $F(\mu_k, x_{1:n}) \to F(\mu, x_{1:n})$ as $k \to \infty$, given $m \in \mathbb{N}$ exists $k_m$ such that $F(\mu_{k_m}, x_{1:n}) \leq F(\mu, x_{1:n}) + \frac{1}{m}$ and so $F(\mu_{k_m}, x_{1:n}) \leq F(\mu', x_{1:n}) + \frac{1}{m} \forall \mu' \in D$.
• (=$\Leftarrow$): Take a sequence $(\mu_m)_{m=1}^\infty \subset K \cap D$ satisfying $F(\mu_m, x_{1:n}) \le F(\mu', x_{1:n}) + \frac{1}{m} \forall \mu' \in D$. Since $K$ is compact there is a sub-sequence $(\mu_{k_m})_{m=1}^\infty \subset (\mu_m)_{m=1}^\infty$ such that $\mu_{k_m} \to \mu$ as $m \to \infty$ for some $\mu \in K$. Moreover, $F(\mu, x_{1:n}) = \lim_{m \to \infty} F(\mu_{k_m}, x_{1:n})$ and so $F(\mu, x_{1:n}) \le F(\mu', x_{1:n}) \forall \mu' \in D$.

Writing the previous observations using the appropriate set operation for each logical quantifier yields

$$A_K = \bigcap_{m=1}^{\infty} \bigcup_{\mu \in K \cap D} \bigcap_{\mu' \in D} \left\{ x_{1:n} : F(\mu, x_{1:n}) \le F(\mu', x_{1:n}) + \frac{1}{m} \right\}$$

and so $A_K$ is measurable.

<figure><img src="image_4.png" /></figure>

## E Bounds for regression

We prove our bounds for regression in this section. The probability measure $P$ will often be implicit throughout the section. We will sometimes use the following property,

$$\forall f \in \mathcal{F} : P m_f = P \xi_P(X, Y)(f(X) - f_P^*(X)) \le 0, \quad (41)$$

where $m_f = m_{f,P}$ is the “multiplier term” (see §5.1). Indeed, (41) is the first-order optimality condition for $f_P^* = \arg \min_{f \in \mathcal{F}} P(Y - f(X))^2$.

In what follows, $Z_{1:n}^\epsilon$ is an $\epsilon$-contaminated sample from $P$. Similarly to the proof of Theorem 8.1, we write $\hat{T}_{n,k}^\epsilon(\cdot) := \hat{T}_{n,k}(\cdot, Z_{1:n}^\epsilon)$. The estimator $\hat{f}_n^\epsilon \in \mathcal{F}$ of $f_P^* \in \mathcal{F}$ is obtained solving the minimization problem

$$\hat{f}_n^\epsilon \in \arg \min_{f \in \mathcal{F}} \left( \sup_{g \in \mathcal{G}} \hat{T}_{n, \phi n}^\epsilon (\ell_f - \ell_g) \right).$$

The next Lemma reduces Theorem 5.1 to proving localized upper and lower bounds on certain trimmed means. Introduce the notation:

$$r_f := \|f - f_P^*\|_{L_2(P_x)}.$$

**Lemma E.1.** If $r > 0$ and $\gamma > 0$ are such that

$$\inf_{r_f=r} \hat{T}_{n, \phi n}^{\epsilon} (\ell_f - \ell_{f_P^*}) \geq \gamma \geq 2 \sup_{r_f \leq r} \hat{T}_{n, \phi n}^{\epsilon} (m_f - Pm_f), \quad (42)$$

$$\text{then } r_{\hat{f}_n^\epsilon} = \left\| \hat{f}_n^\epsilon - f_P^* \right\|_{L^2(P_x)} \le r \text{ and } R(\hat{f}_n^\epsilon) - R(f_P^*) \le r^2 + 2\gamma.$$

*Proof.* The proof proceeds in three stages that follow the “localization + fixed point” outline from previous work [31, 49, 55]. In the first stage, we use a localization argument and show:

$$\forall f \in \mathcal{F} : \hat{T}_{n, \phi n}^{\epsilon} (\ell_f - \ell_{f_P^*}) \begin{cases} > \gamma, & r_f > r; \\ \geq -\gamma, & r_f \leq r. \end{cases} \quad (43)$$

In the second stage, we bound $r_{\hat{f}_n^\epsilon}$ via (43) and a “fixed point” argument. In the final stage, we notice that an excess risk bound is implicit in the first two steps.

**Localization:** our goal here is to prove (43). Since $\mathcal{F}$ is convex, we can scale down elements $f \in \mathcal{F}$ with $r_f > r$ to elements $\bar{f} \in \mathcal{F}$ with $r_{\bar{f}} = r$ and bound the corresponding trimmed mean via our assumption. Explicitly, assume $q_f = \frac{r_f}{r} > 1$ and define $\bar{f} = f_P^* + \frac{f - f_P^*}{q_f}$, so that $\bar{f} \in \mathcal{F}$ by convexity and $r_{\bar{f}} = r$. We obtain

$$\begin{aligned} \hat{T}_{n, \phi n}^{\epsilon} (\ell_f - \ell_{f_P^*}) &= \hat{T}_{n, \phi n}^{\epsilon} (q_f^2 (\bar{f} - f_P^*)^2 - 2m_f) \\ &\ge q_f \hat{T}_{n, \phi n}^{\epsilon} (\ell_{\bar{f}} - \ell_{f_P^*}) > \gamma \text{ using (42) and } q_f > 1. \end{aligned}$$

This proves (43) for $r_f > r$. For $r_f \le r$, we use (41) and $(f - f_P^*)^2 \ge 0$ to obtain

$$\begin{aligned} \hat{T}_{n, \phi n}^{\epsilon} (\ell_f - \ell_{f_P^*}) &= \hat{T}_{n, \phi n}^{\epsilon} ((f - f_P^*)^2 - 2m_f) \\ &\ge \hat{T}_{n, \phi n}^{\epsilon} ((f - f_P^*)^2 - 2(m_f - Pm_f)) \\ &\ge -2\hat{T}_{n, \phi n}^{\epsilon} (m_f - Pm_f) \ge -\gamma \text{ by (42).} \end{aligned}$$
**Fixed point argument:** for any $f \in \mathcal{F}$, let

$$ \Delta(f) = \sup_{g \in \mathcal{F}} \hat{T}_{n, \phi n}^{\varepsilon} (\ell_f - \ell_g), $$

so that $\hat{f}_n^\varepsilon$ minimizes $\Delta$ over $\mathcal{F}$. Therefore,

$$ \hat{T}_{n, \phi n}^{\varepsilon} (\ell_{\hat{f}_n^{\varepsilon}} - \ell_{\hat{f}_P^{\star}}) \leq \Delta(\hat{f}_n^{\varepsilon}) \leq \Delta(f_P^{\star}) \quad (44) $$

The bounds in (43) show that for any $g \in \mathcal{F}$:

$$ \hat{T}_{n, \phi n}^{\varepsilon} (\ell_{\hat{f}_P^{\star}} - \ell_g) \leq \begin{cases} \gamma, & r_g \leq r; \\ -\gamma, & r_g > r. \end{cases} $$

Since $\gamma > 0$, we obtain $\Delta(f_P^*) \leq \gamma$. This implies via (44) that $\hat{T}_{n, \phi n}^{\varepsilon} (\ell_{\hat{f}_n^{\varepsilon}} - \ell_{\hat{f}_P^{\star}}) \leq \gamma$. We deduce that $r_{\hat{f}_n^{\varepsilon}} \leq r$ via assumption (42).

**Excess risk:** we have:

$$ R_P(\hat{f}_n^{\varepsilon}) - R_P(f_P^{\star}) = r_{\hat{f}_n^{\varepsilon}}^2 - 2P m_{\hat{f}_n^{\varepsilon}}. $$

The first term in the RHS is $\leq r^2$ by the above. The second can be bounded by:

$$ \begin{aligned} -2Pm_{\hat{f}_n^{\varepsilon}} &= 2\hat{T}_{n, \phi n}^{\varepsilon} (m_{\hat{f}_n^{\varepsilon}} - Pm_{\hat{f}_n^{\varepsilon}}) - 2\hat{T}_{n, \phi n}^{\varepsilon} (m_{\hat{f}_n^{\varepsilon}}) \\ &\leq 2\hat{T}_{n, \phi n}^{\varepsilon} (m_{\hat{f}_n^{\varepsilon}} - Pm_{\hat{f}_n^{\varepsilon}}) + \hat{T}_{n, \phi n}^{\varepsilon} (\ell_{\hat{f}_n^{\varepsilon}} - \ell_{\hat{f}_P^{\star}}) \\ &\leq \gamma + \Delta(\hat{f}_n^{\varepsilon}) \leq 2\gamma, \end{aligned} $$

where the last line follows from (42) combined with $r_{\hat{f}_n^{\varepsilon}} \leq r$ and the calculations in the previous step. $\square$

We now apply Lemma E.1 to prove our main result on regression.

**Proof of Theorem 5.1.** We continue to use the notational conventions introduced above. Our goal is to find an event $E$ and a constant $\gamma > 0$ such that assumption (42) of Lemma E.1 holds in $E$, with the value of $r := \Phi_P(\mathcal{F}, n, \alpha, \varepsilon)$ defined in (21), and a suitable $\gamma > 0$. Let $x := \ln \frac{3}{\alpha} \geq \frac{1}{3}$. Following (21), we set

$$ \theta_0 := \theta_0(\mathcal{F}, P), \quad \delta_q := \frac{1}{32\theta_0} \quad \text{and} \quad \delta_m = \frac{1}{448\theta_0^2}. \quad (45) $$

**First step:** lower bound quadratic part by Lipschitz term.

Lemma E.1 requires control from below of $\ell_f - \ell_{\hat{f}_P^{\star}}$, which includes a quadratic term. However, our assumptions are on the process $f - f_P^{\star}$ without the square. Therefore, our first step will be to find a bounded Lipschitz minorant for the quadratic term, to which we can apply concentration and contraction. Specifically, consider $a, c > 0$ with $2c > a$ (specific values to be chosen later). Define

$$ \psi(y) = r^2 \left( 2a \left( \frac{|y|}{r} \wedge c \right) - a^2 \right)_+ \quad (y \in \mathbb{R}). $$

Then:

1. $0 \leq \psi(y) \leq y^2$ for all $y \in \mathbb{R}$: this follows from the fact that the graph of $y \mapsto y^2$ is lower bounded by the tangent line at $y = ar$;

2. $\psi$ is $2ar$-Lipschitz with $\psi(0) = 0$; and

3. $\psi$ is bounded above by the constant $M_q := r^2(2ac - a^2)$.

Thus, for all $f \in \mathcal{F}$ with $r_f = r$:

$$ \hat{T}_{n, \phi n}^{\varepsilon} (\ell_f - \ell_{\hat{f}_P^{\star}}) \geq \hat{T}_{n, \phi n}^{\varepsilon} (\psi(f - f_P^{\star}) - 2(m_f - Pm_f)), \quad (46) $$

where we also used (41).
**Second step:** define E and lower bound $\mathbb{P}(E)$ via Theorem 8.1.

Recall that our goal is to prove the existence of an event E with $\mathbb{P}(E) \ge 1 - \alpha$ so that, when E holds, both (20) and (22) are satisfied. To do this, we recall the definition of $\mathcal{F}_q(r) = \mathcal{F}_q(r, P)$ and $\mathcal{F}_m(r) = \mathcal{F}_m(r, P)$ from §5.1, and set:

$$ \mathcal{F}_1 := \psi \circ \mathcal{F}_q(r) = \{ \psi(f - f_P^*) : f \in \mathcal{F}, \|f - f_P^*\|_{L^2(P_x)} = r \}; \quad (47) $$

$$ \mathcal{F}_2 := \mathcal{F}_m(r) = \{ m_f - Pm_f : f \in \mathcal{F}, \|f - f_P^*\|_{L^2(P_x)} \le r \}. \quad (48) $$

Now define

$$ \eta_q := \left(6\phi + \frac{3x}{n}\right) M_q + \nu_2(\mathcal{F}_1) \sqrt{\frac{2x}{n}}, \quad (49) $$

with $M_q$ as above, and

$$ \eta_m := \left(6\phi + \frac{3x}{n}\right) M_m + \mathrm{rem}_{M_m}(\mathcal{F}_2) + \nu_2(\tau_{M_m} \circ \mathcal{F}_2) \sqrt{\frac{2x}{n}}, \quad (50) $$

with $M_m$ soon to be defined. The event E is defined as follows:

$$ E = \left\{ \begin{array}{l} \forall a_q, a_m \in \mathbb{R}, f_q \in \mathcal{F}_q(r), f_m \in \mathcal{F}_m(r) \\ \left| \hat{T}_{n, \phi n}^{\epsilon}(a_q \psi(f_q) + a_m f_m) - a_q P \psi(f_q) \right| \le \\ |a_q| \{2\mathrm{Emp}_n(\mathcal{F}_1^o) + \eta_q\} + |a_m| \{2\mathrm{Emp}_n(\tau_{M_m} \circ \mathcal{F}_2) + \eta_m\} \end{array} \right\} $$

The event E is measurable because $\mathcal{F}$ has a countable dense subset. We now argue that E is precisely the kind of event whose probability is bounded in Theorem 8.1. To see this, we follow the notation in that theorem, set $m := 2$, $x_1 = x_2 = x$ and $\mathcal{F}_1$ and $\mathcal{F}_2$ as above. We make the following choices of $M_i$, $b_i$ and $t_i$:

* The functions in $\mathcal{F}_1 = \psi \circ \mathcal{F}_q(r)$ take values in $[0, M_q]$, so their expectations are also in this range. It follows that all functions in the centered class $\mathcal{F}_1^o$ are bounded by $M_1 := M_q$ in absolute value. This means we can take $t_1 = b_1 = 0$.

* Now consider $\mathcal{F}_2 = \mathcal{F}_m(r)$. Note that $Pf_m = 0$ for all $f_m \in \mathcal{F}_m(r)$, so $\mathcal{F}_2 = \mathcal{F}_2^o$. Since $\mathcal{F}_2$ may be unbounded, we will take $b_2 = 1$, and use Lemma 8.3 to obtain $M_m := M_2$ and $t_2 \ge x_2$ satisfying the assumptions of Theorem 8.1 and also the bound

$$ 2\mathrm{Emp}_n(\tau_{M_m} \circ \mathcal{F}_2) + \eta_m \le C_\epsilon \left\{ \begin{aligned} & 8\mathrm{Emp}_n(\mathcal{F}_2) + \inf_{q \in [1,2]} \nu_q(\mathcal{F}_2) \left( \frac{\ln \frac{3}{\alpha}}{n} \right)^{1-\frac{1}{q}} \\ & + \inf_{p \ge 1} \nu_p(\mathcal{F}_2) \epsilon^{1-\frac{1}{p}} \end{aligned} \right\}, $$

where $C_\epsilon := 384 \left(1 + \frac{\epsilon}{\epsilon \wedge (\frac{1}{2} - \epsilon)}\right)$ can be bounded by 768 noticing that (19) implies $\epsilon \le \frac{1}{96\theta_0^2} < \frac{1}{4}$. Using further that $\nu_p(\mathcal{F}_2) = \nu_p(\mathcal{F}_m(r)) \le r \kappa_p(\mathcal{F})$, we obtain the bound:

$$ 2\mathrm{Emp}_n(\tau_{M_m} \circ \mathcal{F}_2) + \eta_m \le 768 \left\{ \begin{aligned} & 8\mathrm{Emp}_n(\mathcal{F}_2) + r \inf_{q \in [1,2]} \kappa_q(\mathcal{F}) \left( \frac{\ln \frac{3}{\alpha}}{n} \right)^{1-\frac{1}{q}} \\ & + r \inf_{p \ge 1} \kappa_p(\mathcal{F}) \epsilon^{1-\frac{1}{p}} \end{aligned} \right\}, \quad (51) $$

The upshot of this discussion is that Theorem 8.1 can indeed be used to bound the probability of E, and we obtain:

$$ \mathbb{P}(E) \ge 1 - 3e^{-x} \ge 1 - \alpha. $$

From now on, we perform all calculations deterministically while assuming that E holds.

**Third step:** bounds assuming E holds.
We combine the lower bound from the first step with the one defining the event E. Taking $a_q = 0$, $a_m = 2$ in E gives, for $r_f \le r$,

$$2\hat{T}_{n,\phi n}^{\varepsilon}(m_f - Pm_f) \le \underbrace{2\{2\mathrm{Emp}_n(\tau_{M_m} \circ \mathcal{F}_2) + \eta_m\}}_{(i)} \quad (52)$$

Similarly, to consider $r_f = r$ we take $a_q = 1$, $a_m = -2$ in E and obtain

$$\hat{T}_{n,\phi n}^{\varepsilon}(\ell_f - \ell_{f_P}^*) \ge \hat{T}_{n,\phi n}^{\varepsilon}(\psi(f - f_P^*) - 2(m_f - Pm_f)) \quad (53)$$

$$\ge \underbrace{\inf_{f_q \in \mathcal{F}_q(r)} P\psi(f_q)}_{(ii)} - \underbrace{\left\{ \begin{array}{l} 2\mathrm{Emp}_n(\mathcal{F}_1^o) + \eta_q \\ - 2\{2\mathrm{Emp}_n(\tau_{M_m} \circ \mathcal{F}_2) + \eta_m\} \end{array} \right\}}_{(iii)} \quad (iv)$$

where the last inequality is where we need E to hold.

The bounds in (53) and (52) are still unwieldy. To obtain more useful bounds for (i - iv), we need a few calculations that are quite messy and not too enlightening.

**Bound (i).** Note that, since $r \ge r_m(\delta_m)$ one has $\mathcal{F}_m(r)/r \subset \mathcal{F}_m(r_m(\delta_m))/r_m(\delta_m)$. Combining this with symmetrization and the definition of $r_m(\delta_m)$, we obtain:

$$\mathrm{Emp}(\mathcal{F}_m(r)) \le 2\mathrm{Rad}(\mathcal{F}_m(r)) \le \frac{2r}{r_m(\delta_m)}\mathrm{Rad}(\mathcal{F}_m(r_m(\delta_m))) \le 2\delta_m r r_m(\delta_m).$$

By (51), we obtain:

$$(i) \le 1536 r \left\{ 16\delta_m r_m(\delta_m) + \inf_{q \in [1,2]} \kappa_q(\mathcal{F}) \left(\frac{x}{n}\right)^{1-\frac{1}{q}} + \inf_{p \ge 1} \kappa_p(\mathcal{F}) \varepsilon^{1-\frac{1}{p}} \right\} \le 14\delta_m r^2, \quad (54)$$

where the upper bound is provided by the choice of $r = \Phi_P(\mathcal{F}, \alpha, n, \varepsilon)$ in (21) and the choice of $\delta_m$ in (45).

**Bound (ii).** Using $y \wedge c \ge y - \frac{y^2}{c}$ and the definition of $\theta_0$ we can bound, for $r_f = r$,

$$P\psi(f - f_P^*) \ge P \left\{ r^2 \left( 2a \left( \frac{|f - f_P^*|}{r} - \frac{|f - f_q|^2}{r^2c} \right) - a^2 \right) \right\} \ge r^2 \left\{ 2a \left( \frac{1}{\theta_0} - \frac{1}{c} \right) - a^2 \right\}.$$

**Bound (iii).** Using contraction and symmetrization (Theorem 2.1) together with the fact that $r \ge r_q(\delta_q)$ give:

$$\mathrm{Emp}_n(\mathcal{F}_1^o) = \mathrm{Emp}_n(\psi \circ \mathcal{F}_q(r)) \le 2\mathrm{Rad}_n(\psi \circ \mathcal{F}_q(r)) \le 4ar\mathrm{Rad}_n(\mathcal{F}_q(r)) \le 4a\delta_q r^2.$$

**Bound (iv).** Since $\mathcal{F}_1 = \psi \circ \mathcal{F}_q(r)$, $\psi(0) = 0$ and $\psi$ is $2ar$-Lipschitz,

$$\nu_2(\mathcal{F}_1^o) \le 2ar \sup_{f_q \in \mathcal{F}_q(r)} \|f_q\|_{L^2(P_x)} = 2ar^2.$$

Observe that $\mathrm{rem}_{M_q}(\mathcal{F}_1^o) = 0$ because $\mathcal{F}_1^o$ is uniformly bounded by $M_q$, thus

$$\eta_q \le \left(6\phi + \frac{3x}{n}\right) M_q + 2ar^2 \sqrt{\frac{2x}{n}}.$$

**End of third step.** From (52) and (54) we have

$$2 \sup_{r_f \le r} \hat{T}_{n,\phi n}^{\varepsilon}(m_f - Pm_f) \le 14\delta_m r^2. \quad (55)$$

Observe that (19) and our choice $x = \ln \frac{3}{\alpha}$ imply

$$\sqrt{\frac{2x}{n}} \le \sqrt{\frac{1}{4} \left( 6\phi + \frac{3x}{n} \right)} \le \frac{1}{8\theta_0},$$
so, (53) and the bounds on (i-iv) give

$$ \hat{T}_{n, \phi n}^{\varepsilon} (\ell_f - \ell_{f_P^*}) \geq r^2 \left\{ 2a \left( \frac{1}{\theta_0} - \frac{1}{c} \right) - a^2 \right\} - 8a \delta_q r^2 \quad (56) $$

$$ - \left(6\phi + \frac{3x}{n}\right) M_q - 2ar^2 \sqrt{\frac{2x}{n}} - 14\delta_m r^2 $$

$$ ((19) + M_q \le 2acr^2) \ge r^2 \left\{ 2a \left( \frac{1}{\theta_0} - \frac{1}{c} - \frac{c}{16\theta_0^2} - \frac{1}{8\theta_0} - 4\delta_q \right) - a^2 \right\} - 14\delta_m r^2. $$

**Final step:** apply Lemma E.1 via choices of constants.

We finish the proof via an application of Lemma E.1, assuming as before that $E$ holds. Recall $r := \Phi_P$ and take $\gamma := (32\theta_0^2)^{-1}r^2$. We defined $\delta_m = (448\theta_0^2)^{-1}$ in (45); therefore, (55) gives condition (42) for $r_f \le r$. Now consider the lower bound for $\hat{T}_{n, \phi n}^{\varepsilon} (\ell_f - \ell_{f_P^*})$ when $r_f = r$. Recall from (45) that $\delta_q = (32\theta_0)^{-1}$. Insert this into the RHS of (56) and optimize over $2c > a > 0$. This leads to the choices $c = 4\theta_0$ and $a = c^{-1}$, giving

$$ r^2 \sup_{a,c>0: 2c>a} 2a \left( \frac{1}{\theta_0} - \frac{1}{c} - \frac{c}{16\theta_0^2} - \frac{1}{8\theta_0} - 4\delta_q \right) - a^2 = \frac{r^2}{16\theta_0^2} = 2\gamma. $$

Finally, combine (56) and (52) to obtain:

$$ \text{when } r_f = r : \hat{T}_{n, \phi n}^{\varepsilon} (\ell_f - \ell_{f_P^*}) \ge \gamma. $$

This gives the missing half of (42). Therefore, Lemma E.1 may be applied, and this finishes the proof. □

## F The relation between contamination level and the small-ball assumption

This section corresponds to Remark 8, where we note that a restriction of the form $\varepsilon \le c\theta_0(\mathcal{F}, P)^{-2}$ is necessary in the setting of robust regression with quadratic loss (as in Theorem 5.1).

To prove this, we use a family of distributions and a contamination model discussed in §7.2. Given a dimension $d \in \mathbb{N}$ and a parameter $p \in (0, 1)$, let $X' \sim \text{Normal}(0_{\mathbb{R}^d}, I_{d \times d})$, $\xi \sim \text{Normal}(0, 1)$ be independent. Given $\beta \in \mathbb{R}^d$, we let $P_\beta$ denote the distribution of the random pair $(X, Y)$ given by

$$ X = B_i \frac{X'}{\sqrt{p}} \text{ and } Y = \langle X, \beta \rangle + \xi. $$

Because $X$ is isotropic, robust linear regression in this setting consists of estimating $\beta$ in the Euclidean norm from an $\varepsilon$-contaminated i.i.d. sample from $P_\beta$. Now, clearly,

$$ \forall \beta \in \mathbb{R}^d : \theta_0(\mathcal{F}, P_\beta) = \sqrt{\frac{\pi}{2p}}. $$

The next Lemma roughly says that a contaminated sample from $P_\beta$ with $\varepsilon > c\theta_0(\mathcal{F}, P)^{-2}$ essentially contains no information about $\beta$. More precisely, the Lemma implies via standard arguments that for any $R > 0$, one can find at least one $\beta \in \mathbb{R}^d$ for which the error of any estimator for $\beta$ will be larger than $R$, with probability $\ge 1 - \alpha$.

**Lemma F.1.** For any $\beta \in \mathbb{R}^d$, and parameters $n \in \mathbb{N}$, $\varepsilon, p, \alpha \in (0, 1)$ satisfying

$$ \varepsilon \ge 2p = \frac{\theta_0(\mathcal{F}, P_\beta)^2}{\pi} \quad \text{and} \quad n \ge \left( \frac{2(1-p) + 2\varepsilon}{p} \right) \ln \frac{1}{\alpha} $$

one can define $\varepsilon$-contaminated samples $Z_{1:n}^{\varepsilon, \beta}$ from $P_\beta$ and an i.i.d. (uncontaminated) sample $Z_{0:n}^{0,0_{\mathbb{R}^d}}$ from $P_{0_{\mathbb{R}^d}}$ such that

$$ \mathbb{P} \{ Z_{1:n}^{\varepsilon, \beta} = Z_{1:n}^{0,0_{\mathbb{R}^d}} \} \ge 1 - \alpha. $$

*Proof.* Let $Z_{1:n}^{\beta}$ i.i.d. $P_\beta$, with each $Z_i^\beta = (X_i, Y_i)$. We may assume that $X_i = B_i X_i' / \sqrt{p}$ and $Y_i = \langle X_i, \beta \rangle + \xi_i$ with $(B_i, X_i', \xi_i) \sim (B, X', \xi)$ as above. As a result, a Ber($p$) proportion of $X_i$ in the sample are non-zero. To define an
$\epsilon$-contaminated sample from $P_\beta$, we choose a subset $\mathcal{O} \subset \{i \in [n] : B_i \neq 0\}$ of size $\#\mathcal{O} \leq \epsilon n$ that is as large as possible, and then set:

$$Z_i^{\epsilon, \beta} := \begin{cases} (X_i, Y_i), & i \in [n] \setminus \mathcal{O} \\ (0_{\mathbb{R}^d}, \xi_i), & i \in \mathcal{O}. \end{cases}$$

Now, the random sample consisting of the points $Z_i^{\epsilon, 0, 0, 0} := (0_{\mathbb{R}^d}, \xi_i)$ ($i \in [n]$) is i.i.d. from $P_0$. Moreover, by our definition of the contamination,

$$\{Z_{1:n}^{\epsilon, \beta} = Z_{1:n}^{\epsilon, 0, 0, 0} \} \supset \{\mathcal{O} = \{i \in [n] : B_i \neq 0\}\} = \left\{\sum_{i=1}^{n} B_i \leq \epsilon n\right\}.$$

The sum $\sum_{i=1}^n B_i$ is a binomial random variable with mean $pn$. Chernoff bounds give

$$\mathbb{P}\left\{\sum_{i=1}^{n} B_i \leq \epsilon n\right\} \geq 1 - e^{-\frac{(\epsilon - p)^2 n}{2p(1-p)+2\epsilon}} \geq 1 - \alpha$$

where the our assumptions on $\epsilon$ and $n$ were used in the last two inequalities. $\square$

<figure><img src="image_5.png" /></figure>

## G Algorithms for robust linear regression: details

Recall that the estimator $\hat{f}_n^\epsilon = F_n(Z_{1:n}^\epsilon)$ is defined by the min-max problem

$$F_n(z_{1:n}) \in \arg \min_{f \in \mathcal{F}} \left( \max_{g \in \mathcal{F}} \hat{T}_{n,k} (\ell_f - \ell_g, z_{1:n}) \right). \quad (57)$$

The difference $\ell_f - \ell_g$ is convex in $f$ and concave in $g$, which suggests that the min-max problem above can be efficiently solved. Unfortunately, the trimmed mean operation $\hat{T}_{n,k}$ introduces complications; e.g. it is not obvious how to compute sub- and super-gradients. Besides that, the TM estimator as discussed in the main text requires knowledge of the (usually unknown) contamination level $\epsilon$ to choose the trimming parameter $k = \lfloor \phi n \rfloor$. Analogous issues can also be raised for the Median of Means. Thus, such estimators can only be of practical use if one can surpass these issues.

In the remainder of this section, we restrict ourselves to the setting of linear regression described in §6. We present heuristics to

* compute the min-max problem (57);

* select the trimming level $k$ (and its analogous number of buckets $K$ for the MoM).

As in the aforementioned section, we let $\ell_\beta$ denote the loss associated with a vector $\beta \in \mathbb{R}^d$. Given two vectors $\beta_m, \beta_M \in \mathbb{R}^d$,

$$\hat{T}_{n,k} (\ell_{\beta^m} - \ell_{\beta^M}) = \frac{1}{n-2k} \sum_{i \in I_k(\beta^m, \beta^M, z_{1:n})} (\langle x_i, \beta^m \rangle - y_i)^2 - (\langle x_i, \beta^M \rangle - y_i)^2 \quad (58)$$

where

* each data point $z_i = (x_i, y_i) \in \mathbb{R}^d \times \mathbb{R}$, and

* $I_k(\beta^m, \beta^M, z_{1:n})$ - called the active set for $(\beta^m, \beta^M, z_{1:n})$ - is the set of indices $i \in [n]$ that appear in the trimmed mean, ie. the set obtained once the $k$ largest and $k$ smallest values of $[(\langle x_i, \beta_m \rangle - y_i)^2 - (\langle x_i, \beta_M \rangle - y_i)^2]$ are removed (with ties broken arbitrarily).

In what follows we simplify the notation defining, for every $I \subset [n]$, $x_I$ as the $|I| \times d$ matrix with lines $x_i$, $i \in I$, with $y_I$ defined analogously. We proceed to discuss heuristics to compute the regression vectors.

### G.1 Optimization methods for a fixed trimming parameter

We consider two algorithms to evaluate (57). Algorithm 1 is the Plug-in method considered in the main text. Algorithm 2 is an Alternating Direction Method of Multipliers (ADMM) which is an adaptation of the best performing method in [31].

For the Plug-in method, we set $T_{max} = 20$ in all experiments, as solutions do not improve beyond this number iterations. For the same reasons, we set $T_{max} = 50$ for ADMM. The parameter $\rho$ in Algorithm 2 is set to 5 as in [31].
<table><caption>**Algorithm 2:** Alternating Direction Method of Multipliers.</caption>
  <tbody>
    <tr>
      <td>input</td>
      <td>:(x<sub>1</sub>, y<sub>1</sub>), ..., (x<sub>n</sub>, y<sub>n</sub>) ∈ ℝ<sup>d</sup> × ℝ: the data<br/>β<sub>0</sub><sup>m</sup>, β<sub>0</sub><sup>M</sup> ∈ ℝ<sup>d</sup>: a initial guess<br/>φ: trimming ratio<br/>T<sub>max</sub>: number of iterations<br/>ρ: multiplier parameter</td>
    </tr>
    <tr>
      <td>output</td>
      <td>:β<sub>φ</sub><sup>*</sup>: an approximate solution for the min-max problem<br/>t &lt; 0<br/>k &lt; ⌊φn⌋ (evaluate trimming level)</td>
    </tr>
    <tr>
      <td>while t ≤ T<sub>max</sub></td>
      <td>do<br/>I<sub>t</sub><sup>m</sup> &lt;- I<sub>k</sub> (β<sub>t</sub><sup>m</sup>, β<sub>t</sub><sup>M</sup>, z<sub>1:n</sub>) (get active indices)<br/>β<sub>t+1</sub><sup>m</sup> &lt;- (x<sub>I<sub>t</sub><sup>m</sup></sub>x<sub>I<sub>t</sub><sup>m</sup></sub> + ρI<sub>d</sub>)<sup>-1</sup> (x<sub>I<sub>t</sub><sup>M</sup></sub>y<sub>I<sub>t</sub><sup>m</sup></sub> + ρβ<sub>t</sub><sup>m</sup>)<br/>I<sub>t</sub><sup>M</sup> &lt;- I<sub>k</sub> (β<sub>t+1</sub><sup>m</sup>, β<sub>t</sub><sup>M</sup>, z<sub>1:n</sub>) (get updated active indices)<br/>β<sub>t+1</sub><sup>M</sup> &lt;- (x<sub>I<sub>t</sub><sup>M</sup></sub>x<sub>I<sub>t</sub><sup>M</sup></sub> + ρI<sub>d</sub>)<sup>-1</sup> (x<sub>I<sub>t</sub><sup>M</sup></sub>y<sub>I<sub>t</sub><sup>M</sup></sub> + ρβ<sub>t</sub><sup>M</sup>)<br/>t &lt; t + 1</td>
    </tr>
    <tr>
      <td>end</td>
      <td>β<sub>φ</sub><sup>*</sup> &lt;- arg min {T̂<sub>n,k</sub>(ℓ<sub>β</sub>, z<sub>1:n</sub>) : β ∈ ⋃<sub>t=1</sub><sup>T<sub>max</sub></sup> {β<sub>t</sub><sup>m</sup>, β<sub>t</sub><sup>M</sup>} }.</td>
    </tr>
  </tbody>
</table>

**Remark 10.** Algorithm 2 differs from its analogue in [31] in three ways. First, their estimator is based on the MoM principle. Second, that paper considers a sparse regression setting with an $l_1$ penalty. Third, the final output $\beta_{\phi}^*$ in [31] is simply the final iterate $\beta_{T_{\max}}^m$. Preliminary experiments show that choosing $\beta_{\phi}^*$ as a minimizer of the trimmed empirical risk improves in all settings considered in what follows.

## G.2 Cross-validation

We first recall the cross-validation procedure from the main text. Assume $\phi_1 \le \phi_2 \le \dots \le \phi_m$ is a grid of possible choices for the trimming ratio $\phi$. Recall that the trimming ratio $\phi$ and the trimming level $k$ are related by $k = \lfloor \phi n \rfloor$. Let $v \le n$ be the number of folds: that is, $[n]$ is partitioned into sets $\{B_l\}_{l=1}^v$ with respective sizes $n_l := |B_l| \in \{\lfloor n/v \rfloor, \lfloor n/v \rfloor + 1\}$. The procedure works as follows.

1. For each choice of $(j, l) \in [m] \times [v]$, let $\beta_{\phi_j}^*([n] - B_l)$ be the output of Algorithm 1 on the $n - n_l$ data points $(x_i, y_i)_{i \notin B_l}$.

2. For each choice of $(j, l) \in [m] \times [v]$, estimate the loss of $\beta_{\phi_j}^*([n] - B_l)$ via a trimmed mean with ratio $\phi_j$ on the fold $B_l$:

$$L(j, l) := \hat{T}_{n_l, \phi_j n_l} (\ell_{f_{j,l}}(z_i)_{i \in B_l}).$$

3. For each $j \in [m]$, associate a loss with trimming ratio $\phi_j$ via

$$L(j) := \text{median}(L(j, l) : l \in [v]).$$

4. Choose $\phi^* = \phi_{j^*}$ where $j^* = \arg\max_{j=2,\dots,m} \frac{L(j-1)}{L(j)}$.

5. Compute the final estimator $\beta_{\phi^*}^*$ by running Algorithm 1 with trimming ratio $\phi^*$ on the full dataset $(z_i)_{i \in [n]}$.

We here call the choice of $\phi^*$ made using step (4) above as choice by slope maximization (abbr. **max slope**). We also test a variant of step (4), that is used in [31]:

$$4'. \text{ Choose } \phi^* = \phi_{j^*} \text{ where } j^* = \arg \min_{j=1,\dots,m} L(j).$$

We call this last variant choice by loss minimization (abbr. **min loss**). Both approaches will be compared in the next section.
## G.3 Variants of MoM

As noted in the main text, we compare the performance of the trimmed mean estimator against a variant of the Median of Means procedure from [31]. Recall that MoM requires splitting the $n$ data points into $K$ buckets of approximately equal size. These splits are performed randomly at each iteration, as recommended by [31].

As observed in the article, the parameter $K$ is a close analogue of the trimming parameter $k$ in our procedure. This allows us to adapt the optimization and cross validation procedures described above.

* To adapt the Plug-in and ADMM methods, we use a different concept of active set. Consider the blocks $A_1, \dots, A_K \subset [n]$ used by the median-of-means construction. Then the active set $I_k(\beta^m, \beta^M)$ is the block of indices $A_r$ for which

$$ \frac{1}{\#A_r} \sum_{i \in A_r} (\ell_{\beta^m}(x_i, y_i) - \ell_{\beta^M}(x_i, y_i)) = \text{median} \left\{ \frac{1}{\#A_s} \sum_{i \in A_s} (\ell_{\beta^m}(x_i, y_i) - \ell_{\beta^M}(x_i, y_i)) : s \in [K] \right\}, $$

with ties between blocks broken arbitrarily.

* When performing the optimization iterations, the blocks of median-of-means are resampled uniformly at random at each step.

* The cross validation procedure is now over choices of $K_j$. However, the loss estimate $L(j, l)$ are performed via a MoM estimator using the data in fold $B_l$ with $K_j/v$ blocks. With these changes, both cross-validation methods may be applied.

## G.4 Details on Huber regression

For a given $L > 0$, Huber regression consists in solving

$$ \arg\min_{\beta \in \mathbb{R}^d} \frac{1}{n} \sum_{i=1}^{n} H_L (\langle x_i, \beta \rangle - y_i), \qquad (59) $$

where

$$ H_L(t) = \begin{cases} 2L|t| - L^2 & \text{if } |t| > L \\ t^2 & \text{if } |t| \le L \end{cases}. $$

Let $M \ge 1$ be called shape parameter and $\sigma > 0$ be a scale parameter. Taking $L = M\sigma$, the optimization procedure (59) is equivalent to

$$ \arg\min_{\beta \in \mathbb{R}^d} \frac{1}{n} \sum_{i=1}^{n} H_M \left( \frac{\langle x_i, \beta \rangle - y_i}{\sigma} \right). $$

If $\sigma$ scales with the sample, this parametrization let us uncouple the dependence of $L$ on the sample and on the desired robustness. Indeed, given only the shape parameter $M$, the scaling parameter can be learned from the data solving

$$ \arg\min_{\beta \in \mathbb{R}^d, \sigma > 0} \sigma + \frac{\sigma}{n} \sum_{i=1}^{n} H_M \left( \frac{\langle x_i, \beta \rangle - y_i}{\sigma} \right), \qquad (60) $$

as proposed by [3]. Since this procedure is already implemented in `sklearn` Huber regression method, we simply use it as available there.

In this case, the cross validation procedure selects a shape parameter $M$ between 1 and 1.35. The quantity 1.35 is not incidental, this value yields a 95% statistical efficiency on a Gaussian sample. Thus, as $M$ grows, Huber regression favors efficiency over robustness. We also consider the two variants of the cross validation procedure, but letting

$$ L(j, l) = \frac{1}{|B_l|} \sum_{i \in B_l} |d_i| \mathbf{1}_{|d_i| > L_j} + d_i^2 \mathbf{1}_{|d_i| \le L_j} \qquad (61) $$

where $L_j = M_j\sigma(M_j)$, $\sigma(M_j)$ is obtained from (60) and $d_i = \langle x_i, \beta \rangle - y_i$.

**Remark 11.** Notice that $L(j, l)$ as in (61) does not correspond to the Huber loss (59) or its penalized version (60). Our prior experiments have shown that the choices (59) and (60) tend to select only $M = 1.35$ or $M = 1.0$ for both the min. loss and the max. slope strategies. Meanwhile, (61) yields more nuanced choices of $M$ and better performance.
# H Experiments on linear regression: details and additional results

In this section, we present a detailed description of our experiments with trimmed-mean-based-regression, median-of-means-based-regression, Huber regression, quantile regression, and ordinary least squares. In particular, we will also discuss in greater detail the experimental results from the main text. For convenience, we repeat some of the material from the main text. A GitHub repository with code to reproduce all figures and experiments in the paper can be found at

github.com/lucasresenderc/trimmedmean.

## H.1 Extended Setup A

We extend Setup A from the main text to include heteroscedastic errors. This gives us many examples on which to test the performance of Algorithms 1 and 2 for TM and MoM, as well as the two cross validation strategies proposed for TM, MoM and Huber regressions.

As in the main text, we consider a linear model. Let $d \ge 1$ be an integer and $X_1, X_2, \dots, X_n$ be i.i.d. standard Gaussian's. For $i \in [n]$, define

$$Y_i = \langle X_i, \beta^* \rangle + \xi_i \quad \text{where} \quad \beta^* = \frac{1}{\sqrt{d}} [1, 1, \dots, 1] \in \mathbb{R}^d$$

and the $\xi_i$ are errors. To obtain $\xi_i$ we use the skewed generalized t-distribution from [53] to sample $\eta_i$. This distribution allows us to control the moments and the skew by changing the parameters $\alpha > 0$ and $\lambda \in (-1, 1)$. Recall that if $\lambda = 0$, $\eta_i \sim t(2\alpha)$, where $t(\infty)$ denotes the standard Gaussian. On top of that, we consider two scenarios:

1. Homoscedastic: simply set $\xi_i = \eta_i$ for each $i \in [n]$.

2. Heteroscedastic: in this case we take $\xi_i = \exp(\|X_i\|^2/2) \eta_i$ for each $i \in [n]$.

In our experiments we let $\alpha \in \{0.5, 1, 2, \infty\}$, $\lambda \in \{0, .3, .6, .9\}$ and consider both homoscedastic and heteroscedastic errors, yielding 32 different combinations. We do not consider $\lambda < 0$ as they are symmetric to the corresponding $|\lambda|$.

The contamination model is defined as in the main text: a set of indices $\mathcal{O} \subset [n]$ of size $\lceil \varepsilon n \rceil$ is chosen uniformly at random, and one then sets

$$(X_i^\varepsilon, Y_i^\varepsilon) = (X_i, Y_i) \quad \forall i \notin \mathcal{O} \text{ and } (X_i^\varepsilon, Y_i^\varepsilon) = (\beta^*, 10000) \quad \forall i \in \mathcal{O}.$$

**Remark 12.** Before proceeding, notice that our setup is such that the $L^2$ error $\|\langle\beta, \cdot\rangle - \langle\beta^*, \cdot\rangle\|_{L^2(P_x)}$ equals the Euclidean distance between $\beta$ and $\beta^*$.

## H.2 Experiment design

We design an experiment to simultaneously compare

* the performance of the Plug-in and the ADMM algorithms for the TM and the MoM based regressions;

* the two cross-validation parameter selection variations (max slope and min loss) both in terms of its ability to estimate the contamination level and in terms of the error obtained;

* the overall performance of all five regression methods.

As noted above, the different choices for the $\xi_{1:n}$ lead to 32 different possibilities for the uncontaminated data distribution. As in the main text, we vary the contamination level $\varepsilon$ in

$$\left\{ 0, \frac{2}{100}, \frac{4}{100}, \frac{6}{100}, \frac{8}{100}, \frac{10}{100}, \frac{15}{100}, \frac{20}{100}, \frac{30}{100}, \frac{40}{100} \right\}.$$

Thus giving 160 combinations of data distributions and contamination levels. In all cases, we set $d = 20$, $n = 300$, and we evaluate performance by performing 96 independent trials. Moreover, cross-validation with always be performed with $v = 5$ folds.

For each trial, we evaluated:

* For the TM and the MoM: the performance of the four different combinations of optimization and cross validation methods (ADMM with max slope, Plug-in with max slope, ADMM with min loss and Plug-in with min loss).
<figure><img src="image_6.png" /><figcaption>Figure 2: Comparison of the two cross validation strategies – minimum loss (min. loss.) and maximum slope (max. slope.) – across all experimental results. Bands represent the 5% and the 95% percentiles, while the solid line displays the median.</figcaption></figure>

* For the Huber regression: the performance of the two cross validation strategies.

* For quantile and OLS no parameter was necessary, so we simply evaluated their performance.

The grid of values for $\phi$ used during the cross-validation for the trimmed-mean-based-regression was

$$ \{ \varepsilon' + \frac{1}{30} : \varepsilon' \in \{ 0, \frac{2}{100}, \frac{4}{100}, \frac{6}{100}, \frac{8}{100}, \frac{10}{100}, \frac{15}{100}, \frac{20}{100}, \frac{30}{100}, \frac{40}{100} \} \}, $$

for the selection of the number of buckets $K$ for the median-of-means-based-regression was

$$ \{ 2 \left( \varepsilon' + \frac{1}{30} \right) + 1 : \varepsilon' \in \{ 0, \frac{2}{100}, \frac{4}{100}, \frac{6}{100}, \frac{8}{100}, \frac{10}{100}, \frac{15}{100}, \frac{20}{100}, \frac{30}{100}, \frac{40}{100} \} \}, $$

and for the shape parameter $M$ for Huber regression was

$$ \{ 1 + \frac{i}{9} \times 0.35 : i = 0, 1, 2, \dots, 9 \}. $$

### H.3 Preliminary experiments on algorithms and cross validation strategies

We begin observing that over all executions, the Plug-in method outperformed the ADMM 52.7% for of times for the TM and 92.7% of the times for the MoM. The Plug-in algorithm is also faster to run. This justifies our choice for Algorithm 1.

We also considered the performance of the two cross validation strategies proposed: the one based on the slope heuristic and the one based on the minimum loss. Figure 2 provides a comparison between both strategies over all our experimental results. We notice that the **min. loss.** strategy tends to select larger trimming levels for the TM and larger number of buckets for the MoM, trying to approximate both strategies to the median. Meanwhile, the parameter obtained with the **max. slope** strategy linearly follows the contamination level $\varepsilon$. We do note that both cross-validation methods are conservative for small contamination levels. As for the Huber regression, the **min. loss.** strategy provides a wider range of choices for the shape parameter. For instance, it is able to select $M = 1.35$ when $\varepsilon = 0$ and $\alpha = \infty$. Moreover, it also outperforms the **max. slope** in terms of $L_2$ error. Therefore, we choose the **max. slope** strategy for TM and MoM and the **min. loss** strategy for Huber regression.

### H.4 Experimental results

We now show the results of all the experimental combinations described above.

Figures 3 and 4 correspond to two different evaluations of the method. In Figure 3, we see the magnitude of the error of each error, for each combination of $(\alpha, \lambda, \varepsilon)$ (blue is smallest, red is largest). The colors in Figure 4 corresponds to the percentage of times a specific method was the top performer for the corresponding combination of $(\alpha, \lambda, \varepsilon)$.

We highlight the conclusions from the main text:
<figure><img src="image_7.png" /><figcaption>Figure 3: Heatmap of the $L^2$ error $\|\hat{\beta}_n - \beta^*\|$. Each line is a different combination of $(\alpha, \lambda)$ and homoscedasticity/heteroscedasticity. The columns vary the method and the contamination level $\varepsilon$.</figcaption></figure>

<figure><img src="image_8.png" /><figcaption>Figure 4: Percentage of seeds over which each method is the top performer. Each line is a different combination of $(\alpha, \lambda)$ and homoscedasticity/heteroscedasticity. The columns vary the method and the contamination level $\varepsilon$. The bluer the entry, the higher the percentage of times that the specific method was the top performer for that choice of $(\alpha, \lambda, \varepsilon)$.</figcaption></figure>

• Huber regression is the most well-rounded method, being an overall good choice.
* MoM is the best performing method in when the contamination level is very large ($\epsilon = 0.4$) and the distributions are very heavy tailed. Quantile regression tends to outperform it in general.

* The TM outperforms Huber regression when tails are not extremely heavy, and deals better with skewed distributions.

* The OLS only performs well under no contamination and light-tailed distributions.

<figure><img src="image_9.png" /><figcaption>Figure 5: Parameter selected via cross-validation for different choices of ($\alpha, \lambda$). Recall TM and MoM use the **max. slope** strategy and Huber regression uses **min. loss** strategy. Homocedastic and heteroscedastic cases are displayed together as it does not seem to impact the parameter selection.</figcaption></figure>

Figure 5 displays the parameter selected by the cross validation procedure for each method. It highlights a difference in the mechanism underlying the classical Huber regression and the Median of Means or Trimmed mean. The trimming level ($\phi$) of the TM and the number of buckets ($K$) of the MoM are driven mostly by the contamination level, in a linear way. This empirical observation is aligned with our theoretical results for the TM and the ones in [31] for the MoM, since we propose $\phi \approx \frac{1}{n}\ln\frac{1}{\delta} + \epsilon$ and they propose $K \approx \ln\frac{1}{\delta} + 2\epsilon n$. Meanwhile, the shape parameter for Huber regression is driven not only by the contamination level, but also by the moments available and the skewness: it decays as $\epsilon$ increases, but also as $\alpha$ decreases and $\lambda$ increases. We highlight homocedasticity and heteroscedasticity have a minor impact on the selected parameters for all three methods.

## Acknowledgments

The work of RIO was supported by a Bolsa de Produtividade em Pesquisa and a Projeto Universal from CNPq, Brazil; and by a Cientista do Nosso Estado grant from FAPERJ, Rio de Janeiro, Brazil. The work of LR was supported by the Conselho Nacional de Desenvolvimento Científico e Tecnológico (CNPq).

## References

[1] S.M. Stigler. *The Seven Pillars of Statistical Wisdom*. Harvard University Press, 2016. ISBN 9780674970212.
URL https://books.google.com.br/books?id=LQUEDAAAQBAJ.

[2] Peter J Huber. A robust version of the probability ratio test. *The Annals of Mathematical Statistics*, pages 1753–1758, 1965.

[3] Peter J Huber and Elvezio M Ronchetti. *Robust statistics*. John Wiley & Sons, 2011.

[4] Olivier Catoni. Challenging the empirical mean and empirical variance: A deviation study. *Annales de l'Institut Henri Poincaré, Probabilités et Statistiques*, 48(4), nov 2012. doi:10.1214/11-AIHP454.

[5] Luc Devroye, Matthieu Lerasle, Gabor Lugosi, and Roberto I. Oliveira. Sub-gaussian mean estimators. *The Annals of Statistics*, 44(6), dec 2016. doi:10.1214/16-aos1440.

[6] Jasper CH Lee and Paul Valiant. Optimal sub-gaussian mean estimation in $\mathbb{R}$. In *2021 IEEE 62nd Annual Symposium on Foundations of Computer Science (FOCS)*, pages 672–683. IEEE, 2022.

[7] Ilias Diakonikolas, Gautam Kamath, Daniel Kane, Jerry Li, Ankur Moitra, and Alistair Stewart. Robust estimators in high dimensions without the computational intractability. *SIAM Journal on Computing*, 48(2):742–864, 2019. ISSN 1095-7111. doi:10.1137/17M1126680. URL https://hdl.handle.net/1721.1/126386.
[8] Gábor Lugosi and Shahar Mendelson. Near-optimal mean estimators with respect to general norms. *Probability Theory and Related Fields*, 175(3-4):957-973, mar 2019. doi:https://doi.org/10.1007/s00440-019-00906-4.

[9] Gábor Lugosi and Shahar Mendelson. Risk minimization by median-of-means tournaments. *Journal of the European Mathematical Society*, 22(3):925-965, dec 2019. doi:10.4171/JEMS/937.

[10] Gábor Lugosi and Shahar Mendelson. Robust multivariate mean estimation: The optimality of trimmed mean. *The Annals of Statistics*, 49(1), feb 2021. doi:10.1214/20-aos1961.

[11] Samuel B. Hopkins. Mean estimation with sub-Gaussian rates in polynomial time. *The Annals of Statistics*, 48(2): 1193–1213, 2020. doi:10.1214/19-AOS1843. URL https://doi.org/10.1214/19-AOS1843.

[12] Jules Depersin and Guillaume Lecué. Robust sub-gaussian estimation of a mean vector in nearly linear time. *The Annals of Statistics*, 50(1), feb 2022. doi:10.1214/21-aos2118.

[13] Stanislav Minsker. Geometric median and robust estimation in banach spaces. *Bernoulli*, 21(4), nov 2015. doi:https://doi.org/10.3150/14-BEJ645.

[14] Stanislav Minsker. Sub-Gaussian estimators of the mean of a random matrix with heavy-tailed entries. *The Annals of Statistics*, 46(6A):2871–2903, 2018. doi:10.1214/17-AOS1642. URL https://doi.org/10.1214/17-AOS1642.

[15] Shahar Mendelson and Nikita Zhivotovskiy. Robust covariance estimation under $L_4 - L_2$ norm equivalence. *The Annals of Statistics*, 48(3):1648–1664, 2020. doi:10.1214/19-AOS1862. URL https://doi.org/10.1214/19-AOS1862.

[16] Pedro Abdalla and Nikita Zhivotovskiy. Covariance estimation: Optimal dimension-free guarantees for adversarial corruption and heavy tails, 2022. URL https://arxiv.org/abs/2205.08494.

[17] Gábor Lugosi and Shahar Mendelson. Mean estimation and regression under heavy-tailed distributions: A survey. *Found. Comput. Math.*, 19(5):1145–1190, 2019. doi:10.1007/s10208-019-09427-x. URL https://doi.org/10.1007/s10208-019-09427-x.

[18] Yihe Dong, Samuel Hopkins, and Jerry Li. Quantum entropy scoring for fast robust mean estimation and improved outlier detection. In H. Wallach, H. Larochelle, A. Beygelzimer, F. d'Alché-Buc, E. Fox, and R. Garnett, editors, *Advances in Neural Information Processing Systems*, volume 32. Curran Associates, Inc., 2019. URL https://proceedings.neurips.cc/paper/2019/file/a4d92e2cd541fca87e4620aba658316d-Paper.pdf.

[19] Ilias Diakonikolas, Daniel M. Kane, Ankit Pensia, and Thanasis Pittas. Streaming algorithms for high-dimensional robust statistics. In Kamalika Chaudhuri, Stefanie Jegelka, Le Song, Csaba Szepesvári, Gang Niu, and Sivan Sabato, editors, *International Conference on Machine Learning, ICML 2022, 17-23 July 2022, Baltimore, Maryland, USA*, volume 162 of *Proceedings of Machine Learning Research*, pages 5061–5117. PMLR, 2022. URL https://proceedings.mlr.press/v162/diakonikolas22a.html.

[20] Stephen M. Stigler. The changing history of robustness. *The American Statistician*, 64(4):277-281, 2010. doi:10.1198/tast.2010.10159. URL https://doi.org/10.1198/tast.2010.10159.

[21] Peter J. Huber. The 1972 Wald Lecture Robust Statistics: A Review. *The Annals of Mathematical Statistics*, 43(4): 1041 – 1067, 1972. doi:10.1214/aoms/1177692459. URL https://doi.org/10.1214/aoms/1177692459.

[22] Stephen M. Stigler. The asymptotic distribution of the trimmed mean. *The Annals of Statistics*, 1(3):472-477, 1973. ISSN 00905364. URL http://www.jstor.org/stable/2958105.

[23] Louis A. Jaeckel. Some Flexible Estimates of Location. *The Annals of Mathematical Statistics*, 42(5):1540 – 1552, 1971. doi:10.1214/aoms/1177693152. URL https://doi.org/10.1214/aoms/1177693152.

[24] Alan H. Welsh Jana Jurecková, Roger Koenker. Adaptive choice of trimming proportions. *Annals of the Institute of Statistical Mathematics*, 46(4):737-755, 1994.

[25] Peter Hall. Large sample property of Jaeckel's adaptive trimmed mean. *Annals of the Institute of Statistical Mathematics*, 33(A):449-462, 1981.

[26] Roberto I. Oliveira and Zoraida F. Rico. Improved covariance estimation: optimal robustness and sub-gaussian guarantees under heavy tails, 2022. URL https://arxiv.org/abs/2209.13485.

[27] Zoraida Fernández Rico. *Optimal statistical estimation: sub-Gaussian properties, heavy-tailed data, and robustness*. PhD thesis, Instituto de Matemática Pura e Aplicada (IMPA), 2022.

[28] S.A. Geer. *Empirical Processes in M-Estimation*. Cambridge Series in Statistical and Probabilistic Mathematics. Cambridge University Press, 2000. ISBN 9780521650021. URL https://books.google.com.br/books?id=2DYoMRz_OYEC.
[29] Stephane Boucheron, Gabor Lugosi, and Pascal Massart. *Concentration Inequalities: A Nonasymptotic Theory of Independence*. Cambridge University Press, 2013.

[30] Stanislav Minsker. Uniform bounds for robust mean estimators. *arXiv preprint arXiv:1812.03523*, 2018.

[31] Guillaume Lecué and Matthieu Lerasle. Robust machine learning by median-of-means: Theory and practice. *The Annals of Statistics*, 48(2), apr 2020. doi:10.1214/19-AOS1828.

[32] Jean-Yves Audibert and Olivier Catoni. Robust linear least squares regression. *The Annals of Statistics*, 39(5): 2766-2794, 2011.

[33] Gábor Lugosi and Shahar Mendelson. Sub-gaussian estimators of the mean of a random vector. *The Annals of Statistics*, 47(2), apr 2019. doi:10.1214/17-AOS1639.

[34] Yeshwanth Cherapanamjeri, Nilesh Tripuraneni, Peter Bartlett, and Michael Jordan. Optimal mean estimation without a variance. In *Conference on Learning Theory*, pages 356–357. PMLR, 2022.

[35] Samuel B. Hopkins, Jerry Li, and Fred Zhang. Robust and heavy-tailed mean estimation made simple, via regret minimization. In Hugo Larochelle, Marc'Aurelio Ranzato, Raia Hadsell, Maria-Florina Balcan, and Hsuan-Tien Lin, editors, *Advances in Neural Information Processing Systems 33: Annual Conference on Neural Information Processing Systems 2020, NeurIPS 2020, December 6-12, 2020, virtual*, 2020. URL https://proceedings.neurips.cc/paper/2020/hash/8a1276c25f5efe85f0fc4020fbf5b4f8-Abstract.html.

[36] Jules Depersin and Guillaume Lecué. Optimal robust mean and location estimation via convex programs with respect to any pseudo-norms. *Probability Theory and Related Fields*, 183(3):997-1025, 2022.

[37] Christian Brownlees, Emilien Joly, and Gábor Lugosi. Empirical risk minimization for heavy-tailed losses. *The Annals of Statistics*, 43(6):2507–2536, 2015. doi:10.1214/15-AOS1350. URL https://doi.org/10.1214/15-AOS1350.

[38] Jaouad Mourtada, Tomas Vaskevicius, and Nikita Zhivotovskiy. Distribution-free robust linear regression. CoRR, abs/2102.12919, 2021. URL https://arxiv.org/abs/2102.12919.

[39] Ilias Diakonikolas, Gautam Kamath, Daniel Kane, Jerry Li, Jacob Steinhardt, and Alistair Stewart. Sever: A robust meta-algorithm for stochastic optimization. In Kamalika Chaudhuri and Ruslan Salakhutdinov, editors, *Proceedings of the 36th International Conference on Machine Learning*, volume 97 of *Proceedings of Machine Learning Research*, pages 1596–1606. PMLR, 09–15 Jun 2019. URL https://proceedings.mlr.press/v97/diakonikolas19a.html.

[40] AW van der Vaart, A. van der Vaart, and J. Wellner. *Weak Convergence and Empirical Processes: With Applications to Statistics*. Springer Series in Statistics. Springer, 1996. ISBN 9780387946405. URL https://books.google.com.br/books?id=0CenCW9qmp4C.

[41] Victor Chernozhukov, Denis Chetverikov, and Kengo Kato. Gaussian approximation of suprema of empirical processes. *The Annals of Statistics*, 42(4):1564–1597, 2014. doi:10.1214/14-AOS1230. URL https://doi.org/10.1214/14-AOS1230.

[42] Michel Talagrand. New concentration inequalities in product spaces. *Inventiones mathematicae*, 126(3):505–563, 1996.

[43] Olivier Bousquet. A bennett concentration inequality and its application to suprema of empirical processes. *Comptes Rendus Mathematique*, 334(6):495-500, 2002. ISSN 1631-073X. doi:https://doi.org/10.1016/S1631-073X(02)02292-6. URL https://www.sciencedirect.com/science/article/pii/S1631073X02022926.

[44] N. Alon and J.H. Spencer. *The Probabilistic Method*. Wiley Series in Discrete Mathematics and Optimization. Wiley, 2016. ISBN 9781119061953. URL https://books.google.com.br/books?id=Iu5RCgAAQBAJ.

[45] Sébastien Bubeck, Nicolò Cesa-Bianchi, and Gábor Lugosi. Bandits with heavy tail. *IEEE Trans. Inf. Theory*, 59(11):7711–7717, 2013. doi:10.1109/TIT.2013.2277869. URL https://doi.org/10.1109/TIT.2013.2277869.

[46] Bharath K. Sriperumbudur, Kenji Fukumizu, Arthur Gretton, Bernhard Schölkopf, and Gert R. G. Lanckriet. On the empirical estimation of integral probability metrics. *Electronic Journal of Statistics*, 6(none), jan 2012. doi:10.1214/12-ejs722.

[47] Bharath Sriperumbudur. On the optimal estimation of probability measures in weak and strong topologies. *Bernoulli*, 22(3), aug 2016. doi:10.3150/15-bej713.

[48] Pascal Massart. Some applications of concentration inequalities to statistics. In *Annales de la Faculté des sciences de Toulouse: Mathématiques*, pages 245-303, 2000.
[49] Shahar Mendelson. Learning without concentration. *Journal of the ACM (JACM)*, 62(3):1-25, 2015.

[50] Guillaume Lecué and Shahar Mendelson. Learning subgaussian classes: Upper and minimax bounds. *arXiv preprint arXiv:1305.4825*, 2013.

[51] Guillaume Lecué and Matthieu Lerasle. Learning from mom's principles: Le cam's approach. *Stochastic Processes and their applications*, 129(11):4385-4410, 2019.

[52] Lucien Birgé and Pascal Massart. Gaussian model selection. *Journal of the European Mathematical Society*, 3: 203-268, 2001.

[53] Chengdi Lian, Yaohua Rong, and Weihu Cheng. On a novel skewed generalized t distribution: Properties, estimations, and its applications. *Communications in Statistics-Theory and Methods*, 54(2):396-417, 2025.

[54] Kazimierz Kuratowski and Czesław Ryll-Nardzewski. A general theorem on selectors. *Bull. Acad. Polon. Sci. Sér. Sci. Math. Astronom. Phys*, 13(6):397-403, 1965.

[55] Geoffrey Chinot, Guillaume Lecué, and Matthieu Lerasle. Robust statistical learning with lipschitz and convex loss functions. *Probability Theory and related fields*, 176(3):897-940, 2020.