Robustly Learning a Gaussian: Getting Optimal Error, Efficiently

Ilias Diakonikolas, Gautam Kamath, Daniel M. Kane, Jerry Li, Ankur Moitra, Alistair Stewart

Introduction

The most popular and widely used modeling assumption is that data is approximately Gaussian. This is a convenient simplification to make when modeling velocities of particles in an ideal gas [Goo15], measuring physical characteristics across a population (after controlling for gender), and even modeling fluctuations in a stock price on a logarithmic scale. However, real data is not actually Gaussian and is at best crudely approximated by a Gaussian (e.g., with heavier tails). What’s worse is that estimators designed under this assumption can perform poorly in practice and be heavily biased by just a few errant samples that do not fit the model.

For over fifty years, the field of robust statistics [HR09, HRRS86, RL05] has studied exactly this phenomenon — the sensitivity or insensitivity of estimators to small deviations in the model. Unsurprisingly, one of the central questions that shaped its development was the problem of learning the parameters of a one-dimensional Gaussian distribution when a small fraction of the samples are arbitrarily corrupted. More precisely, in 1964, Huber [Hub64] introduced the following model:

In Huber’s contamination model, we are given samples from a distribution

where N(μ,σ2)\mathcal{N}(\mu,\sigma^{2}) is a Gaussian of mean μ\mu and variance σ2\sigma^{2}, and Z\mathcal{Z} is an arbitrary distribution chosen by an adversary.

Intuitively, among our samples, about a (1−ε)(1-\varepsilon) fraction will have been generated from a Gaussian and are called inliers, and the rest are called outliers or gross corruptions. We will work with an even more challengingNone of the results in our paper were previously known in Huber’s contamination model either. The reason we work with this stronger model is because we can — nothing in our analysis relies on the inliers and outliers being independent. model — called the strong contamination model (Definition 2) — where the adversary is allowed to look at the inliers and then decide on the outliers. The literature on robust statistics has given numerous explanations and empirical investigations [GCSR14, Ham01] into how such outliers might arise as the result of equipment failure, data being entered incorrectly, or even from a subpopulation that was not accounted for in a medical study. These types of errors are erratic and difficult to model, so instead our goal is to design a procedure that accurately estimates μ\mu and σ2\sigma^{2} without making any assumptions about them.

In one dimension, the median and median absolute deviation are well-known robust estimators for the mean and variance respectively. In particular, given samples X1,X2,…,XnX_{1},X_{2},\ldots,X_{n}, we can compute

where Φ\Phi is the cumulative distribution of the standard Gaussian. (This scaling constant is needed to ensure that σ^\widehat{\sigma} is an unbiased estimator when there is no noise.) If n≥Clog⁡1/δε2n\geq C\frac{\log 1/\delta}{\varepsilon^{2}}, then with probability at least 1−δ1-\delta we have that dTV(N(μ,σ2),N(μ^,σ^2))≤Cεd_{TV}(\mathcal{N}(\mu,\sigma^{2}),\mathcal{N}(\widehat{\mu},\widehat{\sigma}^{2}))\leq C\varepsilon. In Huber’s contamination model, this is the strongest type of error guarantee we could hope forSee Lemma 17. and captures both the task of learning the underlying parameters μ\mu and σ2\sigma^{2}, and finding the approximately best fit to the observed distribution within the family of one-dimensional Gaussians. In fact there are plentifully many other estimators — such as the trimmed mean, winsorized mean, Tukey’s biweight function, and the interquartile range — that achieve the same sorts of error guarantees, up to constant factors. The design of robust estimators for location (e.g., estimating μ\mu) and scale (e.g., estimating σ2\sigma^{2}) is guided by certain overarching principles, such as the notion of the influence curve [HRRS86] or the notion of breakdown point [RL05]. In some cases, it is even possible to design robust estimators that are minimax optimal [Hub64].

These days, much of modern data analysis revolves around high-dimensional data — for example, when we model documents [BNJ03], images [OF96], and genomes [NJB+08] as vectors in a very high-dimensional space. The need for robust estimators is even more pressing in these applications, since it is infeasible to remove obvious outliers by inspection. However, adapting robust statistics to high-dimensional settings is fraught with challenges. The principles that guided the design of robust estimators in one dimension seem to inherently lead to high-dimensional estimators that are hard to compute [Ber06, HM13].

In this paper, we focus on the central problem of learning the parameters of a multivariate Gaussian N(μ,Σ)\mathcal{N}(\mu,\Sigma) in the strong contamination model. The textbook estimators for the mean and covariance – such as the Tukey median [Tuk75] and minimum volume enclosing ellipsoid [Rou85] – essentially search for directions where the projection of D\mathcal{D} is suitably non-Gaussian. However, trying to find a direction where the projection is non-Gaussian can be like looking for a needle in an exponentially-large haystack – these statistics are not efficiently computable, in general. Furthermore, a random projection will look Gaussian with high probability [Kla07].

In this paper, our main result is an efficiently computable estimator for a high-dimensional Gaussian that achieves error

in the strong contamination model, for a universal constant CC that is independent of the dimension. For a Gaussian distribution, we consider estimation in terms of total variation distance, which is equivalent to estimating the parameters under the natural measures. Our main idea is to use various regularity conditions satisfied by the inliers to make the problem of searching for non-Gaussian projections easier. When just the mean μ\mu is unknown, our algorithm runs in time polynomial in the dimension dd and 1/ε1/\varepsilon. When both the mean and covariance are unknown, our algorithm runs in time polynomial in dd and quasi-polynomial in 1/ε1/\varepsilon. All of our algorithms achieve polynomial sample complexity.

Prior to our work, the best known algorithm of Diakonikolas et al. [DKK+16] achieved estimation error O(εlog⁡1/ε)O(\varepsilon\log 1/\varepsilon) for this problem We note that, as stated, the results in [DKK+16] give estimation error O(εlog⁡3/21/ε)O(\varepsilon\log^{3/2}1/\varepsilon). However, combining the techniques in [DKK+16] with the arguments in Section 7 of this paper gives the stated bound. This argument will be included in the full version of [DKK+16]., again with respect to total variation distance. Concurrently, Lai, Rao and Vempala [LRV16] gave an algorithm which achieves estimation error roughly O(ε1/2log⁡1/2d)O(\varepsilon^{1/2}\log^{1/2}d). In fact, the algorithm of Diakonikolas et al. [DKK+16] works in a stronger model than what we consider here, where an adversary gets to look at the samples and then decides on an ε\varepsilon-fraction to move arbitrarily. Such errors are both additive and subtractive (because inliers are removed). Interestingly, Diakonikolas, Kane and Stewart [DKS17] proved that any Statistical Query learning algorithm that works in such an additive and subtractive model and achieves an error guarantee asymptotically better than O(εlog⁡1/21/ε)O(\varepsilon\log^{1/2}1/\varepsilon) must make a super-polynomial number of statistical queries. Our work shows a natural conclusion that in an additive only model it is possible to algorithmically achieve the same error guarantees as are possible in the one-dimensional case, up to a universal constant.

2 Our Results and Techniques

In what follows, we will explain both our work as well as prior work through the following lens:

At the core of any robust estimator is some procedure to certify that the estimates have not been moved too far away from the true parameters by a small number of corruptions.

First, we consider the subproblem where the covariance Σ=I\Sigma=I is known and only the mean μ\mu is unknown. In the terminology of robust statistics, this is called robust estimation of location. If we could compute the Tukey median, we would have an estimate that satisfies dTV(N(μ,I),N(μ^,I))≤Cεd_{TV}(\mathcal{N}(\mu,I),\mathcal{N}(\widehat{\mu},I))\leq C\varepsilon. The way that the Tukey median guarantees that it is close to the true mean is that along every direction uu it is close to the median of the projection of the samples. More precisely, at least a 1−ε2\frac{1-\varepsilon}{2} fraction of the samples satisfy uTXi≥uTμ^u^{T}X_{i}\geq u^{T}\widehat{\mu}, and at least a 1−ε2\frac{1-\varepsilon}{2} fraction of the samples satisfy uTμ^≥uTXiu^{T}\widehat{\mu}\geq u^{T}X_{i}. However, if we have a candidate μ^\widehat{\mu}, finding a direction uu that violates this condition is again like searching for a needle in an exponentially large haystack.

The approach of Diakonikolas et al. [DKK+16] was essentially a data-dependent way to search for appropriate directions uu, by looking for directions where the empirical variance is larger than it should be (if there were no corruptions). However, because their approach considers only a single direction at a time, it naturally gets stuck at error Θ(εlog⁡1/21/ε)\Theta(\varepsilon\log^{1/2}1/\varepsilon). This is because along the direction uu, only when a point is Ω(log⁡1/21/ε)\Omega(\log^{1/2}1/\varepsilon) away from most of the rest of the samples can we be relatively confident that it is an outlier. Thus, an adversary could safely place all the corruptions in the tails and move the mean by as much as Θ(εlog⁡1/21/ε)\Theta(\varepsilon\log^{1/2}1/\varepsilon). This would not affect the Tukey median by as much, but would affect an estimate based on the empirical mean (because the algorithm could find no other outliers to remove) by considerably more.

Our approach is to consider logarithmically many directions at once. Even though an inlier can be logarithmically many standard deviations away from the mean along a single direction uu with reasonable probability, it is unlikely to be that many standard deviations away simultaneously across many orthogonal directions. Essentially, this allows us to remove the influence of outliers on all but a logarithmic dimensional subspace. Combining this with an algorithm for robustly learning the mean in time exponential in the dimension (but polynomial in the number of samples), we obtain our first main result:

Suppose we are given a set of n=poly⁡(d,1/ε)n=\operatorname*{poly}(d,1/\varepsilon) samples from the strong contamination model, where the underlying dd-dimensional Gaussian is N(μ,I)\mathcal{N}(\mu,I). Let ε≤ε0\varepsilon\leq\varepsilon_{0}, where ε0\varepsilon_{0} is a positive universal constant. For any β>0\beta>0, there is an algorithm to learn an estimate N(μ^,I)\mathcal{N}(\widehat{\mu},I) that with high probability satisfies

Moreover, the algorithm runs in time poly⁡(n,(1/ε)β)\operatorname*{poly}(n,(1/\varepsilon)^{\beta}).

We prove an almost matching lower bound of ε2+Ω(ε2)\frac{\varepsilon}{2}+\Omega(\varepsilon^{2}) on the estimation error. Thus, our robustness guarantee is optimal up to a factor of 2\sqrt{2}, even among computationally inefficient robust estimators. Interestingly, our extra factor of 2\sqrt{2} comes from the following geometric fact which we make crucial use of: Any convex body of diameter DD in any dimension can be covered by a ball of radius D/2D/\sqrt{2}, and moreover such a ball can be (approximately) found in time exponential in the dimension. Suppose that along some direction uu we have an estimate pp that is guaranteed to be within ε/2\varepsilon/2 of the projection of the true mean μ\mu. We can now confine μ\mu to a slab of width ε\varepsilon, and by taking the intersection of all such slabs we get a convex body that contains μ\mu and has diameter of at most ε\varepsilon. By covering the body with a ball of radius ε/2\varepsilon/\sqrt{2}, we are guaranteed that the center of the ball is within ε/2\varepsilon/\sqrt{2} of the true mean. This gives us a general way to combine one-dimensional robust estimates along a net of directions.

We note that, for general isotropic sub-Gaussian distributions, the bound of O(εlog⁡1/21/ε)O(\varepsilon\log^{1/2}1/\varepsilon) of [DKK+17] is optimal for robust mean estimation, even in one dimension. See Section A for a proof of this fact. However, our results can be seen to hold more generally than stated above – indeed, the same arguments work for a class of symmetric isotropic sub-Gaussian distributions which are sufficiently smooth near their mean. More precisely, we require that along any univariate projection, the mean is robustly estimated by the median.

We next consider the subproblem where the mean μ=0\mu=0 is known and only the covariance Σ\Sigma is unknown. In the terminology of robust statistics, this is called robust estimation of scale. In this case, we want to compute an estimate Σ^\widehat{\Sigma} that satisfiesMore precisely, to obtain O(ε)O(\varepsilon) error guarantee with respect to the total variation distance, we need to robustly approximate Σ\Sigma within O(ε)O(\varepsilon) in Mahalanobis distance, which is a stronger metric than the Frobenius norm. As part of our approach, we are able to efficiently reduce to the case that Σ\Sigma is close to the identity matrix, in which case the Frobenius error suffices. ∥Σ−Σ^∥F≤Cε\|\Sigma-\widehat{\Sigma}\|_{F}\leq C\varepsilon. When Σ^\widehat{\Sigma} does not satisfy this condition, it can be shown (in Section 6.2.3) that there is a degree-two polynomial p(X)p(X), where

It turns out that, even given the polynomial p(X)p(X), deciding whether or not the above conditions approximately hold is challenging. Given p(X)p(X) and Σ^\widehat{\Sigma}, we can certainly compute \mboxEX∼N(0,Σ^)[p(X)]\mathop{\mbox{\bf E}}_{X\sim\mathcal{N}(0,\widehat{\Sigma})}[p(X)]. But given only contaminated samples from N(0,Σ)\mathcal{N}(0,\Sigma) and without knowing what Σ\Sigma is, can we estimate \mboxEX∼N(0,Σ)[p(X)]\mathop{\mbox{\bf E}}_{X\sim\mathcal{N}(0,\Sigma)}[p(X)]?

Often, univariate robust estimation problems are considered easy, with a simple recipe: Construct an unbiased estimator for the statistic for which each sample point has low influence. However, in our setting, it is highly non-trivial to construct such an estimator. The naive attempt in this case would be the median – this immediately fails since the distribution of p(X)p(X) is asymmetric. Even if there were no noise, that would not necessarily be an unbiased estimator. So how can we dampen the influence of outliers, if there is no natural symmetry in the distribution? We construct a robust estimator crucially using the fact that p(X)p(X) is the weighted sum of chi-squared random variables when there is no noise. The key structural fact we exploit is the following: Given two sums of chi-squared random variables, if the random variables are far in total variation distance, most of their difference must lie close to their means. We use this fact to show how, given a weak estimate of the mean (i.e., one which is only accurate up ω(ε)\omega(\varepsilon)), one can improve the estimate by a constant factor. Our result follows by an iterative application of this technique.

However, there is still a major complication in utilizing our low-dimensional estimator to obtain a high-dimensional estimator. In the unknown mean case, we knew the higher-order moments (since we assumed that the covariance is the identity). Here, we do not have control over the higher-order moments of the unknown Gaussian. Overcoming this difficulty requires several new techniques, which are quite complicated, and we defer the full details to Section 6. Our second main result is:

Suppose we are given a set of n=poly⁡(d,1/ε)n=\operatorname*{poly}(d,1/\varepsilon) samples from the strong contamination model, where the underlying dd-dimensional Gaussian is N(0,Σ)\mathcal{N}(0,\Sigma). There is an algorithm to learn an estimate N(0,Σ^)\mathcal{N}(0,\widehat{\Sigma}) that runs in time poly⁡(n,(1/ε)O(log⁡41/ε))\operatorname*{poly}(n,(1/\varepsilon)^{O(\log^{4}1/\varepsilon)}) and with high probability satisfies

for a universal constant CC that is independent of the dimension.

A key technical problem arises when we attempt to combine estimates for the covariance restricted to a subspace and its orthogonal complement. We refer to this as a stitching problem, where if we write Σ\Sigma as

and have accurate estimates for ΣV\Sigma_{V} and ΣV⊥\Sigma_{V^{\perp}}, we still need to accurately estimate AA. Our algorithm utilizes an unexpected connection to the unknown mean case: We show that, under a carefully chosen projection scheme, we can simulate noisy samples from a Gaussian with identity covariance, where the mean of this distribution encodes the information needed to recover AA. We defer the full details to Section 6.4.

It turns out that we can solve the general case when both μ\mu and Σ\Sigma are unknown, by directly reducing to the previous subproblems, exactly as was done in [DKK+16] (with some caveats, addressed in Section 4.4). Since all of our error guarantees are optimal up to constant factors, there is only a constant factor loss in this reduction. Finally, we obtain the following corollary:

Suppose we are given a set of n=poly⁡(d,1/ε)n=\operatorname*{poly}(d,1/\varepsilon) samples from the strong contamination model, where the underlying dd-dimensional Gaussian is N(μ,Σ)\mathcal{N}(\mu,\Sigma). There is an algorithm to learn an estimate N(μ^,Σ^)\mathcal{N}(\widehat{\mu},\widehat{\Sigma}) that runs in time poly⁡(n,(1/ε)O(log⁡41/ε))\operatorname*{poly}(n,(1/\varepsilon)^{O(\log^{4}1/\varepsilon)}) and with high probability satisfies

for a universal constant CC that is independent of the dimension.

This essentially settles the complexity of robustly learning a high-dimensional Gaussian. The sample complexity of our algorithm depends polynomially on dd and 1/ε1/\varepsilon, and the running time depends polynomially on dd and quasi-polynomially on 1/ε1/\varepsilon. Up to a constant factor, ours is the first high-dimensional algorithm that achieves the same error guarantees as in the one-dimensional case, where results were known for more than fifty years! It is an interesting open problem to reduce the running time to polynomial in 1/ε1/\varepsilon (while still being polynomial in dd). As we explain in Section 6.6, this seems to require fundamentally new ideas.

In addition to the works mentioned above, there has been an exciting flurry of recent work on robust high-dimensional estimation. This includes studying graphical models in the presence of noise [DKS16], tolerating much more noise by allowing the algorithm to output a list of candidate hypotheses [CSV17], formulating general conditions under which robust estimation is possible [SCV18], developing robust algorithms under sparsity assumptions [Li17, DBS17, BDLS17] where the number of samples is sublinear in the dimension, and leveraging theoretical insights to give practical algorithms that can be applied to genomic data [DKK+17]. We note that, in comparison to all these other works, ours is the only to efficiently achieve the information-theoretically optimal error guarantee (up to constant factors). Despite all of this rapid progress, there are still many interesting theoretical and practical questions left to explore.

3 Organization

In Section 2, we go over preliminaries and notation that we will use throughout the paper. In Section 3, we describe an algorithm for robustly estimating the mean of a Gaussian in low-dimensional settings, and crucially apply it in the design of an algorithm for mean-estimation in high dimensions, described in Section 4. Similarly, in Section 5, we give an algorithm for robustly estimating the mean of degree-two polynomials in certain settings, which is applied in the context of our covariance-estimation algorithm in Section 6. Finally, we put these tools together and describe our general algorithm for robustly estimating a Gaussian in Section 7.

Preliminaries

Here we formally define the strong contamination model.

Fix ε>0\varepsilon>0. We say a set of samples X1,…,XnX_{1},\ldots,X_{n} was generated from the strong contamination model on a distribution FF, if it was generated via the following process:

We produce (1−ε)n(1-\varepsilon)n i.i.d. samples GG from FF.

An adversary is allowed to observe these samples and add εn\varepsilon n points EE arbitrarily.

We are then given the set of samples G∪EG\cup E in random order. Also, we will say that the samples X1,…,XnX_{1},\ldots,X_{n} are ε\varepsilon-corrupted. Moreover given an ε\varepsilon-corrupted set of samples SS, we will write S=(G,E)S=(G,E) where GG is the set of uncorrupted points and EE is the set of corrupted points. Moreover, given a subset S′⊂SS^{\prime}\subset S, we will also write S′=(G′,E′)S^{\prime}=(G^{\prime},E^{\prime}), where G′=S′∩GG^{\prime}=S^{\prime}\cap G and E′=S′∩EE^{\prime}=S^{\prime}\cap E denote the set of uncorrupted points and corrupted points remaining in S′S^{\prime}. LL will denote G∖G′G\setminus G^{\prime}, which is the set of “lost” uncorrupted points.

Given a contaminated set S′=(G′,E′)S^{\prime}=(G^{\prime},E^{\prime}) and a set GG so that G′⊆GG^{\prime}\subseteq G, define the following quantities

In particular, observe that if Δ(S′,G)<O(ε)\Delta(S^{\prime},G)<O(\varepsilon), then a simple calculation implies that ϕ(S′,G)≤O(ε/log⁡1/ε)\phi(S^{\prime},G)\leq O(\varepsilon/\log 1/\varepsilon). Equivalently, we have removed at most an O(ε/log⁡1/ε)O(\varepsilon/\log 1/\varepsilon) fraction of good points from GG. This is crucial, as if we throw out an ε\varepsilon-fraction of good points then we essentially put ourselves in the subtractive model, and there our guarantees no longer hold.

There are two differences between the strong contamination model and Huber’s contamination model. First, the number of corrupted points is fixed to be εn\varepsilon n instead of being a random variable. However, this difference is negligible. It follows from basic Chernoff bounds that nn samples from Huber’s contamination model with parameter ε\varepsilon (for nn sufficiently large) can be simulated by a (1+o(1))ε(1+o(1))\varepsilon-corrupted set of samples, except with negligible failure probability. Hence, we lose only an additive o(ε)o(\varepsilon) term when translating from Huber’s contamination model to the strong contamination model, which will not change any of the guarantees in our paper. The second difference is that the adversary is allowed to inspect the uncorrupted points before deciding on the corrupted points. This makes the model genuinely stronger since the samples we are given are no longer completely independent of each other.

2 Deterministic Regularity Conditions

In analyzing our algorithms, we only need certain deterministic regularity conditions to hold on the uncorrupted points. In this subsection, we formally state what these conditions are. It follows from known concentration bounds that these conditions all hold with high probability given a polynomial number of samples. Now with these regularity conditions defined once and for all, we will be able to streamline our proofs in the sense that each step in the analysis will only ever use one of these fixed set of conditions and will not use the randomness in the sampling procedure. We remark that some subroutines in our algorithm only need a subset of these conditions to hold, so we could improve the sample complexity by changing the regularity conditions we need at each step. However, since we will not be concerned with optimizing the sample complexity beyond showing that it is polynomial, we choose not to complicate our proofs in this manner.

In the unknown mean case, we will require the following condition:

For all x∈Gx\in G we have ∥x−μ∥2≤O(dlog⁡(∣G∣/δ))\|x-\mu\|_{2}\leq O(\sqrt{d\log(|G|/\delta)}).

We have that ∥\mboxEG[X]−\mboxEN(μ,I)[X]∥2≤η.\|\mathop{\mbox{\bf E}}_{G}[X]-\mathop{\mbox{\bf E}}_{\mathcal{N}(\mu,I)}[X]\|_{2}\leq\eta.

It is easy to show (see Lemma 6) that given enough samples from N(μ,I)\mathcal{N}(\mu,I), the empirical data set will satisfy these conditions with high probability.

2.2 Regularity Conditions for Unknown Covariance

In the unknown covariance case, we will require the following condition:

For all x∈Gx\in G we have that xTΣ−1x=O(dlog⁡(∣G∣/δ)).x^{T}\Sigma^{-1}x=O(d\log(|G|/\delta)).

As before, it is easy to show (see Lemma 14) that given enough samples from N(0,Σ)\mathcal{N}(0,\Sigma), the empirical data set will satisfy these conditions with high probability.

3 Bounds on the Total Variation Distance

For clarity of exposition we defer this calculation to the Appendix.

We also need to bound the total variation distance between two Gaussians with zero mean and different covariance matrices. The natural norm to use is the Mahalanobis distance. But in our setting, we will be able to use the more convenient Frobenius norm instead (because we effectively reduce to the case that the covariance matrices will be close to the identity):

These lemmata show that parameter estimation and approximation in total variation distance are essentially equivalent. Indeed, in this paper, we achieve both guarantees, but state our results in terms of total variation estimation.

Robustly Learning the Mean in Low Dimensions

This section is dedicated to the proof of the following theorem:

In particular, as we let ρ,γ→0\rho,\gamma\rightarrow 0, the parameter estimation error approaches πε\sqrt{\pi}\varepsilon (corresponding to a total variation approximation of ε/2\varepsilon/\sqrt{2}). In Lemma 17 in the Appendix we show that no algorithm can achieve parameter estimation error better than π2ε\sqrt{\frac{\pi}{2}}\varepsilon. Thus, we achieve a 2\sqrt{2} approximation to the optimal error.

First we show that if we project onto one dimension, then the median of the corrupted data differs from the true mean by at most π2ε+o(ε)\sqrt{\frac{\pi}{2}}\varepsilon+o(\varepsilon). Our proof will rely only on the notion of a (γε,δ)(\gamma\varepsilon,\delta)-good set with respect to N(μ,I)\mathcal{N}(\mu,I) and thus it works even in the strong contamination model. Formally, we show:

Observe that we have ∣∣E∣∣S∣Pr⁡X∼E[⟨v,X⟩>a]∣≤ψ(S,G)\left|\frac{|E|}{|S|}\Pr_{X\sim E}[\langle v,X\rangle>a]\right|\leq\psi(S,G). Moreover, by simple calculation we have

For ∣a∣=O(ε)|a|=O(\varepsilon) we have that Pr⁡N(0,I)[X>a]=12−12πa+O(ε3)\Pr_{\mathcal{N}(0,I)}[X>a]=\frac{1}{2}-\frac{1}{\sqrt{2\pi}}a+O(\varepsilon^{3}). Thus, by (γε,δ)(\gamma\varepsilon,\delta)-goodness of G0G_{0}, this implies that for ∣a∣=O(ε)|a|=O(\varepsilon), we have

In particular, we see that if a>π2ε+O(γεd)+o(ε)a>\sqrt{\frac{\pi}{2}}\varepsilon+O\left(\frac{\gamma\varepsilon}{d}\right)+o(\varepsilon), then Pr⁡X∼S[⟨v,X⟩>Πyμ+π2ε]<1/2\Pr_{X\sim S}\left[\langle v,X\rangle>\Pi_{y}\mu+\sqrt{\frac{\pi}{2}}\varepsilon\right]<1/2. By symmetric logic, we also have that Pr⁡X∼S[⟨v,X⟩>Πyμ−π2ε]>1/2\Pr_{X\sim S}\left[\langle v,X\rangle>\Pi_{y}\mu-\sqrt{\frac{\pi}{2}}\varepsilon\right]>1/2. Thus, the median in direction vv differs from Πyμ\Pi_{y}\mu by at most π2ε+O(γεd)+o(ε)\sqrt{\frac{\pi}{2}}\varepsilon+O\left(\frac{\gamma\varepsilon}{d}\right)+o(\varepsilon). ∎

2 Finding a Minimum Radius Circumscribing Ball

Our first step is to use such an oracle to construct a net for C{\cal C}. First, we need the following well-known bound on the size of the net.

The algorithm is fairly straightforward. First, we observe that C{\cal C} is contained within B(x,2R)B(x,2R). We then form a (ρR)/3(\rho R)/3-net of B(x,2R)B(x,2R) using Claim 1. We then iterate over every element vv of this net, and use our projection oracle to (approximately) find the closest point in C{\cal C} to vv. If this point is too far away, we throw it out, otherwise, we add this projected point into the net. The formal pseudocode for CircumscribeNet is given in Algorithm 1.

The runtime bound follows from Claim 1. We now turn our attention to correctness. By Claim 1, and rescaling and shifting, the set F\mathcal{F} is clearly a (ρR)/3(\rho R)/3-net for a ball BB of radius 2R2R containing C{\cal C}. We now claim that the set X\mathcal{X} is indeed a (ρR)/3(\rho R)/3-net for C{\cal C}. Fix y∈Cy\in{\cal C}. Since C⊆B{\cal C}\subseteq B, this implies there is some v∈Fv\in\mathcal{F} so that ∥y−v∥2≤ρR/3\|y-v\|_{2}\leq\rho R/3. Thus, in Line 7, when processing vv, we must find some uv∈Cu_{v}\in{\cal C} so that ∥uv−v∥2≤2ρR/3\|u_{v}-v\|_{2}\leq 2\rho R/3. The claim then follows from the triangle inequality. ∎

Fix R,C,ρ,O,xR,{\cal C},\rho,{\cal O},x as in Lemma 4. Suppose a call to O{\cal O} runs in time TT. Then, there is an algorithm \textscCircumscribe(R,ρ,O,x)\textsc{Circumscribe}(R,\rho,{\cal O},x) which runs in time poly⁡((R/ρ)O(d),T)\operatorname*{poly}((R/\rho)^{O(d)},T) and returns a point y^\widehat{y} so that C{\cal C} is contained within a ball of radius 2(1+2ρ)R\sqrt{2}(1+2\rho)R.

The algorithm at this point is very simple. Using the output of CircumscribeNet, we iterate over all points in a net over B(x,2R)B(x,2R), find an xx in this net so that the distance to all points in the net is at most 2(1+ρ)R\sqrt{2}(1+\rho)R, and output any such point. The formal pseudocode for Circumscribe is given in Algorithm 2.

The runtime bound is immediate. By Theorem 4, there is some y∈B(x,2R)y\in B(x,2R) so that C⊆B(y,R2){\cal C}\subseteq B(y,R\sqrt{2}). Thus, by the triangle inequality, there is some y′∈Fy^{\prime}\in\mathcal{F} so that C⊆B(y,2(1+ρ)R){\cal C}\subseteq B(y,\sqrt{2}(1+\rho)R). Thus, the algorithm will output some point y′′∈Fy^{\prime\prime}\in\mathcal{F}. By an additional application of the triangle inequality, since X\mathcal{X} is a ρR\rho R-net for C{\cal C}, this implies that C⊆B(y′′,2(1+2ρ)R){\cal C}\subseteq B(y^{\prime\prime},\sqrt{2}(1+2\rho)R), as claimed. ∎

3 The Full Low-Dimensional Algorithm

where β=π2ε+O(γεd)+o(ε)\beta=\sqrt{\frac{\pi}{2}}\varepsilon+O\left(\frac{\gamma\varepsilon}{d}\right)+o(\varepsilon) is as in Lemma 3. We now show two properties of this set, which in conjunction with the machinery above, allows us to prove Theorem 3. The first shows that C{\cal C} has small diameter:

For all x,y∈Cx,y\in{\cal C}, we have ∥x−y∥2≤2β/(1−ρ)\|x-y\|_{2}\leq 2\beta/(1-\rho).

Fix any x,y∈Cx,y\in{\cal C}. By definition of C{\cal C}, it follows that for all v∈Fv\in\mathcal{F}, we have ∣⟨x−y,v⟩∣≤2β|\langle x-y,v\rangle|\leq 2\beta. For any uu with ∥u∥2=1\|u\|_{2}=1, there is some v∈Fv\in\mathcal{F} with ∥u−v∥2≤ε\|u-v\|_{2}\leq\varepsilon, and so we have

Taking the supremum over all unit vectors uu and simplifying yields that ∥x−y∥2≤2β/(1−ρ)\|x-y\|_{2}\leq 2\beta/(1-\rho), as claimed. ∎

The second property shows that we may find an α\alpha-projection oracle for C{\cal C} efficiently.

Fix ρ′>0\rho^{\prime}>0. There is a ρ′\rho^{\prime}-projection oracle \textscProjOracle(y,ρ′,C)\textsc{ProjOracle}(y,\rho^{\prime},{\cal C}) for C{\cal C} which runs in time poly⁡((1/ρ)O(d),log⁡(γε/(1−ρ)),log⁡(1/ρ′))\operatorname*{poly}((1/\rho)^{O(d)},\log(\gamma\varepsilon/(1-\rho)),\log(1/\rho^{\prime})).

We now finally describe LearnMeanLowD. Using convex optimization, we first find an arbitrary x∈Cx\in{\cal C}. By Lemma 3 we know μ∈C\mu\in{\cal C} and so this step succeeds. After constructing C{\cal C}, we run Circumscribe with appropriate parameters, and return the outputted point. The formal pseudocode for LearnMeanLowD is given in Algorithm 3.

The runtime claim follows from the runtime claims for Circumscribe and ProjOracle. Thus, it suffices to prove correctness of this algorithm. By Lemma 3, we know that μ∈C\mu\in{\cal C}. By Claim 2 and Corollary 2, the output yy satisfies B(y,21+2ρ1−ρβ)B(y,\sqrt{2}\frac{1+2\rho}{1-\rho}\beta). Thus, we have ∥μ−y∥2≤21+2ρ1−ρβ\|\mu-y\|_{2}\leq\sqrt{2}\frac{1+2\rho}{1-\rho}\beta, as claimed. ∎

Robustly Learning the Mean in High Dimensions

In this section, we prove the following theorem, which is our first main result:

Fix ε,γ,δ>0\varepsilon,\gamma,\delta>0, and let X1,…,XnX_{1},\ldots,X_{n} be an ε\varepsilon-corrupted set of points from N(μ,I)\mathcal{N}(\mu,I), where ∥μ∥2≤O(εlog⁡1/ε)\|\mu\|_{2}\leq O(\varepsilon\log 1/\varepsilon), and where

Then, for every α,β>0\alpha,\beta>0, there is an algorithm \textscRecoverMean(X1,…,Xn,ε,δ,γ,α,β)\textsc{RecoverMean}(X_{1},\ldots,X_{n},\varepsilon,\delta,\gamma,\alpha,\beta) which runs in time poly⁡(d,1/γ,1/εβ,1/α,log⁡1/δ)\operatorname*{poly}(d,1/\gamma,1/\varepsilon^{\beta},1/\alpha,\log 1/\delta) and outputs a μ^\widehat{\mu} so that with probability 1−δ1-\delta, we have ∥μ^−μ∥2≤(π+O(γ)1−α+1β)ε\|\widehat{\mu}-\mu\|_{2}\leq\left(\frac{\sqrt{\pi}+O(\gamma)}{1-\alpha}+\frac{1}{\sqrt{\beta}}\right)\varepsilon.

In particular, observe that Theorem 5, in conjunction with Lemma 1, gives us Theorem 1, if we set γ=o(1)\gamma=o(1). With this, we may state our primary algorithmic contribution:

Fix ε,γ,α,δ,β>0\varepsilon,\gamma,\alpha,\delta,\beta>0, and let S0=(G0,E0)S_{0}=(G_{0},E_{0}) be an ε\varepsilon-corrupted set of samples of size nn from N(μ,I)\mathcal{N}(\mu,I), where ∥μ∥2≤O(εlog⁡1/ε)\|\mu\|_{2}\leq O(\varepsilon\log 1/\varepsilon), and where n=poly⁡(d,1/(γε),log⁡1/δ)n=\operatorname*{poly}(d,1/(\gamma\varepsilon),\log 1/\delta). Suppose that G0G_{0} is (γε,δ)(\gamma\varepsilon,\delta)-good with respect to N(μ,I)\mathcal{N}(\mu,I). Let S⊆S0S\subseteq S_{0} be a set so that Δ(S,G0)≤ε\Delta(S,G_{0})\leq\varepsilon. Then, there exists an algorithm FilterMeanOpt that given S,ε,γ,α,βS,\varepsilon,\gamma,\alpha,\beta outputs one of two possible outcomes:

A μ^\widehat{\mu}, so that ∥μ^−μ∥2≤(π+O(γ)1−α+1β)ε\|\widehat{\mu}-\mu\|_{2}\leq\left(\frac{\sqrt{\pi}+O(\gamma)}{1-\alpha}+\frac{1}{\sqrt{\beta}}\right)\varepsilon.

A set S′⊂SS^{\prime}\subset S so that Δ(S′,G0)<Δ(S,G0)\Delta(S^{\prime},G_{0})<\Delta(S,G_{0}).

Moreover, FilterMeanOpt runs in time poly⁡(d,1/γ,1/εβ,1/α,log⁡1/δ)\operatorname*{poly}(d,1/\gamma,1/\varepsilon^{\beta},1/\alpha,\log 1/\delta).

By first running the algorithm of [DKK+16] to obtain an estimate of the mean to error O(εlog⁡1/ε)O(\varepsilon\sqrt{\log 1/\varepsilon}), then running FilterMeanOpt at most polynomially many times, we clearly recover the guarantee in Theorem 5. Thus, the rest of the section is dedicated to the proof of Theorem 6.

At a high level, the structure of the argument is as follows: We first show that if there is a subspace of eigenvectors of dimension at least O(log⁡1/ε)O(\log 1/\varepsilon) of the empirical covariance matrix with large associated eigenvalues, then we can produce a filter using a degree-2 polynomial (Section 4.1). Otherwise, we know that there are at most O(log⁡1/ε)O(\log 1/\varepsilon) eigenvectors of the empirical covariance with a large eigenvalue. We can learn the mean in this small dimensional subspace using our learning algorithm from the previous section, and then we can argue that the empirical mean on the remaining subspace is close to the true mean (Section 4.2).

This outline largely follows the structure of the filter arguments given in [DKK+16], however, the filtering algorithm we use here requires a couple of crucial new ideas. First, to produce the filter, instead of using a generic degree-2 polynomial over this subspace, we construct an explicit, structured, degree-2 polynomial which produces such a filter. Crucially, we can exploit the structure of this polynomial to obtain very tight tail bounds, e.g., via the Hanson-Wright inequality. This is critical to avoid a quasi-polynomial runtime. If instead we used arbitrary degree-22 polynomials in this subspace, it would need to be of dimension O(log⁡21/ε)O(\log^{2}1/\varepsilon) and the low-dimensional algorithm in the second step would take quasi-polynomial time.

Second, we must be careful to throw out far fewer good points than corrupted points. In particular, by our definition of Δ\Delta (which gives an additional logarithmic penalty to discarding good points) and our guarantee that Δ\Delta decreases, our filter can only afford to throw out an ε/log⁡(1/ε)\varepsilon/\log(1/\varepsilon) fraction of good points in total, since Δ\Delta is initially ε\varepsilon. This is critical, as if we threw away an ε\varepsilon-fraction of good points, then proving that the problem remains efficiently solvable becomes problematic. In particular, if these points were thrown away arbitrarily, then this becomes the full additive and subtractive model, for which a statistical query lower bound prevents us from getting an O(ε)O(\varepsilon)-approximate answer in polynomial time [DKS17]. To avoid discarding too many good points, we exploit tight exponential tail bounds of Gaussians, and observe that by slightly increasing the threshold at which we filter away points, we decrease the fraction of good points thrown away dramatically.

We now give an algorithm for the case when there are many eigenvalues which are somewhat large. Formally, we show:

Fix ε,γ,δ,α,β>0\varepsilon,\gamma,\delta,\alpha,\beta>0, and let S0=(G0,E0)S_{0}=(G_{0},E_{0}) be an ε\varepsilon-corrupted set of samples of size nn from N(μ,I)\mathcal{N}(\mu,I), where ∥μ∥2≤O(εlog⁡1/ε)\|\mu\|_{2}\leq O(\varepsilon\log 1/\varepsilon), and where n=poly⁡(d,1/(γε),log⁡1/δ)n=\operatorname*{poly}(d,1/(\gamma\varepsilon),\log 1/\delta). Suppose that G0G_{0} is (γε,δ)(\gamma\varepsilon,\delta)-good with respect to N(μ,I)\mathcal{N}(\mu,I). Let S⊆S0S\subseteq S_{0} be a set so that Δ(S,G0)≤ε\Delta(S,G_{0})\leq\varepsilon. Let Σ^\widehat{\Sigma} be the sample covariance of SS, let μ^\widehat{\mu} be the sample mean of SS, and let VV be the subspace of all eigenvectors of Σ^−I\widehat{\Sigma}-I with eigenvalue more than 1βε\frac{1}{\beta}\varepsilon. Then, there exists an algorithm FilterMeanManyEig that given S,ε,γ,δ,α,βS,\varepsilon,\gamma,\delta,\alpha,\beta outputs one of two possible outcomes:

If dim⁡(V)≥C1βlog⁡(1/ε)\dim(V)\geq C_{1}\beta\log(1/\varepsilon), then it outputs an S′S^{\prime} so that Δ(S′,G0)<Δ(S,G0)\Delta(S^{\prime},G_{0})<\Delta(S,G_{0}).

Otherwise, the algorithm outputs “OK”, and outputs an orthonormal basis for VV.

Our algorithm works as follows: It finds all large eigenvalues of Σ^−I\widehat{\Sigma}-I, and if there are too many, produces an explicit degree-2 polynomial which, as we will argue, produces a valid filter. The formal pseudocode for our algorithm is in Algorithm 4.

For clarity of exposition, we defer the proof of Theorem 7 to Appendix C.

2 Returning an Estimate When There are Few Large Eigenvalues

At this point, we have run the filter of Algorithm 4 until there are few large eigenvalues. In the subspace with large eigenvalues, we again run the low dimensional algorithm to obtain an estimate for the mean in this subspace. Recall that Lemma 3 guarantees the accuracy of this estimator within this subspace. In the complement of this subspace, where the empirical covariance is very close to the identity, Lemma 5 (stated below) shows that the empirical mean is close to the true mean. This leads to a simple algorithm which outputs an estimate for the mean, described in Algorithm 5.

Let μ,η,G0,S\mu,\eta,G_{0},S be as in Theorem 7. Let μ^\widehat{\mu} be the sample mean of SS, and let vv be a unit vector. Suppose that ⟨v,μ−μ^⟩>εβ1/2\langle v,\mu-\widehat{\mu}\rangle>\frac{\varepsilon}{\beta^{1/2}}. Then \mboxVarS[⟨v,X⟩]>1+εβ\mathop{\mbox{\bf Var}}_{S}[\langle v,X\rangle]>1+\frac{\varepsilon}{\beta}.

For clarity of exposition, we defer the proof of Lemma 5 to Appendix C.

3 The Full High-Dimensional Algorithm

We now have almost all the pieces needed to prove the full result. The last ingredient is the fact that, given enough samples, the good set condition is satisfied by the samples from the true distribution. Formally,

Fix η,δ>0\eta,\delta>0. Let X1,…,XnX_{1},\ldots,X_{n} be independent samples from N(μ,I)\mathcal{N}(\mu,I), where n=Ω((dlog⁡(d/ηδ))6/η2)n=\Omega((d\log(d/\eta\delta))^{6}/\eta^{2}). Then, S={X1,…,Xn}S=\{X_{1},\ldots,X_{n}\} is (η,δ)(\eta,\delta)-good with respect to N(μ,I)\mathcal{N}(\mu,I) with probability at least 1−δ1-\delta.

This follows from Lemmas 8.3 and 8.16 of [DKK+16]. ∎

4 An Extension, with Small Spectral Noise

For learning of arbitrary Gaussians, we will need a simple extension that allows us to learn the mean even in the presence of some spectral norm error in the covariance matrix. Since the algorithms and proofs are almost identical to the techniques above, we omit them for conciseness. Formally, we require:

Fix χ,ε,δ>0\chi,\varepsilon,\delta>0, and let X1,…,XnX_{1},\ldots,X_{n} be an ε\varepsilon-corrupted set of points from N(μ,Σ)\mathcal{N}(\mu,\Sigma), where ∥Σ−I∥2≤O(χ)\|\Sigma-I\|_{2}\leq O(\chi), ∥μ∥2≤O(εlog⁡1/ε)\|\mu\|_{2}\leq O(\varepsilon\log 1/\varepsilon), and where n=poly⁡(d,1/χ,1/ε,log⁡1/δ)n=\operatorname*{poly}(d,1/\chi,1/\varepsilon,\log 1/\delta). For any γ>0\gamma>0, there is an algorithm \textscRecoverMeanNoisy(X1,…,Xn,ε,δ,γ,χ)\textsc{RecoverMeanNoisy}(X_{1},\ldots,X_{n},\varepsilon,\delta,\gamma,\chi) which runs in time poly⁡(d,1/χ,1/ε,log⁡1/δ)\operatorname*{poly}(d,1/\chi,1/\varepsilon,\log 1/\delta) and outputs a μ^\widehat{\mu} so that with probability 1−δ1-\delta, we have ∥μ^−μ∥2≤(C+γ)ε+O(χ)\|\widehat{\mu}-\mu\|_{2}\leq(C+\gamma)\varepsilon+O(\chi).

This extension follows from two elementary observations:

For the learning in low dimensions, observe that the median is naturally robust to error in the covariance, and in general, by the same calculation we did, the error of the median becomes O(ε+α)O(\varepsilon+\alpha).

For the filter, observe that we only need concentration of squares of linear functions, and whatever error we have in this concentration goes directly into our error guarantee. Thus, by the same calculations that we had above, if we filtered for eigenvalues above 1+O(ε+α)1+O(\varepsilon+\alpha), we would immediately get the desired bound.

Robustly Estimating the Mean of Degree Two Polynomials

In this section, we give robust estimates of \mboxE[p2(X)]\mathop{\mbox{\bf E}}[p^{2}(X)] for degree-22 polynomials pp in subspaces of small dimension, which is an important prerequisite to learning the covariance in high-dimensions. A crucial ingredient in our algorithm is the following improvement theorem (stated and proved in the next section) which shows how to take any weak high-dimensional estimate for the covariance and use it to get an even better robust estimate for \mboxE[p2(X)]\mathop{\mbox{\bf E}}[p^{2}(X)].

Here we give some additional preliminaries we require for the low-dimensional learning algorithm we present here. We will need the following well-known tail bound for degree-22 polynomials:

We will also require the following lemmata:

Let A,BA,B be matrices. Then, for all p,qp,q so that 1p+1q=1\frac{1}{p}+\frac{1}{q}=1, we have ∥AB∥S1≤∥A∥Sp∥B∥Sq\|AB\|_{S^{1}}\leq\|A\|_{S^{p}}\|B\|_{S^{q}}.

Let Σ,Σ^,M\Sigma,\widehat{\Sigma},M be so that ∥Σ−Σ^∥F≤O(δ)\|\Sigma-\widehat{\Sigma}\|_{F}\leq O(\delta), and so that ∥M∥F=1\|M\|_{F}=1. Then, we have ∥Σ1/2MΣ1/2−Σ^1/2MΣ^1/2∥S1≤5δ\|\Sigma^{1/2}M\Sigma^{1/2}-\widehat{\Sigma}^{1/2}M\widehat{\Sigma}^{1/2}\|_{S^{1}}\leq 5\delta.

We will bound the first term on the RHS by 5δ/25\delta/2; the second term is bounded symmetrically. We have

where the last line follows from Hölder’s inequality for Schatten norms. ∎

2 An Improvement Theorem

Here we state and prove one of the main technical ingredients in our algorithm for robustly learning the covariance.

Fix ε,δ,τ>0\varepsilon,\delta,\tau>0. Let Σ\Sigma be so that ∥Σ−I∥F≤O(εlog⁡1/ε)\|\Sigma-I\|_{F}\leq O(\varepsilon\log 1/\varepsilon), and fix a p∈P2p\in\mathcal{P}_{2}, where P2\mathcal{P}_{2} denotes the set of even degree-22 polynomials in dd variables. Let G0G_{0} be an (ε,δ)(\varepsilon,\delta)-good set of samples from N(0,Σ)\mathcal{N}(0,\Sigma), and let S={X1,…,Xn}S=\{X_{1},\ldots,X_{n}\} be so that Δ(S,G0)≤ε\Delta(S,G_{0})\leq\varepsilon. Then, for any C>0C>0 there is an algorithm LearnMeanChiSquared which, given p,X1,…,Xnp,X_{1},\ldots,X_{n}, and ε\varepsilon, outputs a μ^\widehat{\mu} so that with probability 1−τ1-\tau over the randomness of the algorithm,

Moreover, the algorithm runs in time O(∣S∣+log⁡(1/τ)/ε2)O(|S|+\log(1/\tau)/\varepsilon^{2}).

The way to think about how this result fits into the overall strategy is that robustly estimating the covariance is equivalent to robustly estimating the mean of every (normalized) degree-two polynomial pp. The above theorem shows how a weak estimate in high-dimensions can be used to obtain stronger estimates in one dimension, which ultimately we will use to improve the high-dimensional estimate as well. The above theorem is the workhorse in our proof.

Our algorithm itself is simple, however, its correctness is quite non-trivial. We define some threshold TT. Given our corrupted set of samples from N(0,Σ)\mathcal{N}(0,\Sigma), we use our corrupted data set to estimate the mean of p(X)p(X) conditioned on the event that ∣p(X)∣≤T|p(X)|\leq T. Then, to estimate the contribution of the mean from points XX so that ∣p(X)∣>T|p(X)|>T, we estimate this by \mboxEX∼N(0,I)[p(X)1∣p(X)∣>T]\mathop{\mbox{\bf E}}_{X\sim\mathcal{N}(0,I)}[p(X)1_{|p(X)|>T}]. In other words, we are replacing the contribution of the true tail by an estimate of the contribution of p(X)p(X) when X∼N(0,I)X\sim\mathcal{N}(0,I) on this tail. The formal pseudocode is given in Algorithm 6.

Intuitively, this algorithm works because of two reasons. First, it is not hard to show that the influence of points p(X)p(X) within the threshold TT on the estimator are bounded by at most TT. Hence, the adversary cannot add corrupted points within this threshold and cause our estimator to deviate too much. Secondly, because we know that ∥Σ−I∥F\|\Sigma-I\|_{F} is small, by carefully utilizing smoothness properties of sums of chi-squared random variables, we are able to show that our estimate for the contribution of the tail is not too large. At a high level, this is because “most” of the distance between two chi-squared random variables must remain close to the means, so the difference in the tails is much smaller. Proving that this holds in a formal sense is the majority of the technical work of this section.

We know the distribution of p(X′)p(X^{\prime}) for X′∼N(0,I)X^{\prime}\sim N(0,I) explicitly and wish to use this to get a better estimate for the mean of p(X)p(X) for X∼N(0,Σ)X\sim N(0,\Sigma) than might be given by the mean of the ε\varepsilon-corrupted set of samples.

It follows from (ε,δ)(\varepsilon,\delta)-goodness that ∣Pr⁡X′∼N(0,Σ)[p(X′)>t]−#{Xi:p(Xi)>t}/n∣≤2ε|\Pr_{X^{\prime}\sim\mathcal{N}(0,\Sigma)}[p(X^{\prime})>t]-\#\{X_{i}:p(X_{i})>t\}/n|\leq 2\varepsilon for all tt. We need to express the expectation in terms that we can use this to bound. For Z=p(X′)Z=p(X^{\prime}), we have that

Thus, we have ∣\mboxE[Z−f(Z)]−α∣≤2Tε|\mathop{\mbox{\bf E}}[Z-f(Z)]-\alpha|\leq 2T\varepsilon.

Since p∈P2p\in\mathcal{P}_{2}, we have \mboxE[p(X′)]=1\mathop{\mbox{\bf E}}[p(X^{\prime})]=1 for X′∼N(0,I)X^{\prime}\sim N(0,I). Thus, we have \mboxVar[f(p(X′))]≤\mboxE[f(p(X′))2]≤\mboxE[p(X′)2]=1\mathop{\mbox{\bf Var}}[f(p(X^{\prime}))]\leq\mathop{\mbox{\bf E}}[f(p(X^{\prime}))^{2}]\leq\mathop{\mbox{\bf E}}[p(X^{\prime})^{2}]=1. It follows by standard concentration results that the empirical after taking m=O(ln⁡(1−τ)/ε2)m=O(\ln(1-\tau)/\varepsilon^{2}) samples has ∣∑i=1mf(p(Xi)′)/n−\mboxE[p(X′)]∣≤ε|\sum_{i=1}^{m}f(p(X_{i})^{\prime})/n-\mathop{\mbox{\bf E}}[p(X^{\prime})]|\leq\varepsilon with probability 1−τ1-\tau. When this holds, we have

To prove the correctness of the algorithm it remains to show that:

For any constant C>0C>0, for T=O(log⁡C)T=O(\log C), we obtain

where OO is orthogonal, DD is diagonal, aia_{i} are the eigenvalues of MM, and Y∼N(0,I)Y\sim\mathcal{N}(0,I) hence YiY_{i} are i.i.d. from N(0,1)\mathcal{N}(0,1). Since ∥M∥F=1\|M\|_{F}=1, here we have ∑ai2=1\sum a_{i}^{2}=1. If instead we express p(X′)p(X^{\prime}) in terms of X′∼N(0,σ2)X^{\prime}\sim N(0,\sigma^{2}), we obtain:

where O′O^{\prime} is orthogonal, D′D^{\prime} is diagonal, bib_{i} are the eigenvalues of Σ1/2MΣ1/2\Sigma^{1/2}M\Sigma^{1/2}, and Y′,Y∼N(0,I)Y^{\prime},Y\sim\mathcal{N}(0,I) hence YiY_{i} are i.i.d. from N(0,1)\mathcal{N}(0,1).

By Corollary 3, we have that ∑i∣bi−ai∣≤(5/2)∥Σ−I∥F\sum_{i}|b_{i}-a_{i}|\leq(5/2)\|\Sigma-I\|_{F}. Now consider the random variables

for 1≤i≤d1\leq i\leq d and 0≤λ≤10\leq\lambda\leq 1. Note that Zi,1=Zi+1,0Z_{i,1}=Z_{i+1,0}, for 1≤i≤d−11\leq i\leq d-1. Note that, to prove the lemma, it suffices to show that

where Pi(x)P_{i}(x) is the probability density function of the random variable ZiZ_{i}. Standard results about the χ2\chi^{2} distribution give that:

Let Y1,Y2,Y3∼N(0,1)Y_{1},Y_{2},Y_{3}\sim\mathcal{N}(0,1). Then the probability density function of Y12Y_{1}^{2} is 12πxe−x/2\frac{1}{\sqrt{2\pi x}}e^{-x/2}, of Y12+Y22Y_{1}^{2}+Y_{2}^{2} is 12e−x/2\frac{1}{2}e^{-x/2}, and of Y12+Y22+Y32Y_{1}^{2}+Y_{2}^{2}+Y_{3}^{2} is x2πe−x/2\frac{\sqrt{x}}{\sqrt{2\pi}}e^{-x/2}.

This gives that Pi(x)=12πxcie−x/2ci.P_{i}(x)=\frac{1}{\sqrt{2\pi xc_{i}}}e^{-x/2c_{i}}. Now consider the derivative:

where Pi(3)(x)P^{(3)}_{i}(x) is the distribution of Zi+Zi′+Zi′′Z_{i}+Z^{\prime}_{i}+Z^{\prime\prime}_{i}, where Zi′Z^{\prime}_{i} and Zi′′Z^{\prime\prime}_{i} are i.i.d. copies of ZiZ_{i}. We thus have

Since ff has Lipschitz constant 11, ∣f(Zi,λ)−\mboxEZi′,Zi′′[f(Zi,λ+Zi′+Zi′′]∣≤\mboxE[Zi′+Zi′′]=2ci|f(Z_{i,\lambda})-\mathop{\mbox{\bf E}}_{Z^{\prime}_{i},Z^{\prime\prime}_{i}}[f(Z_{i,\lambda}+Z^{\prime}_{i}+Z^{\prime\prime}_{i}]|\leq\mathop{\mbox{\bf E}}[Z^{\prime}_{i}+Z^{\prime\prime}_{i}]=2c_{i} whatever value Zi,λZ_{i,\lambda} takes.

Using the probability distribution of Zi′+Zi′′Z^{\prime}_{i}+Z^{\prime\prime}_{i}, in the case ci>0c_{i}>0, we have for all ∣z∣≤T|z|\leq T,

Since ci≤max⁡ai,bi≤1+O(εlog⁡(1/ε))≤2c_{i}\leq\max{a_{i},b_{i}}\leq 1+O(\varepsilon\log(1/\varepsilon))\leq 2, for large enough T=O(log⁡C)T=O(\log C), we have e−(T/2)/2ci≤1/C2Te^{-(T/2)/2c_{i}}\leq 1/C^{2}T. We assume that this holds.

For −T≤z≤T/2-T\leq z\leq T/2, we have 2cie−(T−z)/2ci≤2ci/C2T2c_{i}e^{-(T-z)/2c_{i}}\leq 2c_{i}/C^{2}T. A similar argument when ci<0c_{i}<0 gives that for −T/2≤z≤T-T/2\leq z\leq T, we have 2∣ci∣e−(T−z)/2ci≤2∣ci∣/C2T2|c_{i}|e^{-(T-z)/2c_{i}}\leq 2|c_{i}|/C^{2}T. Now we have enough to show that

By the Hanson-Wright inequality, we have that for any xx,

Finally, we have that, assuming ci≠0c_{i}\neq 0,

Recalling that Zi,1=Zi+1,0Z_{i,1}=Z_{i+1,0} with Z1,0=p(X′)Z_{1,0}=p(X^{\prime}) and Zd,1=p(X)Z_{d,1}=p(X) for X′∼N(0,1)X^{\prime}\sim N(0,1) and X∼N(0,Σ)X\sim N(0,\Sigma), we have by the Mean Value Theorem, that

This completes the proof of the theorem. ∎

3 Working in a Low-Dimensional Space of Degree-Two Polynomials

We now show that via similar techniques as before, we can patch our estimates together to find a matrix which agrees with the ground truth on all degree-two polynomials in a fixed subspace of low dimension. Formally, we show:

Fix ε,τ>0\varepsilon,\tau>0. Let Σ\Sigma be so that ∥Σ−I∥F≤O(εlog⁡1/ε)\|\Sigma-I\|_{F}\leq O(\varepsilon\log 1/\varepsilon). Let G0G_{0} be an (ε,δ)(\varepsilon,\delta)-good set of samples from N(0,Σ)\mathcal{N}(0,\Sigma), and let S={X1,…,Xn}S=\{X_{1},\ldots,X_{n}\} be so that Δ(S,G0)≤ε\Delta(S,G_{0})\leq\varepsilon. Let W1W_{1} be a subspace of degree-22 polynomials, and let W2W_{2} be an orthogonal subspace of degree-22 polynomials, so that we have a Σ^\widehat{\Sigma} so that ∣\mboxEX∼N(0,Σ)[p(X)]−\mboxEX∼N(0,Σ^)[p(X)]∣≤ξ\left|\mathop{\mbox{\bf E}}_{X\sim\mathcal{N}(0,\Sigma)}[p(X)]-\mathop{\mbox{\bf E}}_{X\sim\mathcal{N}(0,\widehat{\Sigma})}[p(X)]\right|\leq\xi for all p∈W2p\in W_{2}. Then there is an algorithm LearnMeanPolyLowD which given ε,S,W1,W2,Σ^\varepsilon,S,W_{1},W_{2},\widehat{\Sigma} runs in time poly⁡(d,∣S∣,2O(dim⁡(W1)),log⁡1/τ)\operatorname*{poly}(d,|S|,2^{O(\dim(W_{1}))},\log 1/\tau), and returns a Σ′\Sigma^{\prime} so that

Observe that the dimension of the space of degree-22 polynomials WW in VV is O(dim⁡(V)2)O(\dim(V)^{2}). Run the algorithm in Theorem 10 with the same parameters as before, with W1=WW_{1}=W and W2=∅W_{2}=\emptyset (so that we may take ξ=0\xi=0), and then the guarantee of that algorithm, along with Lemma 10, gives our desired guarantee. ∎

We now describe the algorithm for Theorem 10. Essentially, we do the same thing as we did for low-dimensional learning in the unknown mean case: we take a constant net over V∩P2V\cap\mathcal{P}_{2}, l earn the mean over every polynomial in the net, and then find a Σ′\Sigma^{\prime} which is close in each direction to the learned mean. Since we will not attempt to optimize the constant factor here, will will use a naive LP-based approach to find a point which is close to optimal. The formal pseudocode is given in Algorithm 7.

Observe that every constraint for each polynomial in W1W_{1} is indeed linear in Σ′\Sigma^{\prime}, by Lemma 10. Moreover, the constraint for W2W_{2} has an explicit separation oracle, since it induces a norm, and for any p∈W2p\in W_{2}, we may explicitly compute \mboxEN(0,Σ′)[p(X)]−\mboxEN(0,Σ′)[p(X)]\mathop{\mbox{\bf E}}_{\mathcal{N}(0,\Sigma^{\prime})}[p(X)]-\mathop{\mbox{\bf E}}_{\mathcal{N}(0,\Sigma^{\prime})}[p(X)]. Thus, we may use separating hyperplane techniques to solve this convex program in the claimed running time.

Let us condition on the event that LearnMeanChSquared succeeds for each p∈Cp\in\mathcal{C}. By a union bound, this occurs with probability at least 1−τ1-\tau. Thus, in each p∈Cp\in\mathcal{C}, we have that ∣mp−\mboxEX∼N(0,Σ)[p(X)]∣≤β|m_{p}-\mathop{\mbox{\bf E}}_{X\sim\mathcal{N}(0,\Sigma)}[p(X)]|\leq\beta, where β=∥Σ−I∥F/C+O(log⁡(C))ε\beta=\|\Sigma-I\|_{F}/C+O(\log(C))\varepsilon. Let Σ′\Sigma^{\prime} be the matrix we find. By the triangle inequality, we then have that for every p∈Cp\in\mathcal{C}, that ∣\mboxEN(0,Σ′)[p(X)]−\mboxEN(0,Σ)[p(X)]∣≤2β|\mathop{\mbox{\bf E}}_{\mathcal{N}(0,\Sigma^{\prime})}[p(X)]-\mathop{\mbox{\bf E}}_{\mathcal{N}(0,\Sigma)}[p(X)]|\leq 2\beta. Hence, by the usual net arguments, we know that for every p∈V∩P2p\in V\cap\mathcal{P}_{2},

Moreover, by triangle inequality, for every p∈W2p\in W_{2}, we have ∣\mboxEN(0,Σ′)[p(X)]−\mboxEN(0,Σ′)[p(X)]∣≤2ξ\left|\mathop{\mbox{\bf E}}_{\mathcal{N}(0,\Sigma^{\prime})}[p(X)]-\mathop{\mbox{\bf E}}_{\mathcal{N}(0,\Sigma^{\prime})}[p(X)]\right|\leq 2\xi. The result then follows from the Pythagorean theorem. ∎

Robustly Learning the Covariance in High-Dimensions

In this section, we show how to robustly estimate the covariance of a mean-zero Gaussian in high-dimensions up to error O(ε)O(\varepsilon). We use our low-dimensional learning algorithm from the previous section as a crucial subroutine in what follows.

Our main algorithmic contribution is as follows:

Fix ε,δ>0\varepsilon,\delta>0, and let S0=(G0,E0)S_{0}=(G_{0},E_{0}) be an ε\varepsilon-corrupted set of samples of size nn from N(0,Σ)\mathcal{N}(0,\Sigma), where ∥Σ−I∥F≤ξ\|\Sigma-I\|_{F}\leq\xi where ξ=O(εlog⁡1/ε)\xi=O(\varepsilon\log 1/\varepsilon), and where n=poly⁡(d,1/ε,log⁡1/δ)n=\operatorname*{poly}(d,1/\varepsilon,\log 1/\delta). Suppose that G0G_{0} is (ε,δ)(\varepsilon,\delta)-good with respect to N(0,Σ)\mathcal{N}(0,\Sigma). Let S⊆S0S\subseteq S_{0} be a set so that Δ(S,G0)≤ε\Delta(S,G_{0})\leq\varepsilon. Then, there exists an algorithm ImproveCov that given S,ξ,εS,\xi,\varepsilon, fails with probability at most poly⁡(ε,1/d,δ)\operatorname*{poly}(\varepsilon,1/d,\delta), and otherwise outputs one of two possible outcomes:

A matrix Σ^\widehat{\Sigma}, so that ∥Σ^−Σ∥F≤∥Σ−I∥F/2\|\widehat{\Sigma}-\Sigma\|_{F}\leq\|\Sigma-I\|_{F}/2.

A set S′⊂SS^{\prime}\subset S so that Δ(S′,G0)<Δ(S,G0)\Delta(S^{\prime},G_{0})<\Delta(S,G_{0}).

Moreover, ImproveCov runs in time poly⁡(d,(1/ε)O(log⁡41/ε),log⁡1/δ)\operatorname*{poly}(d,(1/\varepsilon)^{O(\log^{4}1/\varepsilon)},\log 1/\delta).

By first applying the algorithm in [DKK+16] to produce an initial estimate for Σ\Sigma, and then iterating the above algorithm polynomially many times, this immediately yields:

Fix ε,δ>0\varepsilon,\delta>0, and let G0G_{0} be a set of i.i.d.i.i.d. samples from N(0,Σ)\mathcal{N}(0,\Sigma), where n=poly⁡(d,1/ε,log⁡1/δ)n=\operatorname*{poly}(d,1/\varepsilon,\log 1/\delta). Let SS be so that Δ(S,G0)≤ε\Delta(S,G_{0})\leq\varepsilon. There is an universal constant CC and an algorithm which outputs a Σ^\widehat{\Sigma} so that with probability 1−δ1-\delta, we have ∥Σ^−1/2ΣΣ^−1/2−I∥F≤Cε\|\widehat{\Sigma}^{-1/2}\Sigma\widehat{\Sigma}^{-1/2}-I\|_{F}\leq C\varepsilon. In particular, this implies that

Our strategy for obtaining a high-dimensional estimate for the covariance based on solving low-dimensional subproblems will be substantially more challenging than it was for the unknown mean case. The natural approach is to take the poly⁡log⁡(1/ε)\operatorname*{poly}\log(1/\varepsilon)-dimensional subspace of degree-22 polynomials of largest empirical variance and construct a filter. However, this fails because, unlike in the mean case, we do not know the variance of these degree-22 polynomials to small error. For the unknown mean case, because we assumed that we knew the covariance was the identity (or spectrally close to the identity), this was not an issue. Now, the variance of our polynomials depends on the (unknown) covariance of the true Gaussian, which may be more than O(ε)O(\varepsilon)-far from our current estimate. Indeed, it is not difficult to come up with counterexamples where there are many large eigenvalues of the empirical covariance matrix, but no filter can make progress.

Then, in Section 6.3, we show that if we restrict to the orthogonal subspace, i.e., the subspace where the empirical covariance matrix does not have large eigenvalues, we can indeed either produce a filter or improve our estimate of the covariance restricted to this subspace using our low-dimensional estimator. While the blueprint is similar to the filter for the unknown mean, the techniques are much more involved and subtle.

Supposing we have not yet created a filter, we have now estimated the covariance on a poly-logarithmic dimensional subspace VV, and on V⊥V^{\perp}. This does not in general imply that we have learned the covariance in Frobenius norm. In block form, if we write

In Section 6.4, we show, given a polylogarithmically sized subspace VV, and a good estimate of the covariance matrix on VV and V⊥V^{\perp}, how to fill in the entire covariance matrix. Roughly, we do this by randomly fixing directions in VV, and performing rejection sampling based on the correlation in the direction in VV, and showing that the problem reduces to one of robustly learning the mean of a Gaussian, which (conveniently) we have already solved. These steps together yield our overall algorithm ImproveCov. Finally, in Section 6.6 we explain why there is a natural barrier that makes reducing the running time from quasi-polynomial to polynomial (in 1/ε1/\varepsilon) difficult.

2 Additional Preliminaries

Here we give some additional preliminaries we will require in this Section.

We also require the following classical result, which allows us to do agnostic hypothesis selection with corrupted samples (see e.g., [DL01, DDS12, DK14, DDS15]).

As a simple corollary of the agnostic tournament, observe that this allows us to do agnostic learning without knowing the precise error rate ε\varepsilon. Throughout the paper, we assume the algorithm knows ε\varepsilon. However, if the algorithm is not given this information, and instead given an η\eta and asked to return something with error at most O(ε+η)O(\varepsilon+\eta), we may simply grid over {η,(1+γ)η,(1+γ)2η,…,1}\{\eta,(1+\gamma)\eta,(1+\gamma)^{2}\eta,\ldots,1\} (here γ\gamma is some arbitrary constant that governs a tradeoff between runtime and accuracy), run our algorithm with ε\varepsilon set to each element in this set, and perform hypothesis selection via Tournament. Then it is not hard to see that we are guaranteed to output something which has error at most O(ε+(1+γ)η)O(\varepsilon+(1+\gamma)\eta).

2.2 The Fourth Moment Tensor of a Gaussian

As in [DKK+16], it will be crucial for us to understand the behavior of the fourth moment tensor of a Gaussian. Let ⊗\otimes denote the Kronecker product on matrices. We will make crucial use of the following definition:

We will also require the following definition:

The following result was proven in [DKK+16]:

2.3 Polynomials in Gaussian Space

Let MM be symmetric, so that ∥M∥F=1\|M\|_{F}=1. Let pp be its associated polynomial. Then, we have:

\mboxEX∼N(0,I)[p(X)]=0\mathop{\mbox{\bf E}}_{X\sim\mathcal{N}(0,I)}[p(X)]=0.

More generally, for any positive definite matrix Σ\Sigma, we have \mboxEX∼N(0,Σ)[p(X)]=⟨M,Σ−I⟩\mathop{\mbox{\bf E}}_{X\sim\mathcal{N}(0,\Sigma)}[p(X)]=\langle M,\Sigma-I\rangle.

\mboxVarX∼N(0,I)[p(X)]=\mboxEX∼N(0,I)[p2(X)]=⟨p,p⟩=1\mathop{\mbox{\bf Var}}_{X\sim\mathcal{N}(0,I)}[p(X)]=\mathop{\mbox{\bf E}}_{X\sim\mathcal{N}(0,I)}[p^{2}(X)]=\langle p,p\rangle=1.

More generally, for any positive definite matrix Σ\Sigma, we have

The first three properties are a straightforward calculation. We show the last one here. By definition, we have

as claimed, where (a) follows from Theorem 13. ∎

Observe that Lemma 10(iv) implies that if we take the top eigenvector of the d2×d2d^{2}\times d^{2} matrix

then the associated polynomial maximizes \mboxEX∼N(0,Σ)[p2(X)]\mathop{\mbox{\bf E}}_{X\sim\mathcal{N}(0,\Sigma)}[p^{2}(X)], and so we can find these polynomials efficiently. More generally, if we take any linear subspace of degree two polynomials with associated matrix subspace V′V^{\prime}, so that V′⊆VV^{\prime}\subseteq V, then the top eigenvector of the same matrix restricted to V′V^{\prime} allows us to find the polynomial in this subspace which maximizes \mboxEX∼N(0,Σ)[p2(X)]\mathop{\mbox{\bf E}}_{X\sim\mathcal{N}(0,\Sigma)}[p^{2}(X)] efficiently.

We have the following tail bound for degree-22 polynomials in Gaussian space: We will use ΠV(x)\Pi_{V}(x) and ΠV(S)\Pi_{V}(S) to denote projection to a subspace VV, of a point xx and a set of points SS, respectively. We will also need the following hypercontractivity theorem for low-degree polynomials in Gaussian space:

Then by the arguments above, we have that for any two matrices Σ,Σ^\Sigma,\widehat{\Sigma},

In particular, by Lemma 2, this implies that when ∥Σ−I∥2\|\Sigma-I\|_{2} is small, then learning a Gaussian with unknown covariance in total variation distance is equivalent to learning the expectation of every even degree-22 polynomial.

Theorem 14 implies the following concentration for degree-44 (more generally, low-degree) polynomials of Gaussians:

Let pp be a degree-44 polynomial. Then there is some A,C≥0A,C\geq 0 so that for all t≥Ct\geq C, we have

Hypercontractivity in particular implies the following moment bound: for all q≥2q\geq 2 even, we have

By a typical moment argument, and optimizing the choice of qq, this gives the desired bound. ∎

We define the kkth harmonic component of pp to be

and we say pp is harmonic of degree kk if it equals its kkth part.

3 Working with Many Large Eigenvalues of the Second and Fourth Moment

As in the unknown mean case, we will need a filter to detect if there are many directions of the empirical covariance which have too large an eigenvalue. Formally, we need:

Fix ε,δ>0\varepsilon,\delta>0. Assume ∥Σ−I∥F≤ξ\|\Sigma-I\|_{F}\leq\xi, where ξ=O(εlog⁡1/ε)\xi=O(\varepsilon\log 1/\varepsilon). Suppose that G0G_{0} is (ε,δ)(\varepsilon,\delta)-good with respect to N(0,Σ)\mathcal{N}(0,\Sigma). Let SS be a set so that Δ(S,G0)≤ε\Delta(S,G_{0})\leq\varepsilon. Let Σ^=\mboxES[XXT]\widehat{\Sigma}=\mathop{\mbox{\bf E}}_{S}[XX^{T}]. Then there is an algorithm FilterCovManyDeg2Eig and a universal constant CC such that the following guarantee holds:

If Σ^−I\widehat{\Sigma}-I has more than O(log⁡1/ε)O(\log 1/\varepsilon) eigenvalues larger than CξC\xi, then the algorithm outputs a S′S^{\prime} so that Δ(S′,G0)<Δ(S,G0)\Delta(S^{\prime},G_{0})<\Delta(S,G_{0}).

Otherwise, the algorithm outputs “OK”, and outputs an orthonormal basis v1,…,vkv_{1},\ldots,v_{k} for the subspace VV of vectors spanned by all eigenvectors of Σ^−I\widehat{\Sigma}-I with eigenvalue larger than CξC\xi.

The filter developed here is almost identical to the one developed for unknown mean. Thus, for conciseness we describe and prove the theorem in Appendix D.1.

We will also need a subroutine to enforce the condition that not only does the fourth moment tensor have spectral norm which is at most O(εlog⁡21/ε)O(\varepsilon\log^{2}1/\varepsilon) (restricted to a certain subspace of polynomials), but there can only be at most O(poly⁡log⁡1/ε)O(\operatorname*{poly}\log 1/\varepsilon) directions in which the eigenvalue is large. However, the techniques here are a bit more complicated, for a number of reasons. Intuitively, the main complication comes from the fact that we do not know what the fourth moment tensor looks like, whereas in the unknown mean case, we knew that the covariance was the identity by assumption. Our main result in this subsection is the following subroutine:

Otherwise, the algorithm outputs “OK”, and outputs an orthonormal basis p1,…,pk′p_{1},\ldots,p_{k^{\prime}} for a subspace VV of degree-22 polynomials in P2(W)\mathcal{P}_{2}(W) with k′≤kk^{\prime}\leq k so that for all p∈V⊥∩P2p\in V^{\perp}\cap\mathcal{P}_{2}, we have \mboxES[p2(X)]−1≤C2ε\mathop{\mbox{\bf E}}_{S}[p^{2}(X)]-1\leq C_{2}\varepsilon.

Moreover, FilterCovManyEig runs in time poly⁡(d,1/ε,log⁡1/δ)\operatorname*{poly}(d,1/\varepsilon,\log 1/\delta).

Roughly, we will show that if there are many polynomials with large empirical variance, this implies that there is a degree-four polynomial whose value is much larger than it could be if ww were the set of uniform weights over the uncorrupted points. Moreover, we can explicitly construct this polynomial, and it has a certain low-rank structure which allows us to use the concentration bounds we have previously derived.

4 Stitching Together Two Subspaces

This section is dedicated to giving an algorithm which allows us to fully reconstruct the covariance matrix given that we know it up to small error on a low-dimensional subspace VV and on W=V⊥W=V^{\perp}.

with ∥ΣV−IV∥F,∥ΣW−IW∥F=O(η)\|\Sigma_{V}-I_{V}\|_{F},\|\Sigma_{W}-I_{W}\|_{F}=O(\eta). Let S0=(G0,E0)S_{0}=(G_{0},E_{0}) be an ε\varepsilon-corrupted set of samples from N(0,Σ)\mathcal{N}(0,\Sigma), and let S⊆S0S\subseteq S_{0} with Δ(S,G)≤O(ε)\Delta(S,G)\leq O(\varepsilon) of size poly⁡(d,1/η,log⁡1/δ)\operatorname*{poly}(d,1/\eta,\log 1/\delta).

Then, there exists a universal constant C5C_{5} and an algorithm Stitching that given V,W,ξ,η,ε,τV,W,\xi,\eta,\varepsilon,\tau and SS runs in polynomial time and with probability at least 1−τ1-\tau returns a matrix Σ0\Sigma_{0} with ∥Σ0−Σ∥F=C5η+O(ξ2)\|\Sigma_{0}-\Sigma\|_{F}=C_{5}\eta+O(\xi^{2}).

Before we prove Theorem 17, we will need the following definition.

Throughout this proof, let G=N(0,Σ)G=\mathcal{N}(0,\Sigma). It is clear that this algorithm has polynomial runtime and sample complexity. We have yet to show correctness. The first thing that we need to understand is the procedure of rejection sampling, where we reject xx except with probability exp⁡(−∥xV−v∥2/2)\exp(-\|x_{V}-v\|^{2}/2). Therefore, given a distribution DD, we let the positive measure DvD_{v} be what is obtained by sampling from DD and accepting a sample xx only with probability exp⁡(−∥xV−v∥2/2)\exp(-\|x_{V}-v\|^{2}/2). We need to understand the distributions GvG_{v} and XvX_{v}.

Note that letting μv:=(Σ−1+IV)−1v=v/2+O(δ∥v∥2)\mu_{v}:=(\Sigma^{-1}+I_{V})^{-1}v=v/2+O(\delta\|v\|_{2}) that this equals

Note that this is a Gaussian with mean μv\mu_{v} weighted by

so long as ∥v∥2≪δ−1/2\|v\|_{2}\ll\delta^{-1/2}. Therefore, if this condition holds, a random sample from GG is accepted by this procedure with probability Θ(2−dim⁡(V)exp⁡(−∥v∥22/4)\Theta(2^{-\dim(V)}\exp(-\|v\|_{2}^{2}/4).

We also need to understand the fraction of samples from XvX_{v} that are erroneous. In a slight abuse of notation, let EE also denote the distribution which is uniform over the points in EE, and let LL be the distribution which is uniform over the points in LL. Therefore, we define

that is approximately the fraction of samples from XvX_{v} that are errors (where subtractive errors are weighted more heavily).

In order to show that this is generally a good approximation, we need to know that εv\varepsilon_{v} is not too large on average. In particular, we show:

If v∼N(0,2IV)v\sim N(0,2I_{V}), then \mboxEv[εv]=O(ε)\mathop{\mbox{\bf E}}_{v}[\varepsilon_{v}]=O(\varepsilon).

Letting F=E+log⁡(1/ε)LF=E+\log(1/\varepsilon)L, we have that

Note that πW(μv)=Mv\pi_{W}(\mu_{v})=Mv, where M=πW(Σ−1+IV)−1πVTM=\pi_{W}(\Sigma^{-1}+I_{V})^{-1}\pi_{V}^{T}. Let BB be any dim⁡(W)×dim⁡(V)\dim(W)\times\dim(V) matrix. Note that

Therefore, \mboxEv∼N(0,2IV)[∥Bv−Mv∥2]=O(∥B−M∥F)\mathop{\mbox{\bf E}}_{v\sim N(0,2I_{V})}[\|Bv-Mv\|_{2}]=O(\|B-M\|_{F}). Since ∥Bv−Mv∥22\|Bv-Mv\|_{2}^{2} is a degree-22 polynomial in vv, by Corollary 4 in [Kan12],

Next we show that our choice of SS derandomizes this result.

With high probability over the choice of SS, we have that

for all dim⁡(W)×dim⁡(V)\dim(W)\times\dim(V) matrices BB.

This is equivalent to showing that for all matrices U=B−MU=B-M it holds

By the standard scaling laws, it suffices to show this only for UU with ∥U∥F=1\|U\|_{F}=1.

We also note that it suffices to show this only for UU in an ε\varepsilon-net for all such matrices. This is because if ∥U−U′∥F<ε\|U-U^{\prime}\|_{F}<\varepsilon and if U′U^{\prime} satisfies the desired condition, then

and with high probability \mboxEv∈uS[∥v∥2]=O(log⁡(1/ε)).\mathop{\mbox{\bf E}}_{v\in_{u}S}[\|v\|_{2}]=O(\log(1/\varepsilon)).

Note that such nets exist with size exp⁡(poly⁡(n/ε))\exp(\operatorname*{poly}(n/\varepsilon)). Therefore, it suffices to show that this condition holds for each such UU with probability exp⁡(−(n/ε)Ω(C))\exp(-(n/\varepsilon)^{\Omega(C)}).

The first follows because if S={v1,…,vm}S=\{v_{1},\ldots,v_{m}\} then \mboxEv∈uS[∥Uv∥2]\mathop{\mbox{\bf E}}_{v\in_{u}S}[\|Uv\|^{2}] is a degree-22 polynomial in the viv_{i} with mean O(1)O(1) and variance O(1/m)O(1/\sqrt{m}), so by standard concentration results, is O(1)O(1) with 1−exp⁡(−Ω(∣S∣))1-\exp(-\Omega(|S|)) probability. The latter follows from standard concentration bounds. This completes the proof. ∎

We also note that the random choice of SS has another nice property:

With SS and ava_{v} as above, with high probability we have that

Let S={v1,…,vm}S=\{v_{1},\ldots,v_{m}\}. Then ∥f(vi)−Mvi∥2\|f(v_{i})-Mv_{i}\|_{2} are independent random variables with mean \mboxE[O(εv+η)]=O(η)\mathop{\mbox{\bf E}}[O(\varepsilon_{v}+\eta)]=O(\eta) and variance at most

Now by Lemmas 12 and 13 with high probability over the choice of SS in Step 4, and the ava_{v} in Step 5 we have that for all dim⁡(W)×dim⁡(V)\dim(W)\times\dim(V)-matrices BB that

Combining these statements, we have that for all dim⁡(W)×dim⁡(V)\dim(W)\times\dim(V)-matrices BB that

Note that by taking B=MB=M, this quantity is O(η)O(\eta). Therefore, the BB found in Step 15 satisfies

The rest of the proof is a simple computation of the matrices involved. In particular, recall that

where the O(η)O(\eta) denotes a matrix with Frobenius norm O(η)O(\eta) and where ∥A∥F=O(δ)\|A\|_{F}=O(\delta). It is easy to see that

Therefore, M=A/2+O(η+δ2)M=A/2+O(\eta+\delta^{2}). Therefore, A=2M+O(η+δ2)=2B+O(η+δ2)A=2M+O(\eta+\delta^{2})=2B+O(\eta+\delta^{2}). And finally, we conclude that

5 The Full High-Dimensional Algorithm

We now show how to prove Theorem 11, given the pieces we have. We first show that given enough samples from N(0,Σ)\mathcal{N}(0,\Sigma), the empirical data set without corruptions satisfies the regularity conditions in Section 2.2.2 with high probability. For clarity of exposition, the proof of this lemma is deferred to Appendix D.3.

Fix η,δ>0\eta,\delta>0. Let X1,…,XnX_{1},\ldots,X_{n} be independent samples from N(μ,I)\mathcal{N}(\mu,I), where n=poly⁡(d,1/η,log⁡1/δ)n=\operatorname*{poly}(d,1/\eta,\log 1/\delta). Then, S={X1,…,Xn}S=\{X_{1},\ldots,X_{n}\} is (η,δ)(\eta,\delta)-good with respect to N(μ,I)\mathcal{N}(\mu,I) with probability at least 1−δ1-\delta.

Finally, we require the following guarantee, which states that if there is a degree-22 polynomial whose expectation under SS and the truth differs by a lot (equivalently, if the empirical covariance differs from the true covariance in Frobenius norm substantially), then it must also have very large variance under SS.

Fix ε,δ>0\varepsilon,\delta>0. Assume ∥Σ−I∥F≤ξ\|\Sigma-I\|_{F}\leq\xi, where ξ=O(εlog⁡1/ε)\xi=O(\varepsilon\log 1/\varepsilon). Suppose that G0G_{0} is (ε,δ)(\varepsilon,\delta)-good with respect to N(0,Σ)\mathcal{N}(0,\Sigma), and let S⊆S0S\subseteq S_{0} be a set so that Δ(S,G0)≤ε\Delta(S,G_{0})\leq\varepsilon. There is some absolute constant C5C_{5} so that if p∈P2p\in\mathcal{P}_{2} is a polynomial so that ∣\mboxES[p(X)]−\mboxEN(0,Σ)[p(X)]∣>C5ξε\left|\mathop{\mbox{\bf E}}_{S}[p(X)]-\mathop{\mbox{\bf E}}_{\mathcal{N}(0,\Sigma)}[p(X)]\right|>C_{5}\sqrt{\xi\varepsilon}, then \mboxES[p2(X)]−1>C1ξ\mathop{\mbox{\bf E}}_{S}[p^{2}(X)]-1>C_{1}\xi.

We defer the proof of this lemma to the Appendix.

We are now ready to present the full algorithm as Algorithm 10.

Condition on the events that neither LearnCovLowDim nor Stitching fail. This happens with probability at least poly⁡(ε,1/d,δ)\operatorname*{poly}(\varepsilon,1/d,\delta). Observe that if we pass the “if” statement in Line 5, then by the guarantee of FilterCovManyDeg2Eig this is indeed an S′S^{\prime} satisfying the desired properties. Otherwise, by the guarantees of FilterCovManyDeg2Eig, we have that WW satisfies the conditions needed by FilterCovManyDeg4Eig. Hence, if we pass the “if” statement in Line 11, then the guarantee of FilterCovManyDeg4Eig this is indeed a S′S^{\prime} satisfying the desired properties. Otherwise, by Lemma 15, we know that for all polynomials p∈P2p\in\mathcal{P}_{2} over WW orthogonal to U1U_{1}, we have ∣\mboxEN(0,Σ)−\mboxES[XXT]∣≤C5ξε|\mathop{\mbox{\bf E}}_{\mathcal{N}(0,\Sigma)}-\mathop{\mbox{\bf E}}_{S}[XX^{T}]|\leq C_{5}\sqrt{\xi\varepsilon}. Thus, ΣW\Sigma_{W} satisfies the conditions needed by Stitching.

By Corollary 4, we know that ΣV\Sigma_{V} satisfies the conditions for Stitching, and so the correctness of the algorithm follows from Theorem 17. ∎

6 The Barrier at Quasi-Polynomial

Here we explain why improving the running time from quasi-polynomial to polynomial in 1/ε1/\varepsilon will likely be rather difficult. Recall that our strategy is to project the problem onto lower dimensional subproblems and stitch together the answer. We need the dimension of the subspace to be large enough that we can find a polynomial QQ that is itself the sum of squares of kk orthogonal degree two polynomials pip_{i} so that the value of QQ on the corrupted points is considerably larger than the value on the uncorrupted points. More precisely, if we let S=(G,E)S=(G,E) denote our corrupted set of samples then we want \mboxEE[Q(X)]\mathop{\mbox{\bf E}}_{E}[Q(X)] to be larger than Q(X)Q(X) for all but a poly⁡(ε)\operatorname*{poly}(\varepsilon) fraction of X∈GX\in G. We then remove all points X∈SX\in S with large Q(X)Q(X) and by the properties of QQ we are guaranteed that we throw out mostly corrupted points. It turns out that the most aggressive we could be is removing points where Q(X)Q(X) is more than k\sqrt{k} standard deviations away from its expectation under the true Gaussian. But since QQ is a degree-four polynomial and we want Q(X)Q(X) to be smaller than our cutoff for all but a poly⁡(ε)\operatorname*{poly}(\varepsilon) fraction of X∈GX\in G, we are forced to choose k=Ω(log⁡1/ε)\sqrt{k}=\Omega(\log 1/\varepsilon), which means that we need to reduce to k=Ω(log⁡21/ε)k=\Omega(\log^{2}1/\varepsilon) dimensional subproblems. Thus, if we solve low-dimensional subproblems in time exponential in the dimension, we naturally arrive at a quasi-polynomial running time. It seems that any approach for reducing the running time to polynomial would require fundamentally new ideas.

The General Algorithm

We now have all the tools to robustly learn the mean and covariance of an arbitrary high-dimensional Gaussian. We first show how to reduce the problem of robustly learning the covariance of N(μ,Σ)\mathcal{N}(\mu,\Sigma) to learning the covariance of N(0,Σ)\mathcal{N}(0,\Sigma), by at most doubling error, a trick previously used in [DKK+16] and [LRV16]. Given an ε\varepsilon-corrupted set of samples X1,…,X2nX_{1},\ldots,X_{2n} of size 2n2n from N(μ,Σ)\mathcal{N}(\mu,\Sigma), we may let Yi=(Xi−Xn+i)/2Y_{i}=(X_{i}-X_{n+i})/\sqrt{2}. Then we see that if XiX_{i} and Xn+iX_{n+i} are uncorrupted, then Yi∼N(0,Σ)Y_{i}\sim\mathcal{N}(0,\Sigma). Moreover, at most 2εn2\varepsilon n of the YiY_{i} can be corrupted, since there are at most 2εn2\varepsilon n corrupted XiX_{i}. Therefore, by doubling the error rate, we may assume that μ=0\mu=0. We may then apply the algorithm in Corollary 5 to obtain a Σ^\widehat{\Sigma} so that with high probability, we have ∥Σ^−1/2ΣΣ^−1/2−I∥F≤O(ε)\|\widehat{\Sigma}^{-1/2}\Sigma\widehat{\Sigma}^{-1/2}-I\|_{F}\leq O(\varepsilon) with polynomially many samples, and in poly⁡(d,(1/ε)O(log⁡41/ε))\operatorname*{poly}(d,(1/\varepsilon)^{O(\log^{4}1/\varepsilon)}) time.

Fix ε,δ>0\varepsilon,\delta>0. Given an ε\varepsilon-corrupted set of samples SS from N(μ,Σ)\mathcal{N}(\mu,\Sigma), where n=poly⁡(d,1/ε,log⁡1/δ)n=\operatorname*{poly}(d,1/\varepsilon,\log 1/\delta), there is an algorithm RecoverGaussian which takes as input S,ε,δS,\varepsilon,\delta, and outputs a μ^,Σ^\widehat{\mu},\widehat{\Sigma} so that

Moreover, the algorithm runs in time poly⁡(d,(1/ε)O(log⁡41/ε),log⁡1/δ)\operatorname*{poly}(d,(1/\varepsilon)^{O(\log^{4}1/\varepsilon)},\log 1/\delta).

References

Appendix A Lower Bounds on Agnostic Learning

In this section, we prove information theoretic lower bounds for robust distribution learning. In particular, we will prove that no algorithm (efficient or inefficient) can learn a general distribution from an ε\varepsilon-corrupted set of samples to total variation distance less than ε1−ε\frac{\varepsilon}{1-\varepsilon}. We note that our lower bound applies in more general settings than we consider in this paper in couple of ways:

Our construction works for any pair of distributions which are ε1−ε\frac{\varepsilon}{1-\varepsilon}-close, and not just for Gaussian distributions; and

Our construction holds for Huber’s ε\varepsilon-contamination model, which is weaker than the noise model studied in this paper.

In Huber’s ε\varepsilon-contamination model, data is drawn from a mixture distribution (1−ε)P+εQ(1-\varepsilon)P+\varepsilon Q, where PP is some distribution that we wish to estimate and QQ is arbitrary (in particular, it might depend on PP). We will show that any two distributions which are ε1−ε\frac{\varepsilon}{1-\varepsilon}-close can be made indistinguishable under this contamination model.

where pc,q1,q2p_{c},q_{1},q_{2} are distributions. Let p1′p_{1^{\prime}} be the Huber ε\varepsilon-contamination of p1p_{1} with q2q_{2}, p2′p_{2^{\prime}} be the Huber ε\varepsilon-contamination of p2p_{2} with q1q_{1}. In other words,

and thus p1′=p2′p_{1^{\prime}}=p_{2^{\prime}} as desired. ∎

We note that a similar lower bound holds when p1p_{1} and p2p_{2} are required to be Gaussians, but weakened by a factor of 22. This is due to the geometry of the space of Gaussian distributions, and we note that in the case where the variance is known, this is achieved by the median.

No algorithm can output an estimate for the mean of a unit-variance Gaussian at accuracy <(π2−o(1))ε<\left(\sqrt{\frac{\pi}{2}}-o(1)\right)\varepsilon with probability >1/2>1/2 in Huber’s ε\varepsilon-contamination model. Consequently, by Lemma 1, no algorithm can learn a Gaussian to total variation distance <(12−o(1))ε<\left(\frac{1}{2}-o(1)\right)\varepsilon in Huber’s ε\varepsilon-contamination model.

We will consider the distributions p1=N(−α,1)p_{1}=\mathcal{N}(-\alpha,1) and p2=N(α,1)p_{2}=\mathcal{N}(\alpha,1), where α\alpha is to be specified later. We note that if p1p_{1} and p2p_{2} can be ε\varepsilon-corrupted into the same distribution, then the best estimate for the mean is to output (by symmetry), and the result holds.

Again, since we require that (1−ε)p1(x)≤f(x)(1-\varepsilon)p_{1}(x)\leq f(x), it suffices that 1−ε≤1−2πα+O(α2)1-\varepsilon\leq 1-\sqrt{\frac{2}{\pi}}\alpha+O(\alpha^{2}) and thus that 2πα−O(α2)≤ε\sqrt{\frac{2}{\pi}}\alpha-O(\alpha^{2})\leq\varepsilon. This corresponds to α≤(π2−o(1))ε\alpha\leq\left(\sqrt{\frac{\pi}{2}}-o(1)\right)\varepsilon, and the proof is complete. ∎

Observe that this lower bound can be strengthened by a factor of two in the subtractive adversary model, where the adversary is able to both remove εN\varepsilon N samples and add εN\varepsilon N samples. In this infinite sample regime, this means that a distribution can be corrupted to any distribution which is ε\varepsilon-far in total variation distance. By noting that N(−α,1)\mathcal{N}(-\alpha,1) and N(α,1)\mathcal{N}(\alpha,1) are both ε\varepsilon-far from N(0,1)\mathcal{N}(0,1) for α=(2π+o(1))ε\alpha=\left(\sqrt{2\pi}+o(1)\right)\varepsilon, we obtain the following lemma. Note that this lower bound is also achieved by the median in this model.

No algorithm can output an estimate for the mean of a unit-variance Gaussian at accuracy <(2π+o(1))ε<\left(\sqrt{2\pi}+o(1)\right)\varepsilon with probability >1/2>1/2 in the subtractive adversary model. Consequently, by Lemma 1, no algorithm can learn a Gaussian to total variation distance <ε<\varepsilon in the subtractive adversary model.

Finally, we conclude by sketching a lower bound for mean estimation of sub-Gaussian distributions.

No algorithm can output an estimate for the mean of a sub-Gaussian distribution at accuracy o(εlog⁡1/2(1/ε))o(\varepsilon\log^{1/2}(1/\varepsilon)) with probability >1/2>1/2 in the Huber’s ε\varepsilon-contamination model.

We start with the distribution q=N(0,1)q=\mathcal{N}(0,1). We construct p1p_{1} by truncating the right tail of qq at the point xr=c1log⁡1/2(1/ε)x_{r}=c_{1}\log^{1/2}(1/\varepsilon) for some constant c1c_{1}, and rescaling the rest of the distribution appropriately. Observe that, for an appropriate choice of c1c_{1}:

p1p_{1} is sub-Gaussian with a constant of O(11−ε)O\left(\frac{1}{1-\varepsilon}\right);

The mean of p1p_{1} is −c2εlog⁡1/2(1/ε)-c_{2}\varepsilon\log^{1/2}(1/\varepsilon) for some constant c2c_{2};

p1p_{1} can be corrupted in Huber’s ε\varepsilon-contamination model to be qq.

We can similarly consider p2p_{2}, which is constructed by truncating the left tail of qq at the point xl=−c1log⁡1/2(1/ε)x_{l}=-c_{1}\log^{1/2}(1/\varepsilon). Since p1p_{1} and p2p_{2} are indistinguishable when they are both ε\varepsilon-corrupted to qq, and the mean of all three distributions are separated by ≥c2εlog⁡1/2(1/ε)\geq c_{2}\varepsilon\log^{1/2}(1/\varepsilon), the lemma follows. ∎

Appendix B Omitted Proofs from Section 2

Observe that by rotational and translational invariance, it suffices to consider the problem when μ1=−εe1/2\mu_{1}=-\varepsilon e_{1}/2 and μ2=εe1/2\mu_{2}=\varepsilon e_{1}/2, where e1e_{1} is the first standard basis vector. By the decomposability of TV distance, we have that the TV distance can in fact be written as a 1 dimensional integral:

The value of the function f(x)=e−(x−ε/2)2/2−e−(x+ε/2)2/2f(x)=e^{-(x-\varepsilon/2)^{2}/2}-e^{-(x+\varepsilon/2)^{2}/2} is negative when x<0x<0 and positive when x>0x>0, hence this integral becomes

where F(x)=12π∫−∞xe−t2/2dtF(x)=\frac{1}{\sqrt{2\pi}}\int_{-\infty}^{x}e^{-t^{2}/2}dt is the CDF of the standard normal Gaussian. By Taylor’s theorem, and since F′′(x)F^{\prime\prime}(x) is bounded when x∈x\in, we have

Appendix C Omitted Proofs from Section 4

Letting v1,…,vC1βlog⁡(1/ε)v_{1},\dots,v_{C_{1}\beta\log(1/\varepsilon)} be an orthonormal basis of V′V^{\prime}, we have

This follows from Lemma 7, after re-centering the polynomial using Claim 4 and noting that the spectral norm and squared Frobenius norm of the corresponding AA matrix are at most 11 and C1βlog⁡(1/ε)C_{1}\beta\log(1/\varepsilon), respectively. ∎

\mboxES[p(X)]≥C1εlog⁡(1/ε)\mathop{\mbox{\bf E}}_{S}[p(X)]\geq C_{1}\varepsilon\log(1/\varepsilon).

Recall that μ^\hat{\mu} is the empirical mean of the point set.

The inequalities follow from (γε,δ)(\gamma\varepsilon,\delta)-goodness and Claim 4. ∎

ϕ(S,G0)\mboxEL[p(X)]=(C1β+O(γ)+o(1))ε\phi(S,G_{0})\mathop{\mbox{\bf E}}_{L}[p(X)]=(C_{1}\beta+O(\gamma)+o(1))\varepsilon.

(4) and (5) follow from G0G_{0} being (γε,δ)(\gamma\varepsilon,\delta)-good, (6) is from Claim 5, and (7) is because

ψ\mboxEE[p(X)]≥C1εlog⁡1/ε−(C1β+1+O(γ)+o(1))ε\psi\mathop{\mbox{\bf E}}_{E}[p(X)]\geq C_{1}\varepsilon\log 1/\varepsilon-(C_{1}\beta+1+O(\gamma)+o(1))\varepsilon.

This immediately follows from Claims 6, 7, and 8. ∎

We now show that in the case that there are many large eigenvalues, there will be a TT satisfying the conditions of the filter.

Suppose dim⁡(V)≥C1βlog⁡(1/ε)\dim(V)\geq C_{1}\beta\log(1/\varepsilon). Then there is a TT satisfying the conditions in the algorithm.

By applying the contradiction assumption, we have

It now suffices to prove that if we construct a filter, then the invariant that Δ\Delta decreases is preserved. Formally, we show:

Suppose dim⁡(V)≥C1βlog⁡(1/ε)\dim(V)\geq C_{1}\beta\log(1/\varepsilon). Let S′S^{\prime} be the set of points we return. Then Δ(S′,G)<Δ(S,G)\Delta(S^{\prime},G)<\Delta(S,G).

Let TT be the threshold we pick. If T>C2dlog⁡(∣S∣/δ)T>C_{2}d\log(|S|/\delta) then the invariant is satisfied since we remove no good points, by (γε,δ)(\gamma\varepsilon,\delta)-goodness. It suffices to show that in the other case, we remove log⁡(1/ε)\log(1/\varepsilon) times many more bad points than good points. By definition we remove at least

points. On the other hand, by (γε,δ)(\gamma\varepsilon,\delta)-goodness, Claim 5, we know that we throw away at most

By our choice of TT, and since ∥μ−μ~∥2≤O(δ)≪1\|\mu-\widetilde{\mu}\|_{2}\leq O(\delta)\ll 1, the first term is upper bounded by

Since we have maintained this invariant so far, in particular, we have thrown away more bad points than good points, and so ∣G0∣≤(1+ε)∣S∣|G_{0}|\leq(1+\varepsilon)|S|.

Therefore, we have log⁡(1/ε)⋅∣G∣⋅Pr⁡G[p(X)>T]≤∣S∣⋅(exp⁡(−c0T2C3)+γεdlog⁡∣S∣/δ)\log(1/\varepsilon)\cdot|G|\cdot\Pr_{G}[p(X)>T]\leq|S|\cdot\left(\exp\left(-\frac{c_{0}T}{2C_{3}}\right)+\frac{\gamma\varepsilon}{d\log|S|/\delta}\right), and hence, the invariant is satisfied. ∎

Claims 10 and 11 together imply the correctness of Theorem 7.

C.2 Proof of Lemma 5

We require the following basic fact of good sets (see, e.g., Fact 8.6 in [DKK+16]):

Let ⟨v,μ−μ^⟩=R>εβ1/2\langle v,\mu-\widehat{\mu}\rangle=R>\frac{\varepsilon}{\beta^{1/2}}. Observe that by direct calculation, we have \mboxES[⟨v,X−μ⟩2]−\mboxES[⟨v,X−μ^⟩2]≤3R2\mathop{\mbox{\bf E}}_{S}[\langle v,X-\mu\rangle^{2}]-\mathop{\mbox{\bf E}}_{S}[\langle v,X-\widehat{\mu}\rangle^{2}]\leq 3R^{2}. Hence, it suffices to show that \mboxES[⟨v,X−μ⟩2]≥1+Ω(R2/ε)−(γ+O(1β))ε.\mathop{\mbox{\bf E}}_{S}[\langle v,X-\mu\rangle^{2}]\geq 1+\Omega(R^{2}/\varepsilon)-\left(\gamma+O\left(\frac{1}{\beta}\right)\right)\varepsilon.

We write S=(G0∖L,E)S=(G_{0}\setminus L,E) where ∣E∣=ψ∣S∣|E|=\psi|S| and ∣L∣=ϕ∣S∣|L|=\phi|S|. First we consider the expectation of v⋅Xv\cdot X over XX in SS. This is

where μ0\mu_{0} is the mean over G0G_{0}, μL\mu_{L} the mean over LL and μE\mu_{E} the mean over EE. By (γε,δ)(\gamma\varepsilon,\delta)-goodness, we have that ∣⟨v,μ0−μ⟩∣≤γε\left|\langle v,\mu_{0}-\mu\rangle\right|\leq\gamma\varepsilon. We also have that

by Fact 2 and the calculations done in the proof of Corollary 8.8 in [DKK+16], we have that ∣⟨v,μL−μ⟩∣≤O(log⁡∣S∣/∣L∣)≤O(log⁡1/ϕ)|\langle v,\mu_{L}-\mu\rangle|\leq O(\log|S|/|L|)\leq O(\log 1/\phi). Since by assumption we have ⟨v,μ−μ^⟩=R>εβ1/2\langle v,\mu-\widehat{\mu}\rangle=R>\frac{\varepsilon}{\beta^{1/2}}, this implies that ⟨v,μE−μ⟩=Ω(R/ε)\langle v,\mu_{E}-\mu\rangle=\Omega(R/\varepsilon). In particular, this implies that

Next we consider the expectation of ⟨v,X−μ⟩2\langle v,X-\mu\rangle^{2}. By (γε,δ)(\gamma\varepsilon,\delta)-goodness, we have \mboxEG0[⟨v,X−μ⟩2]=1+O(ε)\mathop{\mbox{\bf E}}_{G_{0}}[\langle v,X-\mu\rangle^{2}]=1+O(\varepsilon). We also have that

this is at least 1+Ω(R2/ε)−(γ+O(1β))ε1+\Omega(R^{2}/\varepsilon)-\left(\gamma+O\left(\frac{1}{\beta}\right)\right)\varepsilon.

Appendix D Omitted Proofs from Section 6

Our algorithm works as follows, just as for Algorithm 4. It finds all large eigenvalues of Σ^−I\widehat{\Sigma}-I, and if there are too many, produces an explicit degree-22 polynomial which, as we will argue, produces a valid filter. The formal pseudocode for our algorithm is in Algorithm 11.

The proofs of the following claims are identical to the proofs of Claim 6-9, by applying the corresponding property of (γε,δ)(\gamma\varepsilon,\delta)-goodness for this setting, and so we omit them.

\mboxES[p(x)]≥Cξ.\mathop{\mbox{\bf E}}_{S}[p(x)]\geq C\xi.

\mboxEG0[p(X)]≤ε(dlog⁡1/ε)2\mathop{\mbox{\bf E}}_{G_{0}}[p(X)]\leq\frac{\varepsilon}{(d\log 1/\varepsilon)^{2}}.

ϕ(S,G0)\mboxEL[p(X)]=(C+O(γ)+o(1))ε\phi(S,G_{0})\mathop{\mbox{\bf E}}_{L}[p(X)]=(C+O(\gamma)+o(1))\varepsilon.

ψ\mboxEE[p(X)]≥Cξ−(C1+1+O(γ)+o(1))ε\psi\mathop{\mbox{\bf E}}_{E}[p(X)]\geq C\xi-(C_{1}+1+O(\gamma)+o(1))\varepsilon.

These claims imply just as before that there is a TT with the desired properties. Again, the proof is identical. Formally:

Suppose dim⁡(V)≥Clog⁡(1/ε)\dim(V)\geq C\log(1/\varepsilon). Then there is a TT satisfying the conditions in the algorithm.

Finally, we show the invariant that Δ\Delta decreases. This is almost identical to the proof of Claim 11, however, we need to slightly change our application of the Hanson-Wright inequality. Formally, we show:

Suppose dim⁡(V)≥C1log⁡1/ε\dim(V)\geq C_{1}\log 1/\varepsilon. Let S′S^{\prime} be the set of points we return. Then Δ(S′,G)<Δ(S,G)\Delta(S^{\prime},G)<\Delta(S,G).

Let TT be the threshold we pick. If T>C2dlog⁡(∣S∣/δ)T>C_{2}d\log(|S|/\delta) then the invariant is satisfied since we remove no good points, by (γε,δ)(\gamma\varepsilon,\delta)-goodness. It suffices to show that in the other case, we remove log⁡1/ε\log 1/\varepsilon times many more bad points than good points. By definition we remove at least

points. On the other hand, observe that if v1,…,vkv_{1},\ldots,v_{k} is an orthonormal basis for VV, we have

so that if X∼N(0,Σ)X\sim\mathcal{N}(0,\Sigma), we have Y∼N(0,I)Y\sim\mathcal{N}(0,I). Let M=Σ1/2(∑viviT)Σ1/2M=\Sigma^{1/2}\left(\sum v_{i}v_{i}^{T}\right)\Sigma^{1/2}. We have that ∥M∥F≤∑i=1n∥Σ∥2≤(1+ξ)k\|M\|_{F}\leq\sum_{i=1}^{n}\|\Sigma\|_{2}\leq(1+\xi)k, and ∥M∥2≤∥Σ∥2≤(1+ξ)\|M\|_{2}\leq\|\Sigma\|_{2}\leq(1+\xi). Since

The remaining proof now proceeds identically to the proof of Claim 17. ∎

D.2 Proof of Theorem 16

Clearly, the only non-trivial condition to certify for Theorem 16 is that if we are in Case (1), the returned set satisfies the desired properties.

Our proof will roughly follow the same structure as the proof of Theorem 7. We will first show that the empirical average of the polynomial QQ can only be large because of the contribution of the points in EE (Claim 21). We will then show that this implies that there exists a threshold TT which the algorithm will find in this case (Claim 22). Finally, we will show that for any such TT we find, the returned set of points will indeed satisfy Δ(S′,G0)<Δ(S,G0)\Delta(S^{\prime},G_{0})<\Delta(S,G_{0}), which implies the correctness of the algorithm (Claim 23).

\mboxES[ri]−\mboxEN(0,Σ)[ri]≤(4C+1)ξ\mathop{\mbox{\bf E}}_{S}[r_{i}]-\mathop{\mbox{\bf E}}_{\mathcal{N}(0,\Sigma)}[r_{i}]\leq(4C+1)\xi

Let us suppose that pip_{i} corresponds to the matrix AiA_{i}, given by (Ai)a,b=∇a∇bpi/2!(A_{i})_{a,b}=\nabla_{a}\nabla_{b}p_{i}/\sqrt{2!}, so that the AiA_{i} are orthonormal with respect to the Frobenius norm. Then the constant harmonic part of pi2p_{i}^{2} corresponds to ∥Ai∥F2≤1\|A_{i}\|_{F}^{2}\leq 1. The degree-22 harmonic part of pi2p_{i}^{2} corresponds to the matrix 22Ai22\sqrt{2}A_{i}^{2}. This is because if we let BiB_{i} be the matrix corresponding to pi2p_{i}^{2}, we have

where the second to last line follows since ∇a∇bpi(X)\nabla_{a}\nabla_{b}p_{i}(X) is a constant, and the last line follows from explicit computation. In particular, this implies that the non-constant component of rir_{i} corresponds to matrix with trace norm at most 22≤42\sqrt{2}\leq 4. Therefore, rir_{i} can be written as ri(x)=∑αi⟨vi,x⟩2+C0r_{i}(x)=\sum\alpha_{i}\langle v_{i},x\rangle^{2}+C_{0} for some constant C0C_{0}, where ∑∣αi∣≤4\sum|\alpha_{i}|\leq 4. Thus, by our assumption, we have \mboxES[ri]≤1+Cξ\mathop{\mbox{\bf E}}_{S}[r_{i}]\leq 1+C\xi. The claim then follows since Σ\Sigma and II are differ in Frobenius norm by at most ξ\xi. ∎

\mboxES[Q(X)]−\mboxEX∼N(0,Σ)[Q(X)]≥(C1−6)ξk\mathop{\mbox{\bf E}}_{S}[Q(X)]-\mathop{\mbox{\bf E}}_{X\sim\mathcal{N}(0,\Sigma)}[Q(X)]\geq(C_{1}-6)\xi k

Observe that since ∥Σ−I∥F≤ξ\|\Sigma-I\|_{F}\leq\xi, in particular we have ∥Σ⊗2−I⊗2∥2≤ξ\|\Sigma^{\otimes 2}-I^{\otimes 2}\|_{2}\leq\xi, and hence by Lemma 10 we have that ∣\mboxEN(0,Σ)[p2(X)]−\mboxEX∼N(0,I)[p2(X)]∣≤2ξ\left|\mathop{\mbox{\bf E}}_{\mathcal{N}(0,\Sigma)}[p^{2}(X)]-\mathop{\mbox{\bf E}}_{X\sim\mathcal{N}(0,I)}[p^{2}(X)]\right|\leq 2\xi for all p∈P2p\in\mathcal{P}_{2}. Hence, in particular, we have

There is some universal constant BB so that

Before we prove this, we need the following lemma:

For any degree-44 polynomial pp, and any Σ\Sigma, if we let F(y,p,Σ)F(y,p,\Sigma) denote the yyth percentile of pp under Σ\Sigma, then we have F(1/4,p2,Σ),F(3/4,p2,Σ)=Θ(\mboxEX∼N(0,Σ)[p2(X)])F(1/4,p^{2},\Sigma),F(3/4,p^{2},\Sigma)=\Theta(\mathop{\mbox{\bf E}}_{X\sim\mathcal{N}(0,\Sigma)}[p^{2}(X)]).

Let μ′=\mboxEX∼N(0,Σ)[p2(X)]\mu^{\prime}=\mathop{\mbox{\bf E}}_{X\sim\mathcal{N}(0,\Sigma)}[p^{2}(X)]. First, we note that Pr⁡(p2(X)>4μ′)≤1/4,\Pr(p^{2}(X)>4\mu^{\prime})\leq 1/4, so F(3/4,p2,Σ)≤4μ′F(3/4,p^{2},\Sigma)\leq 4\mu^{\prime}. On the other hand, by known anti-concentration bounds [CW01], we have that Pr⁡(p2(X)≤εμ′)=Pr⁡(∣p(X)∣≤εμ′)=O(ε1/8)\Pr(p^{2}(X)\leq\varepsilon\mu^{\prime})=\Pr(|p(X)|\leq\sqrt{\varepsilon\mu^{\prime}})=O(\varepsilon^{1/8}). So, for ε\varepsilon a sufficiently small constant, Pr⁡(p2(X)≤εμ′)<1/4\Pr(p^{2}(X)\leq\varepsilon\mu^{\prime})<1/4, and therefore, F(1/4,p2,Σ)≥εμ′F(1/4,p^{2},\Sigma)\geq\varepsilon\mu^{\prime}. Since εμ′≤F(1/4,p2,Σ)≤F(3/4,p2,Σ)≤4μ′\varepsilon\mu^{\prime}\leq F(1/4,p^{2},\Sigma)\leq F(3/4,p^{2},\Sigma)\leq 4\mu^{\prime}, this completes our proof. ∎

Hence, it suffices to bound ∥Q∥22\|Q\|_{2}^{2}.

Let us again suppose that pip_{i} corresponds to the matrix AiA_{i}, given by (Ai)a,b=∇a∇bpi/2!(A_{i})_{a,b}=\nabla_{a}\nabla_{b}p_{i}/\sqrt{2!}. Note that the AiA_{i} are symmetric matrices that form an orthonormal set. We note that qiq_{i} is the harmonic degree-44 polynomial corresponding to the rank-44 tensor

Since the AiA_{i} are orthonormal, cj≤1c_{j}\leq 1 for all jj. Furthermore,

Let μ′=\mboxEX∼N(0,Σ)[Q(X)]\mu^{\prime}=\mathop{\mbox{\bf E}}_{X\sim\mathcal{N}(0,\Sigma)}[Q(X)]. We now show that since G0G_{0} is ε\varepsilon-good, then almost all of the difference in Claim 19 must be because of the points in EE.

\mboxEE[Q(Y)]−μ′≥C1−62⋅ξkϕ\mathop{\mbox{\bf E}}_{E}[Q(Y)]-\mu^{\prime}\geq\frac{C_{1}-6}{2}\cdot\frac{\xi k}{\phi}

that is, the good points do not contribute much to the difference. By (ε,δ)(\varepsilon,\delta)-goodness of G0G_{0} and Claim 20 we have \mboxE0[Q(Y)]−μ′≤O(εk)\mathop{\mbox{\bf E}}_{0}[Q(Y)]-\mu^{\prime}\leq O\left(\varepsilon\sqrt{k}\right). Moreover, we have

where (a) follows from the boundedness condition of (ε,δ)(\varepsilon,\delta)-goodness, (b) follows from the last condition of goodness, and (c) follows from hypercontractivity. This shows (9), which completes the proof. ∎

We now show that this implies that there must be a TT satisfying the conditions in Algorithm 8.

If dim⁡(Vm)≥k\dim(V_{m})\geq k, then Algorithm 8 returns a TT satisfying the conditions in the algorithm.

Suppose not. By the assumption that ∥I−Σ∥F≤ξ\|I-\Sigma\|_{F}\leq\xi, we have ∣μ′∣=∣\mboxEX∼N(0,Σ)[Q(X)]∣≤2ξ∥Q∥2≤∑i=1k∥pi∥2+∥ri∥2≤5ξk|\mu^{\prime}|=|\mathop{\mbox{\bf E}}_{X\sim\mathcal{N}(0,\Sigma)}[Q(X)]|\leq 2\xi\|Q\|_{2}\leq\sum_{i=1}^{k}\|p_{i}\|_{2}+\|r_{i}\|_{2}\leq 5\xi k. Thus, we have

But since we assume there is no TT satisfying the conditions in Algorithm 8, we have

which is a contradiction, for our choice of C1,C2,C3C_{1},C_{2},C_{3}, and since we chose k=O(log⁡41/ε)k=O(\log^{4}1/\varepsilon). ∎

The final thing we must verify is that the number of good points we remove is much smaller than the number of bad points we remove. Formally, we show:

If dim⁡(Vm)≥k\dim(V_{m})\geq k, then Algorithm 8 returns a S′S^{\prime} satisfying Δ(S′,G0)<Δ(S,G0)\Delta(S^{\prime},G_{0})<\Delta(S,G_{0}).

Let TT be the threshold we pick. If T>C3d2klog⁡(∣S∣)T>C_{3}d^{2}\sqrt{k}\log(|S|) then the invariant is satisfied since we remove no good points, by (ε,δ)(\varepsilon,\delta)-goodness. It suffices to show that we remove log⁡1/ε\log 1/\varepsilon times many more bad points than good points. Otherwise, by definition we remove a total of

points. On the other hand, by (ε,δ)(\varepsilon,\delta)-goodness, hypercontractivity, and Claim 20, we know that the total number of points we throw away is at most

Since we have maintained this invariant so far, in particular, we have thrown away more bad points than good points, and so ∣G0∣≤(1+ε)∣S∣|G_{0}|\leq(1+\varepsilon)|S|. Moreover, since T≥4Bklog⁡21/εT\geq 4B\sqrt{k}\log^{2}1/\varepsilon, we have

Therefore, we have log⁡(1/ε)⋅∣G∣⋅Pr⁡G[Q(X)>T]≤∣S∣⋅(exp⁡(−A(T4Bk)1/2)+ε2d2log⁡∣G∣/δ)\log(1/\varepsilon)\cdot|G|\cdot\Pr_{G}[Q(X)>T]\leq|S|\cdot\left(\exp\left(-A\left(\frac{T}{4B\sqrt{k}}\right)^{1/2}\right)+\frac{\varepsilon^{2}}{d^{2}\log|G|/\delta}\right), and hence, the invariant is satisfied. ∎

Claims 22 and 23 together prove the theorem.

D.3 Proof of Lemma 6

By Lemma 8.16 in [DKK+16], the first two items hold together with probability 1−O(δ)1-O(\delta) after taking O(poly⁡(d,1/η,log⁡1/δ))O(\operatorname*{poly}(d,1/\eta,\log 1/\delta)) samples. Thus, it suffices to show that the last property holds with probability 1−O(δ)1-O(\delta) given O(poly⁡(d,1/η,log⁡1/δ))O(\operatorname*{poly}(d,1/\eta,\log 1/\delta)) samples. We may clearly WLOG take Σ=I\Sigma=I. Moreover, these properties are clearly invariant under scaling, and hence, it suffices to prove them for degree-four polynomials with \mboxVarN(0,I)[p(X)]=1\mathop{\mbox{\bf Var}}_{\mathcal{N}(0,I)}[p(X)]=1. For any fixed degree-44 polynomial pp, by hypercontractivity, since P(X)=1n∑i=1np(Xi)P(X)=\frac{1}{n}\sum_{i=1}^{n}p(X_{i}) has variance \mboxVar[P(X)]=1n\mathop{\mbox{\bf Var}}[P(X)]=\frac{1}{n}, we have that

Since there is a 1/31/3-net over all degree-44 polynomials with unit variance of size (1/3)O(d4)(1/3)^{O(d^{4})}, by union bounding, we obtain that if we take Ω(d4log⁡1/δη2)\Omega\left(\frac{d^{4}\log^{1/\delta}}{\eta^{2}}\right) samples, then the second to last property holds with probability 1−δ1-\delta.

Finally, the same net technique used to prove Lemma 8.16, along with hypercontractivity, may be used to show the last property holds when given poly⁡(d,log⁡1/η,log⁡1/δ)\operatorname*{poly}(d,\log 1/\eta,\log 1/\delta) samples.

D.4 Proof of Lemma 15

Let μ′=\mboxEN(0,Σ)[p(X)]\mu^{\prime}=\mathop{\mbox{\bf E}}_{\mathcal{N}(0,\Sigma)}[p(X)], s=\mboxEN(0,Σ)[p2(X)]s=\mathop{\mbox{\bf E}}_{\mathcal{N}(0,\Sigma)}[p^{2}(X)], and let \mboxES[p(X)]−\mboxEN(0,Σ)[p(X)]=K\mathop{\mbox{\bf E}}_{S}[p(X)]-\mathop{\mbox{\bf E}}_{\mathcal{N}(0,\Sigma)}[p(X)]=K. By (ε,δ)(\varepsilon,\delta)-goodness and Lemma 10, we have

Moreover, for some appropriate choice of β1\beta_{1}, we have

where (a), (b), follows from the definition of goodness, and (c) follows from standard Guassian concentration bounds. In particular, (10) and (11) together imply that

so since ∣μ′∣≤∥Σ−I∥F≤ξ|\mu^{\prime}|\leq\|\Sigma-I\|_{F}\leq\xi, we have

Also, by (ε,δ)(\varepsilon,\delta)-goodness and Lemma 10, we have

and, for AA as in Corollary 6, and β\beta appropriately chosen,

where (a) follows from goodness, and (b) follows from Corollary 6 and since ∥Σ−I∥F=o(1)\|\Sigma-I\|_{F}=o(1). Thus, (12), (13), (14), and (15) together imply that

and so since K≥Ω(εξ)K\geq\Omega\left(\sqrt{\varepsilon\xi}\right), this gives the desired bound. ∎