Faster Algorithms for High-Dimensional Robust Covariance Estimation

Yu Cheng, Ilias Diakonikolas, Rong Ge, David Woodruff

Introduction

In this paper, we study the outlier robust setting when a small constant fraction of our samples can be arbitrarily corrupted. We work in the following model of corruptions (see, e.g., [DKK+16]) that generalizes Huber’s contamination model ([Hub64]):

Recent work in TCS ([DKK+16, LRV16]) gave the first polynomial time robust estimators for a range of high-dimensional statistical tasks, including mean and covariance estimation. Since these initial papers ([DKK+16, LRV16]), a growing body of subsequent works have obtained polynomial-time robust learning algorithms for a variety of unsupervised and supervised high-dimensional models. (See Section 1.3 for more related work.)

It should be noted that the aforementioned robust estimators have already been useful in exploratory data analysis. Specifically, [DKK+17] evaluated the robust covariance estimators of [DKK+16] and [LRV16] to detect patterns in a well-known genetic dataset ([NJB+08]) in the presence of corruptions. Perhaps surprisingly, it was found that the robust algorithms developed for N(0,Σ)\mathcal{N}(\mathbf{0},\Sigma) outperformed all previous approaches on this real dataset, essentially matching the setting where there are no corruptions at all.

Once a polynomial-time algorithm for a computational problem has been discovered, the next step is to focus on designing asymptotically faster algorithms for the problem – with linear time as the ultimate goal. We note that the aforementioned robust estimators ([DKK+16, LRV16]) are significantly slower than their non-robust counterparts (e.g., computing the empirical mean/covariance), hence may not be scalable when the dimension is very high. This raises the following natural question:

Can we design robust estimators that are as efficient as their non-robust analogues?

This direction was initiated in [CDG19] who gave a robust mean estimation algorithm with runtime O~(Nd)/\poly(ϵ)\widetilde{O}(Nd)/\poly(\epsilon), The O~(⋅)\widetilde{O}(\cdot) notation hides logarithmic factors in its argument. nearly matching the runtime of computing the empirical mean (when ϵ\epsilon is constant).

For the sake of direct comparison, we note that the filtering-based robust covariance estimator of [DKK+16] has runtime Ω(N2d)=Ω(d5)/\poly(ϵ)\Omega(N^{2}d)=\Omega(d^{5})/\poly(\epsilon). On the other hand, the recursive dimension-halving estimator of [LRV16] requires Ω(log⁡d)\Omega(\log d) SVD computations of a d2×d2d^{2}\times d^{2} “covariance” matrix, hence has runtime Ω(d2ω)\Omega(d^{2\omega}), where ω\omega is the exponent of matrix multiplication. (Plugging in the best-known value for ω\omega ([Gal14]) gives a runtime of Ω(d4.74)\Omega(d^{4.74}).)

We note that the runtime of our algorithm, while being super-linear, essentially matches the best-known runtime to compute the empirical covariance matrix (see Section 6.1). Moreover, we provide evidence (Section 6.2) that this runtime may be a bottleneck even for the weaker task of obtaining an implicit representation to the output (by reweighing the input samples). It should be noted that all known computationally efficient robust estimators fit in this framework.

Our first algorithmic result states that we can robustly estimate the covariance matrix of a high-dimensional Gaussian within multiplicative, dimension-independent error, with running time that almost matches that of computing the empirical covariance matrix.

We also develop a related robust covariance estimation algorithm (Algorithm 3) with additive error guarantee, whose running time does not depend on the condition number of Σ\Sigma.

We will prove Theorem 1.2 in Section 3.1 and Theorem 1.3 in Appendix B.1.

In Section 6, we provide evidence that the runtime of our algorithm may be difficult to improve. Specifically, we show that the best-known runtime for computing (or even approximating) the empirical covariance is Ω(d3.25)\Omega(d^{3.25}). Moreover, even outputting a set of weights for the samples (such that the weighted empirical covariance works) seems to require Ω(d3.25)\Omega(d^{3.25}) time with current methods.

2 Our Approach and Techniques

Iterative Refinement.

The second difficulty is that existing robust mean estimation algorithms rely on the assumption that the distribution of the good data either has known covariance or unknown bounded covariance. By reducing covariance estimation to the mean estimation of X⊗XX\otimes X, we run into the difficulty that the covariance of such vectors would correspond to the fourth order moments of the original variables XX. So, directly applying the mean estimation algorithms does not give our desired strong guarantees.

We establish two guarantees for the robust estimation of the mean of ZZ. In the first phase, we only use the fact that the covariance of ZZ is bounded. Repeating this will give a rough estimation of the covariance of XX. In the second phase, we use the fact that the current estimate Σt\Sigma_{t} is already very close to Σ\Sigma, therefore Yi=Σt−1/2XiY_{i}=\Sigma_{t}^{-1/2}X_{i} is very close to a standard Gaussian N(0,I)N(0,I) for the good samples. In this case, we need to open up the algorithm in [CDG19] and prove stronger robust estimation guarantees tailored for the specific distribution of Z=Y⊗YZ=Y\otimes Y. Our main algorithm (Algorithm 1) combines these two refinement steps to match the best-known robustness guarantees for covariance estimation.

Evidence of Hardness.

A natural way of improving the running time of non-robust covariance estimation is to try to approximate the product XTXX^{T}X using oblivious sketching (see, e.g., [Woo14] for a survey) which works roughly as follows. One samples a random SS from a certain family of random matrices, and computes S⋅XS\cdot X where SS has much fewer than NN rows. For structured random families of matrices, like fast JL matrices, S⋅XS\cdot X can be computed very quickly. Then one instead computes XTSTSXX^{T}S^{T}SX with the guarantee that ∥XTSTSX−XTX∥F2\|X^{T}S^{T}SX-X^{T}X\|_{F}^{2} is small. Note that the matrix product (XTST)⋅(SX)(X^{T}S^{T})\cdot(SX) can be performed more quickly if SS has a small number of rows. Unfortunately, for the guarantees we want, all known constructions of SS require Ω(N)\Omega(N) rows. In fact, we prove an information-theoretic result that any oblivious sketching matrix SS must have Ω(N/log⁡N)\Omega(N/\log N) rows in Lemma 6.1, thus ruling out this approach for achieving faster running time. Our proof uses arguments from communication complexity, arguing that such a family of sketching matrices would imply a better protocol for solving multiple copies of the Gap-Hamming communication problem.

Another way of trying to improve the runtime is to give an alternative definition of the problem: Instead of outputting a d×dd\times d matrix that is close to Σ\Sigma, the algorithm outputs a set of nonnegative weights ww such that ∥w∥1=1\|w\|_{1}=1, ∥w∥∞≤1(1−ϵ)N\|w\|_{\infty}\leq\frac{1}{(1-\epsilon)N}, and ∥∑i=1NwiXiXiT−Σ∥F=O(1)\|\sum_{i=1}^{N}w_{i}X_{i}X_{i}^{T}-\Sigma\|_{F}=O(1). This bypasses the arguments above, since in the case of no corruption, we do not have to actually output XTXX^{T}X and can just set wi=1/Nw_{i}=1/N for all ii. However, even for this relaxed version of the problem, we show that unless one can solve a certain “column norm” distinguishing problem faster than rectangular matrix multiplication, one cannot solve this problem faster than (d,d2,d)(d,d^{2},d) matrix multiplication time. This problem can be intuitively stated as follows: the good samples are drawn from N(0,I)\mathcal{N}(0,I), and the corrupted samples are drawn from a mean-zero Gaussian distribution with a very slight and known perturbation to the identity covariance matrix. One needs to identify a large fraction of these corrupted samples. Even though the covariance of the perturbed Gaussians is known, it is so slight that the norms of the corrupted samples are very similar to the uncorrupted ones. Therefore, one needs to measure these norms along certain directions, which requires computing a matrix product of the samples with a worst-case covariance matrix. We show that outputting the weights described above requires solving this problem, which we conjecture to be hard.

3 Related and Prior Work

Learning in the presence of outliers is an important goal in statistics and has been studied in the robust statistics community since the 1960s ([Hub64]). After several decades of work, a number of sample-efficient and robust estimators have been discovered. The reader is referred to ([DKK+16, LRV16]) for a detailed summary of this line of work. Until recently, all known computationally efficient high-dimensional estimators could only tolerate a negligible fraction of outliers. Recent work ([DKK+16, LRV16]) gave the first efficient robust estimators for basic high-dimensional unsupervised tasks. Since these works, there has been a flurry of research activity on robust learning algorithms in both supervised and unsupervised settings ([BDLS17, CSV17, DKK+17, DKS17, DKK+18, SCV18, DKS18b, DKS18a, HL18, KSS18, PSBR18, DKK+19, KKM18, DKS19, LSLC18, CDKS18]).

The most relevant prior work is that of [CDG19], initiating the direction of obtaining fast algorithms for robust high-dimensional estimation. For the problem of robust mean estimation, [CDG19] proposed a primal-dual approach – building on the convex programming approach of [DKK+16] – yielding an algorithm with runtime O~(Nd)/\poly(ϵ)\widetilde{O}(Nd)/\poly(\epsilon). This improved on the O~(Nd2)\widetilde{O}(Nd^{2}) runtime of the iterative filtering method in [DKK+16]. Our algorithm uses the same primal-dual framework; however, we emphasize that a standard application of their framework would only lead to a runtime of O~(Nd2)/\poly(ϵ)\widetilde{O}(Nd^{2})/\poly(\epsilon). To obtain our improved runtime, we need to overcome a number of technical obstacles, as we explained in Section 1.2.

Preliminaries

Connections Between the Second and Fourth Moments of a Gaussian.

Fast Rectangular Matrix Multiplication.

We will frequently use fast rectangular matrix multiplication in our algorithms. Let (a,b,c)(a,b,c)-matrix multiplication time denote the time it takes to multiply an a×ba\times b matrix with a b×cb\times c matrix. It is forklore (see, e.g., [LR83]) that (a,a,b)(a,a,b), (a,b,a)(a,b,a), and (b,a,a)(b,a,a) matrix multiplications require the same number of arithmetic operations. More specifically, we use the algorithm proposed in [Gal12]. They obtained new upper bounds on (n,nα,n)(n,n^{\alpha},n) matrix multiplication time. We use a special case of their result (α=2\alpha=2).

We can compute (n,n2,n)(n,n^{2},n)-matrix multiplication in time O(n3.26)O(n^{3.26}). This implies that for d>0d>0 and N=O~(d2/ϵ2)N=\widetilde{O}(d^{2}/\epsilon^{2}), we can multiply a d×Nd\times N matrix with an N×dN\times d matrix in time O~(d3.26/ϵ2)\widetilde{O}(d^{3.26}/\epsilon^{2}).

To multiply a d×Nd\times N matrix with an N×dN\times d matrix when N=O~(d2/ϵ2)N=\widetilde{O}(d^{2}/\epsilon^{2}), we split the matrices into blocks of size d×d2d\times d^{2} or d2×dd^{2}\times d, multiply each pair of matrices and then add the results together. The total running time is Nd2⋅O(d3.26+d2)=O~(d3.26/ϵ2)\frac{N}{d^{2}}\cdot O(d^{3.26}+d^{2})=\widetilde{O}(d^{3.26}/\epsilon^{2}).

Transposition Principle for Matrix-Vector Multiplication.

The transposition principle (see, e.g., [Bor57, Fid73]) plays a central role in our faster implementation of positive SDP solvers. It states that matrix-vector multiplication by A⊤A^{\top} has almost exactly the same computational complexity as matrix-vector multiplication by AA.

Estimating the Covariance of a Gaussian Distribution

In this section, we present our key structural and computational lemmas, and use them to prove our main algorithmic results (Theorems 1.2 and 1.3).

We first present our algorithm (Algorithm 1) for robustly estimating the covariance of Gaussian distributions with multiplicative error guarantees. Algorithm 1 starts with an upper bound Σ0\Sigma_{0} on the true covariance matrix Σ\Sigma, and iteratively compute more and more accurate upper bounds Σt⪰Σ\Sigma_{t}\succeq\Sigma.

First we need a reasonable starting point before we can run any iterative refinement steps.

Consider the same setting as in Theorem 1.2. We can compute a matrix Σ0\Sigma_{0} in O~(d3.26/ϵ2)\widetilde{O}(d^{3.26}/\epsilon^{2}) time such that, with high probability, Σ⪯Σ0⪯(κ\poly(d))Σ\Sigma\preceq\Sigma_{0}\preceq(\kappa\poly(d))\Sigma and ∥Σ0∥2≤\poly(d)∥Σ∥2\left\|\Sigma_{0}\right\|_{2}\leq\poly(d)\left\|\Sigma\right\|_{2}.

We use two different iterative refinement steps (Lemmas 3.2 and 3.3), which correspond to the two loops in Algorithm 1. In the first phase (Lemma 3.2), we only have a crude upper bound on Σ\Sigma.

The first phase can only converge to a matrix ΣT1\Sigma_{T_{1}} with Σ⪯ΣT1⪯(1+O(ϵ)Σ\Sigma\preceq\Sigma_{T_{1}}\preceq(1+O(\sqrt{\epsilon})\Sigma. In the second phase (Lemma 3.3), we already have a fairly accurate estimate of Σ\Sigma, so the refinement steps converge faster and eventually we can get to a matrix ΣT2\Sigma_{T_{2}} with Σ⪯ΣT2⪯(1+O(ϵlog⁡(1/ϵ))Σ\Sigma\preceq\Sigma_{T_{2}}\preceq(1+O(\epsilon\log(1/\epsilon))\Sigma.

Consider the same setting as in Theorem 1.2. Let 0<τt<τ00<\tau_{t}<\tau_{0} for some universal constant τ0\tau_{0}. Given τ\tau and Σt\Sigma_{t} with Σ⪯Σt⪯(1+τt)Σ\Sigma\preceq\Sigma_{t}\preceq(1+\tau_{t})\Sigma, we can compute in time O~(d3.26/ϵ8)\widetilde{O}(d^{3.26}/\epsilon^{8}) an upper bound matrix Σt+1\Sigma_{t+1} and a hypothesis matrix Σ^\widehat{\Sigma} such that, with high probability, for τt+1=O(ϵτ+ϵlog⁡(1/ϵ))\tau_{t+1}=O(\sqrt{\epsilon\tau}+\epsilon\log(1/\epsilon)),

We defer the proof of Lemma 3.1 to Appendix B, and the proofs of Lemmas 3.2 and 3.3 to Section 3.2. We first use these three lemmas to prove Theorem 1.2 (correctness and runtime of Algorithm 1).

For any integer t≥0t\geq 0, given the upper bound matrix Σt\Sigma_{t}, we can use Lemma 3.2 to obtain a better upper bound Σt+1\Sigma_{t+1} such that Σt+1⪯Σ+O(ϵ)Σt\Sigma_{t+1}\preceq\Sigma+O(\sqrt{\epsilon})\Sigma_{t}. Since Σ0⪯κ\poly(d)Σ\Sigma_{0}\preceq\kappa\poly(d)\Sigma, after T1=O(log⁡κ+log⁡d)T_{1}=O(\log\kappa+\log d) iterations, we have a matrix ΣT1\Sigma_{T_{1}} with Σ⪯ΣT1⪯(1+O(ϵ))Σ\Sigma\preceq\Sigma_{T_{1}}\preceq\left(1+O(\sqrt{\epsilon})\right)\Sigma.

At this point we have a pretty accurate upper bound ΣT1\Sigma_{T_{1}} with Σ⪯ΣT1⪯(1+τT1)Σ\Sigma\preceq\Sigma_{T_{1}}\preceq(1+\tau_{T_{1}})\Sigma, where τT1=O(ϵ)\tau_{T_{1}}=O(\sqrt{\epsilon}). For any integer t≥T1t\geq T_{1}, given Σt\Sigma_{t} and τt\tau_{t}, we can use Lemma 3.3 to obtain a better upper bound matrix Σt+1\Sigma_{t+1} such that Σ⪯Σt+1⪯Σ+τt+1Σt\Sigma\preceq\Sigma_{t+1}\preceq\Sigma+\tau_{t+1}\Sigma_{t}, where τt+1=O(ϵτt+ϵlog⁡(1/ϵ))\tau_{t+1}=O(\sqrt{\epsilon\tau_{t}}+\epsilon\log(1/\epsilon)). Similar to the previous step, after O(log⁡log⁡(1/ϵ))O(\log\log(1/\epsilon)) iterations, we have a matrix ΣT2\Sigma_{T_{2}} such that Σ⪯ΣT2⪯(1+τT2)Σ\Sigma\preceq\Sigma_{T_{2}}\preceq(1+\tau_{T_{2}})\Sigma, where τT2=O(ϵlog⁡(1/ϵ))\tau_{T_{2}}=O(\epsilon\log(1/\epsilon)).

Finally, using Lemma 3.3 one more time with ΣT2\Sigma_{T_{2}} and τT2\tau_{T_{2}}, we can get a matrix Σ^\widehat{\Sigma} with

We note that both Lemmas 3.2 and 3.3 hold with high probability, so we can take a union bound over the failure probabilities and conclude that with high probability all iterative refinement steps are successful, and therefore, we can return Σ^\widehat{\Sigma} as our final answer.

Now we analyze the running time of Algorithm 1. We call Lemma 3.1 once to compute Σ0\Sigma_{0}, which takes time O~(d3.26/ϵ2)\widetilde{O}(d^{3.26}/\epsilon^{2}). After that, we use two iterative refinement steps. The total number of iterations is O(log⁡κ+log⁡d+log⁡log⁡(1/ϵ))O(\log\kappa+\log d+\log\log(1/\epsilon)). In each iteration, we invoke either Lemma 3.2 or 3.3. Since both lemmas run in time O~(d3.26/ϵ8)\widetilde{O}(d^{3.26}/\epsilon^{8}), the overall running time is O~(d3.26/ϵ2)+O(log⁡κ+log⁡d+log⁡log⁡(1/ϵ))⋅O~(d3.26/ϵ8)=O~(d3.26/ϵ8)\widetilde{O}(d^{3.26}/\epsilon^{2})+O(\log\kappa+\log d+\log\log(1/\epsilon))\cdot\widetilde{O}(d^{3.26}/\epsilon^{8})=\widetilde{O}(d^{3.26}/\epsilon^{8}). ∎

2 Implementing the Iterative Refinement Steps

In the first phase (Lemma 3.2), we only have a crude upper bound on Σ\Sigma. For any Σt⪰Σ\Sigma_{t}\succeq\Sigma, we have ΣY=Σt−1/2ΣΣt−1/2⪯I\Sigma_{Y}=\Sigma_{t}^{-1/2}\Sigma\Sigma_{t}^{-1/2}\preceq I, which implies ΣZ⪯2I\Sigma_{Z}\preceq 2I (Lemma 2.1). Because ZZ has bounded covariance, we can use the following robust mean estimation algorithm from [CDG19].

In the second phase (Lemma 3.3), we use the fact that the current estimate Σt\Sigma_{t} is already very close to Σ\Sigma, therefore Y=Σt−1/2XY=\Sigma_{t}^{-1/2}X is very close to N(0,I)\mathcal{N}(0,I). In this case we need an algorithm with stronger robust estimation guarantees tailored for the specific distribution of Z=Y⊗YZ=Y\otimes Y.

It is worth noting that we cannot use these mean estimation algorithms in a black-box manner. This is because writing down the input explicitly takes Ω(Nd2)=Ω~(d4/ϵ2)\Omega(Nd^{2})=\widetilde{\Omega}(d^{4}/\epsilon^{2}) time, and these algorithms run in time Ω~(Nd2)/\poly(ϵ)\widetilde{\Omega}(Nd^{2})/\poly(\epsilon) in d2d^{2} dimensions. One of our main contributions is to show that it is possible to open up these algorithms and take advantage of the additional structures of our inputs (they all have the form Yi⊗YiY_{i}\otimes Y_{i}) to implement both algorithms to run in time O~(d3.26)/\poly(ϵ)\widetilde{O}(d^{3.26})/\poly(\epsilon).

We give a description of the algorithm for Lemma 3.4 in Appendix B.2 (Algorithm 5). We prove Lemma 3.5 and present the corresponding algorithm (Algorithm 2) in Section 4. In Section 5, we show that both algorithms can be implemented to run in time O~(d3.26)/\poly(ϵ)\widetilde{O}(d^{3.26})/\poly(\epsilon) (Proposition 3.6). We first use Lemmas 3.4, 3.5, and Proposition 3.6 to prove the iterative refinement lemmas.

Given an upper bound Σt\Sigma_{t} on the true covariance matrix, we can rotate the input samples to compute Yi=Σt−1/2XiY_{i}=\Sigma_{t}^{-1/2}X_{i}. Let Zi=Yi⊗YiZ_{i}=Y_{i}\otimes Y_{i}. Note that when X∼N(0,Σ)X\sim\mathcal{N}(0,\Sigma), the random variable Y=Σt−1/2XY=\Sigma_{t}^{-1/2}X is drawn from a Gaussian distribution with covariance ΣY=Σt−1/2ΣΣt−1/2⪯I\Sigma_{Y}=\Sigma_{t}^{-1/2}\Sigma\Sigma_{t}^{-1/2}\preceq I. Lemma 2.1 implies that, if ΣY⪯I\Sigma_{Y}\preceq I, then ΣZ⪯2I\Sigma_{Z}\preceq 2I. Therefore, (Zi)i=1N(Z_{i})_{i=1}^{N} is an ϵ\epsilon-corrupted set of samples drawn from a distribution with bounded covariance, so we can apply Algorithm 5 to robustly estimate its mean.

Let Σ^=Σt1/2MΣt1/2\widehat{\Sigma}=\Sigma_{t}^{1/2}M\Sigma_{t}^{1/2}. Using ∥AB∥F≤∥A∥2∥B∥F{\left\|AB\right\|}_{F}\leq\left\|A\right\|_{2}{\left\|B\right\|}_{F}, we can prove the first part of the lemma,

As a result, we have that −O(ϵ)I⪯Σt−1/2(Σ^−Σ)Σt−1/2⪯O(ϵ)I-O(\sqrt{\epsilon})I\preceq\Sigma_{t}^{-1/2}(\widehat{\Sigma}-\Sigma)\Sigma_{t}^{-1/2}\preceq O(\sqrt{\epsilon})I, or equivalently

Now Σt+1=Σ^+O(ϵ)Σt\Sigma_{t+1}=\widehat{\Sigma}+O(\sqrt{\epsilon})\Sigma_{t} is a better upper bound, which satisfies Σ⪯Σt+1⪯Σ+O(ϵ)Σt\Sigma\preceq\Sigma_{t+1}\preceq\Sigma+O(\sqrt{\epsilon})\Sigma_{t}.

Since all the ZiZ_{i}’s have the form Yi⊗YiY_{i}\otimes Y_{i}, Proposition 3.6 shows that Algorithms 5 has running time O~(d3.26/ϵ8)\widetilde{O}(d^{3.26}/\epsilon^{8}). Given the output of Algorithms 5, we can compute the new upper bound Σt+1\Sigma_{t+1} in time O(dω)O(d^{\omega}) using a constant number of d×dd\times d matrix additions and multiplications. ∎

Let Yi=Σt−1/2XiY_{i}=\Sigma_{t}^{-1/2}X_{i} and Zi=Yi⊗YiZ_{i}=Y_{i}\otimes Y_{i}. We know that

By Lemma 2.1, we have ∥ΣZ−2I∥2≤O(τ)\left\|\Sigma_{Z}-2I\right\|_{2}\leq O(\tau). By standard concentration results, Z=Y⊗YZ=Y\otimes Y has exponential concentration about its mean in any direction. Therefore, (Zi)i=1N(Z_{i})_{i=1}^{N} is an ϵ\epsilon-corrupted set of samples drawn from a distribution that satisfies the conditions in Lemma 3.5, and we can apply Algorithm 2 to robustly learn the mean of ZZ. By Lemma 3.5, we can compute a matrix MM such that

Let Σ^=Σt1/2MΣt1/2\widehat{\Sigma}=\Sigma_{t}^{1/2}M\Sigma_{t}^{1/2}. Using ∥AB∥F≤∥A∥2∥B∥F{\left\|AB\right\|}_{F}\leq\left\|A\right\|_{2}{\left\|B\right\|}_{F}, we can prove the first part of the lemma,

This gives a better upper bound Σt+1=Σ^+O(ϵτ+ϵlog⁡(1/ϵ))Σt\Sigma_{t+1}=\widehat{\Sigma}+O(\sqrt{\epsilon\tau}+\epsilon\log(1/\epsilon))\Sigma_{t} such that Σ⪯Σt+1⪯Σ+O(ϵτ+ϵlog⁡(1/ϵ))Σt\Sigma\preceq\Sigma_{t+1}\preceq\Sigma+O(\sqrt{\epsilon\tau}+\epsilon\log(1/\epsilon))\Sigma_{t}.

We omit the running time analysis because it is identical to the one in the previous proof. ∎

Robust Mean Estimation Subroutines

We first present the robust mean estimation algorithm (Algorithm 2) that achieves Lemma 3.5.

There are two obstacles for applying the algorithmic framework of [CDG19] to our setting. First, the input samples Zi=Xi⊗XiZ_{i}=X_{i}\otimes X_{i}’s are d2d^{2}-dimensional vectors. Writing down these vectors explicitly takes time Ω(Nd2)=Ω(d4)\Omega(Nd^{2})=\Omega(d^{4}). Therefore, we want to solve the SDPs (1) and (2) on input ZiZ_{i} without computing them explicitly. We resolve this issue in Section 5 (Proposition 3.6).

Second, their algorithms have error O(ϵ)O(\sqrt{\epsilon}) for bounded-covariance distributions, and error O(ϵlog⁡(1/ϵ))O(\epsilon\sqrt{\log(1/\epsilon)}) for sub-gaussian distributions with identity covariance matrix. While we can directly use their result for bounded-covariance distributions for Lemma 3.4, we need to develop a new algorithm for Lemma 3.5. In Lemma 3.5, we have a distribution with exponential decaying tails, and we know its covariance is τ\tau-close to the identity matrix. We want to robustly estimate its mean, with optimal error guarantees that depend on both ϵ\epsilon and τ\tau. We generalize the analysis of [CDG19] to handle this case. Lemma 3.5 is proved in Appendix B.3.

Faster Implementation of Robust Mean Estimation with Tensor Inputs

The bottleneck of both Algorithms 5 and 2 are solving SDPs (1) and (2). In this section, we prove Proposition 3.6, which states that when all input samples have the tensor-product form Y⊗YY\otimes Y, we can solve these SDPs in time O~(d3.26)/\poly(ϵ)\widetilde{O}(d^{3.26})/\poly(\epsilon).

We first convert the SDPs (1) and (2) into packing/covering SDPs as follows.

Here ρ\rho is a binary search parameter that is between 1d\frac{1}{d} and 11. At the core of nearly-linear time width-independent SDP solvers (e.g., [ALO16, PTZ16]) is an application of matrix multiplicative weight update, where the algorithm maintains a weighted sum Ψ\Psi of the matrices. In iteration tt, we have Ψt=∑i=1nwiAi\Psi^{t}=\sum_{i=1}^{n}w_{i}A_{i}, and we will update the weights based on the values of Ai∙exp⁡(Ψt)\tr(exp⁡(Ψt))A_{i}\bullet\frac{\exp(\Psi^{t})}{\tr(\exp(\Psi^{t}))}.

Let A1,…,AnA_{1},\ldots,A_{n} be m×mm\times m PSD matrices given in factorized form Ai=CiCi⊤A_{i}=C_{i}C_{i}^{\top}. Consider the following pair of packing and covering SDPs:

We will approximate each exp⁡(Ψ)∙Ai\exp(\Psi)\bullet A_{i} and \tr(exp⁡(Ψ))\tr(\exp(\Psi)) separately. Observe that Ψ=∑i=1nwiAi\Psi=\sum_{i=1}^{n}w_{i}A_{i} and exp⁡(Ψ)\exp(\Psi) have the same block structure as the AiA_{i}’s. Due to the special structure of the bottom-right block, we can compute its contribution to \tr(exp⁡(Ψ))\tr(\exp(\Psi)) and exp⁡(Ψ)∙Ai\exp(\Psi)\bullet A_{i} exactly. Therefore, we can focus on the top-left block. Moreover, because the goal is to compute a multiplicative approximation of the top-left block’s contribution to \tr(exp⁡(Ψ))\tr(\exp(\Psi)) and exp⁡(Ψ)∙Ai\exp(\Psi)\bullet A_{i}, we can ignore the scalar ρ\rho. We prove the following lemma.

(Z−ν1⊤)s=Zs−(1⊤s)ν(Z-\nu{\bf 1}^{\top})s=Zs-({\bf 1}^{\top}s)\nu and we can compute Zs=(YDsY⊤)♭Zs=\left(YD_{s}Y^{\top}\right)^{\flat} via fast rectangular matrix multiplication (Lemma 2.2),

matrix-vector multiplication with (Z−ν1⊤)(Z-\nu{\bf 1}^{\top}) or (Z−ν1⊤)⊤(Z-\nu{\bf 1}^{\top})^{\top} has the same running time by the Transposition Principle (Lemma 2.3 in Section 2)), and

multiplication with a diagonal matrix DwD_{w} can be done in time O(N)O(N).

We approximate exp⁡(Ψ)∙(Zi−ν)(Zi−ν)⊤\exp(\Psi)\bullet(Z_{i}-\nu)(Z_{i}-\nu)^{\top} using a similar approach: exp⁡(Ψ)∙(Zi−ν)(Zi−ν)⊤=∥exp⁡(Ψ/2)(Zi−ν)∥22≈ϵ/4∥M(Zi−ν)∥22≈ϵ/4∥QM(Zi−ν)∥22\exp(\Psi)\bullet(Z_{i}-\nu)(Z_{i}-\nu)^{\top}=\left\|\exp(\Psi/2)(Z_{i}-\nu)\right\|_{2}^{2}\approx_{\epsilon/4}\left\|M(Z_{i}-\nu)\right\|_{2}^{2}\approx_{\epsilon/4}\left\|QM(Z_{i}-\nu)\right\|_{2}^{2}. Notice that the last line is precisely the squared norm of the ii-th column of QM(Z−ν1⊤)QM(Z-\nu{\bf 1}^{\top}). For the same reasons as in the previous case, we can compute this matrix in time O~(d3.26/ϵ5)\widetilde{O}(d^{3.26}/\epsilon^{5}). ∎

We can approximate exp⁡(A)\exp(A) with a matrix polynomial of AA, whose degree depends on the spectral norm of AA and the desired precision (see, e.g., [AK16]).

By Lemma 5.1, we only need to show that the required oracle algorithm can be implemented in time O~(d3.26/ϵ5)\widetilde{O}(d^{3.26}/\epsilon^{5}). We approximate \tr(exp⁡(Ψ))\tr(\exp(\Psi)) and each exp⁡(Ψ)∙Ai\exp(\Psi)\bullet A_{i} separately. Given Ψ=∑i=1NwiAi\Psi=\sum_{i=1}^{N}w_{i}A_{i}, we will compute the contribution from bottom-right block explicitly, and use Lemma 5.2 for the top-left block. The bottom-right block adds ∑i=1Nexp⁡(wi(1−ϵ)N)\sum_{i=1}^{N}\exp(w_{i}(1-\epsilon)N) to \tr(exp⁡(Ψ))\tr(\exp(\Psi)), and for every ii, it adds wiexp⁡(wi(1−ϵ)N)w_{i}\exp(w_{i}(1-\epsilon)N) to exp⁡(Ψ)∙Ai\exp(\Psi)\bullet A_{i}. ∎

Evidence of Hardness

In this section, we provide some evidence which suggests that the running time of our algorithm has near-optimal dependence on dd. We start by noting that our sample complexity N=Ω~(d2/ϵ2)N=\widetilde{\Omega}(d^{2}/\epsilon^{2}) is tight up to polylogarithmic factors, and this holds even when there is no corruption. For the rest of this section, we will assume both ϵ\epsilon and κ\kappa are constants, and focus on the dependence on dd in the running time. Since the running time of our algorithm is dominated by (d,d2,d)(d,d^{2},d)-matrix multiplication time, faster matrix multiplication algorithms time will improve our running time.

In Section 6.1, we show that even when there are no corrupted samples, it is not known how to compute the empirical covariance matrix faster than (d,d2,d)(d,d^{2},d)-matrix multiplication time. We give a communication complexity lower bound that rules out all oblivious matrix sketching approaches.

In Section 6.2, to circumvent the difficulty raised in Section 6.1, we consider a weaker problem where the algorithm only need to find a set of good weights (instead of a d×dd\times d matrix). We give a reduction to show that this problem is still at least as hard as some basic matrix computation question, which we do not know how to solve faster than (d,d2,d)(d,d^{2},d)-matrix multiplication time.

Our algorithm matches the running time of the best non-robust covariance estimation algorithm. When there are no corrupted samples and N=Ω~(d2/ϵ2)N=\widetilde{\Omega}(d^{2}/\epsilon^{2}), with high probability, the empirical second-moment matrix 1N∑i=1NXiXi⊤\frac{1}{N}\sum_{i=1}^{N}X_{i}X_{i}^{\top} is ϵ\epsilon-close to the true covariance matrix in Frobenius norm. However, it is not known how to (approximately) compute this empirical second-moment matrix faster than (d,d2,d)(d,d^{2},d) matrix multiplication time.

For approximate matrix product of an N×dN\times d matrix AA with ∥A∥2=O(1)\left\|A\right\|_{2}=O(1), we want to choose a sketching matrix SS so that ∥A⊤S⊤SA−A⊤A∥F2=O(1){\left\|A^{\top}S^{\top}SA-A^{\top}A\right\|}_{F}^{2}=O(1). Known results for approximate matrix product state that if SS has ss rows, then ∥A⊤S⊤SA−A⊤A∥F2=O(∥A∥F4s){\left\|A^{\top}S^{\top}SA-A^{\top}A\right\|}_{F}^{2}=O\left(\frac{{\left\|A\right\|}_{F}^{4}}{s}\right) with probability at least 9/109/10, see, e.g., Section 2.2 of [Woo14] for a survey. In the context of Problem 1, letting A=1NXA=\frac{1}{\sqrt{N}}X, we have ∥A∥2=O(1)\left\|A\right\|_{2}=O(1) and ∥A∥F4=O(d2){\left\|A\right\|}_{F}^{4}=O(d^{2}). The error is then O(d2/s)O(d^{2}/s), and consequently SS must have s=Ω(d2)s=\Omega(d^{2}) rows for the error to be at most O(1)O(1).

We can show that the argument above is almost tight for all oblivious sketches.

Let N=d2N=d^{2}. There is no distribution over t×Nt\times N matrices SS, oblivious to the underlying input N×dN\times d matrix AA, where t=o(d2/log⁡d)t=o(d^{2}/\log d), such that with probability at least 2/32/3, it holds that ∥A⊤S⊤SA−A⊤A∥F2≤C1∥A∥F4d2\|A^{\top}S^{\top}SA-A^{\top}A\|_{F}^{2}\leq C_{1}\frac{\|A\|_{F}^{4}}{d^{2}}, where C1=4⋅25⋅20002C_{1}=4\cdot 25\cdot 2000^{2} is a positive constant.

Suppose, to the contrary, there were such a distribution on matrices SS satisfying t=o(d2/log⁡d)t=o(d^{2}/\log d).

For N=d2N=d^{2}, consider a uniformly random N×dN\times d matrix A∈{−1d,1d}N×dA\in\{-\frac{1}{d},\frac{1}{d}\}^{N\times d}. Then ∥A∥F2=d\|A\|_{F}^{2}=d, and so for a random matrix SS from our family and a random input AA from this family of inputs, it holds that with probability at least 23\frac{2}{3}, ∥A⊤S⊤SA−A⊤A∥F2≤C1∥A∥F4d2=C1\|A^{\top}S^{\top}SA-A^{\top}A\|_{F}^{2}\leq C_{1}\frac{\|A\|_{F}^{4}}{d^{2}}=C_{1}. By anti-concentration of the binomial distribution, with probability at least 99100\frac{99}{100}, at least a 99100\frac{99}{100}-fraction of the off-diagonal entries of A⊤AA^{\top}A have absolute value at least 11000d\frac{1}{1000d}.

Consequently, for at least a 2425\frac{24}{25}-fraction of the entries in the bottom left d2×d2\frac{d}{2}\times\frac{d}{2} submatrix of A⊤AA^{\top}A, we have the property that the entry has the same sign as in A⊤S⊤SAA^{\top}S^{\top}SA, and also the entries in A⊤S⊤SAA^{\top}S^{\top}SA are at least 12000d\frac{1}{2000d}. Indeed, otherwise we would have ∥A⊤S⊤SA−A⊤A∥F2>(d2)2⋅125⋅(11000d−12000d)2>C1\|A^{\top}S^{\top}SA-A^{\top}A\|_{F}^{2}>(\frac{d}{2})^{2}\cdot\frac{1}{25}\cdot(\frac{1}{1000d}-\frac{1}{2000d})^{2}>C_{1} with probability at least 99100\frac{99}{100} over the choice of AA and SS, and in particular there exists a fixed AA for which this holds with probability at least 99100\frac{99}{100} over the choice of SS, contradicting our assumption on the family of matrices SS.

Now consider the following two-player communication game with public shared randomness. Alice has the first d2\frac{d}{2} columns of AA, denoted AL∈{−1,1}N×d/2A_{L}\in\{-1,1\}^{N\times d/2} while Bob has the remaining d2\frac{d}{2} columns of AA, denoted AR∈{−1,1}N×d/2A_{R}\in\{-1,1\}^{N\times d/2}. The entries in the in the bottom left d2×d2\frac{d}{2}\times\frac{d}{2} submatrix of A⊤AA^{\top}A are exactly the inner products between all columns of Alice and all columns of Bob. Suppose there were such a family of matrices SS as described above. Alice and Bob use the public coin to agree upon SS with no communication. Alice then computes S⋅ALS\cdot A_{L}, and rounds each entry to the nearest power of (1+1\poly(d))(1+\frac{1}{\poly(d)}). Note all entries of S⋅ALS\cdot A_{L} need to be at most \poly(d)\poly(d) and rounding preserves ∥A⊤S⊤SA−A⊤A∥F2\|A^{\top}S^{\top}SA-A^{\top}A\|_{F}^{2} up to additive 1\poly(d)\frac{1}{\poly(d)}. Therefore, we maintain the property that, at least a 2425\frac{24}{25}-fraction of the entries in the bottom left d2×d2\frac{d}{2}\times\frac{d}{2} submatrix of A⊤AA^{\top}A have the same signs in A⊤AA^{\top}A and A⊤S⊤SAA^{\top}S^{\top}SA. Alice sends each of the rounded entries of S⋅ALS\cdot A_{L}, which is Θ(tdlog⁡d)=o(d3)\Theta(td\log d)=o(d^{3}) bits. Bob then computes S⋅ARS\cdot A_{R} and thus forms S⋅AS\cdot A, from which he can compute A⊤S⊤SAA^{\top}S^{\top}SA. At this point, Bob can recover the sign of a uniformly random entry in the bottom left d/2×d/2d/2\times d/2 submatrix of A⊤AA^{\top}A with probability at least 2/3−1/25−1/100>3/52/3-1/25-1/100>3/5.

Notice that the sign of such an entry is the same as solving the Gap-Hamming communication problem under the uniform distribution: in this communication problem there are two players, Alice and Bob, who hold uniformly random vectors x,y∈{−1,1}Nx,y\in\{-1,1\}^{N}, respectively, and wish to decide if ⟨x,y⟩>0\langle x,y\rangle>0 or ⟨x,y⟩<0\langle x,y\rangle<0. This problem requires Ω(N)\Omega(N) randomized communication complexity [CR12]. Moreover, as shown by Braverman et al. [BGPW16], the information complexity of this problem is I=Ω(N)\mathcal{I}=\Omega(N) bits. In our setting, we can think of Alice as having d2\frac{d}{2} independent instances x1,…,xd/2x^{1},\ldots,x^{d/2}, and Bob having an index i∈{1,2,…,d2}i\in\{1,2,\ldots,\frac{d}{2}\} as well as a vector yy and Bob wants to solve the Gap-Hamming problem on the pair (xi,y)(x^{i},y). However, only Alice is allowed to speak, and she sends a single message to Bob, without knowing ii. By standard direct sum arguments in communication complexity [BR11] (see also [PSW14] where Gap-Hamming composed with the Index problem was used), the randomized one-way communication complexity of this problem is Ω(d⋅I)=Ω(d3)\Omega(d\cdot\mathcal{I})=\Omega(d^{3}) bits. However, the communication cost of our protocol is Θ(tdlog⁡d)=o(d3)\Theta(td\log d)=o(d^{3}) bits, which is a contradiction. Consequently, we must have t=Ω(d2/log⁡d)t=\Omega(d^{2}/\log d), as desired. ∎

It is worth noting that this lower bound holds for any possible algorithm one can run on SASA (i.e., the algorithm can do more than just computing A⊤S⊤SAA^{\top}S^{\top}SA), so it is a stronger information-theoretic statement.

2 Finding Good Weights

To circumvent the difficulty of Problem 1, we could redefine our problem so that the algorithm does not need to output a d×dd\times d matrix, instead it outputs a set of good weights ww such that ∥∑i=1NwiXiXi⊤−Σ∥F=O(ϵ)\|\sum_{i=1}^{N}w_{i}X_{i}X_{i}^{\top}-\Sigma\|_{F}=O(\sqrt{\epsilon}). We will show that, even for this weaker problem of finding good weights, one still need to come up with faster algorithms for a basic matrix problem.

Consider the following instance. Let UU be an arbitrary d×d2d\times\frac{d}{2} matrix with orthonormal columns. Let the good distribution be D=N(0,Σ=I)D=\mathcal{N}(0,\Sigma=I), and the noise distribution D′D^{\prime} is defined as

We draw (1−ϵ)N(1-\epsilon)N samples from DD and ϵN\epsilon N samples from D′D^{\prime}. The empirical covariance matrix of the mixed distribution is Σ^=(1−ϵ)Σ+ϵΣ′=(1−cd+1/ϵ)I+(2cd+1/ϵ)UU⊤\widehat{\Sigma}=(1-\epsilon)\Sigma+\epsilon\Sigma^{\prime}=\left(1-\frac{c}{\sqrt{d}+1/\epsilon}\right)I+\left(\frac{2c}{\sqrt{d}+1/\epsilon}\right)UU^{\top}. Observe that ∥Σ^−Σ∥F2=d(cd+1/ϵ)2=Ω(1){\left\|\widehat{\Sigma}-\Sigma\right\|}_{F}^{2}=d\left(\frac{c}{\sqrt{d}+1/\epsilon}\right)^{2}=\Omega(1), so the bad samples are distorting the empirical covariance matrix by more than we could tolerate.

Therefore, a natural way of distinguishing them is to compute U⊤XU^{\top}X, which requires (d,d2,d)(d,d^{2},d)-matrix multiplication time. We could compute the column norms of SU⊤ASU^{\top}A, where SS is a Johnson-Lindenstrauss matrix. However, SS must have 1ϵ2\frac{1}{\epsilon^{2}} rows to obtain (1+ϵ)(1+\epsilon)-approximation, and therefore SS must have Ω~(d2)\widetilde{\Omega}(d^{2}) rows. Even if one uses a sparse matrix SS, one has that SU⊤SU^{\top} is a dense matrix, and it is unclear how to compute SU⊤ASU^{\top}A quickly.

Consider the same setting as in Problem 2. Given a set of weights ww such that ∥w∥1=1\left\|w\right\|_{1}=1, ∥w∥∞≤1(1−ϵ)N\left\|w\right\|_{\infty}\leq\frac{1}{(1-\epsilon)N}, and ∥∑i=1NwiXiXi⊤−I∥F=O(1)\|\sum_{i=1}^{N}w_{i}X_{i}X_{i}^{\top}-I\|_{F}=O(1), we can solve Problem 2 in O(N)O(N) time.

For the rest of proof we assume the samples meet these conditions.

Let Σw=∑i=1NwiXiXi⊤\Sigma_{w}=\sum_{i=1}^{N}w_{i}X_{i}X_{i}^{\top}. Let wGw_{G} and wBw_{B} denote the total weights on GG and BB respectively. Since ∥Σw−I∥F=O(1){\left\|\Sigma_{w}-I\right\|}_{F}=O(1), by Cauchy-Schwarz,

Putting these two inequalities together, we get that wB≤ϵ4w_{B}\leq\frac{\epsilon}{4}. In other words, the average weight of a bad sample is 14N\frac{1}{4N}.

Let S={i∈[N]:wi≤12N}S=\{i\in[N]:w_{i}\leq\frac{1}{2N}\}. By Markov’s inequality, we have ∣S∩B∣≥∣B∣2|S\cap B|\geq\frac{|B|}{2}. Since ∥w∥∞≤1(1−ϵ)N\left\|w\right\|_{\infty}\leq\frac{1}{(1-\epsilon)N} and wG=∥w∥1−wB≥1−ϵ4w_{G}=\left\|w\right\|_{1}-w_{B}\geq 1-\frac{\epsilon}{4}, again by Markov’s inequality, we get that ∣S∩G∣≤ϵN|S\cap G|\leq\epsilon N and hence ∣S∣≤∣B∣+ϵN=2ϵN|S|\leq|B|+\epsilon N=2\epsilon N. ∎

Acknowledgments

This work was done in part while some of the authors were visiting the Simons Institute for the Theory of Computing. Ilias Diakonikolas was supported by NSF Award CCF-1652862 (CAREER) and a Sloan Research Fellowship. Rong Ge is supported by NSF Award CCF-1704656, CCF-1845171 (CAREER), a Sloan Research Fellowship, and a Google Faculty Research Award. David Woodruff was supported in part by Office of Naval Research (ONR) grant N00014-18-1-2562.

References

Appendix A Omitted Proofs from Section 2

If Σ⪯I\Sigma\preceq I, then ΣZ⪯2I\Sigma_{Z}\preceq 2I.

If 0≤τ<10\leq\tau<1 and ∥Σ−I∥2≤τ\left\|\Sigma-I\right\|_{2}\leq\tau, then ∥ΣZ−2I∥2≤6τ\left\|\Sigma_{Z}-2I\right\|_{2}\leq 6\tau.

Let AA be the unique matrix such that A♭=vA^{\flat}=v. We have

Note that Σ\Sigma is a covariance matrix, so it is always symmetric and PSD. We can write Σ\Sigma as Σ=∑i=1dλivivi⊤\Sigma=\sum_{i=1}^{d}\lambda_{i}v_{i}v_{i}^{\top}. Let λmax⁡\lambda_{\max} and λmin⁡\lambda_{\min} denote the maximum and minimum eigenvalues of Σ\Sigma. Let A^=A+A⊤2\widehat{A}=\frac{A+A^{\top}}{2}. The right hand side is equal to

For (i), by assumption λmax⁡=∥Σ∥2≤1\lambda_{\max}=\left\|\Sigma\right\|_{2}\leq 1, so we have ∥ΣZ∥2≤2\left\|\Sigma_{Z}\right\|_{2}\leq 2.

For (ii), we know 1−τ≤λmin⁡≤λmax⁡≤1+τ1-\tau\leq\lambda_{\min}\leq\lambda_{\max}\leq 1+\tau and 0<τ<10<\tau<1. It follows that (1−2τ)2I⪯Σ⪯(1+3τ)2I(1-2\tau)2I\preceq\Sigma\preceq(1+3\tau)2I, and thus ∥ΣZ−2I∥2≤6τ\left\|\Sigma_{Z}-2I\right\|_{2}\leq 6\tau. ∎

Appendix B Omitted Proofs from Section 3

Let (Gi)i=1N(G_{i})_{i=1}^{N} be the original set of good samples drawn from N(0,Σ)\mathcal{N}(0,\Sigma), and let (Xi)i=1N(X_{i})_{i=1}^{N} be the corrupted samples. Let SS denote the set of (1−ϵ)N(1-\epsilon)N samples with the smallest norm ∥Xi∥2\left\|X_{i}\right\|_{2}. We define Σ0=2(1N∑i∈SXiXi⊤)\Sigma_{0}=2\left(\frac{1}{N}\sum_{i\in S}X_{i}X_{i}^{\top}\right).

We first show that Σ0⪰Σ\Sigma_{0}\succeq\Sigma with high probability. Since the adversary corrupts at most ϵN\epsilon N samples and we throw away ϵN\epsilon N samples, we are left with at least (1−2ϵ)N(1-2\epsilon)N good samples in SS. We will use the fact that removing any (2ϵ)(2\epsilon)-fraction of the good samples will not change the empirical covariance too much. Let Yi=Σ−1/2GiY_{i}=\Sigma^{-1/2}G_{i} so that if Gi∼N(0,Σ)G_{i}\sim\mathcal{N}(0,\Sigma) then Yi∼N(0,I)Y_{i}\sim\mathcal{N}(0,I). When N=Ω~(d/ϵ2)N=\widetilde{\Omega}(d/\epsilon^{2}), for any T⊂[N]T\subset[N] with ∣T∣=(1−2ϵ)N|T|=(1-2\epsilon)N, we have that with high probability,

We set T⊆ST\subseteq S to be a set of (1−2ϵ)N(1-2\epsilon)N good samples in SS, i.e., Gi=XiG_{i}=X_{i} for all i∈Ti\in T. Let M=1N∑i∈TYiYi⊤M=\frac{1}{N}\sum_{i\in T}Y_{i}Y_{i}^{\top}. We know that M=1N∑i∈TΣ−1/2GiGi⊤Σ−1/2M=\frac{1}{N}\sum_{i\in T}\Sigma^{-1/2}G_{i}G_{i}^{\top}\Sigma^{-1/2} by definition, and M⪰(1−O(ϵlog⁡(1/ϵ)))I⪰I2M\succeq(1-O(\epsilon\log(1/\epsilon)))I\succeq\frac{I}{2} by the above concentration inequality. Therefore,

Next we show that ∥Σ0∥2≤\poly(d)∥Σ∥2\left\|\Sigma_{0}\right\|_{2}\leq\poly(d)\left\|\Sigma\right\|_{2} and Σ0⪯(κ\poly(d))Σ\Sigma_{0}\preceq(\kappa\poly(d))\Sigma. Let σ2\sigma^{2} denote the largest eigenvalue of Σ\Sigma. Again let Yi=Σ−1/2GiY_{i}=\Sigma^{-1/2}G_{i}, we know that when N=Ω~(d/ϵ2)N=\widetilde{\Omega}(d/\epsilon^{2}), with high probability,

We assume this condition holds for the rest of the proof. As a result, ∥Gi∥2=∥Σ1/2Yi∥2≤O(σdlog⁡d)\left\|G_{i}\right\|_{2}=\left\|\Sigma^{1/2}Y_{i}\right\|_{2}\leq O(\sigma\sqrt{d\log d}) for all ii. Since only corrupted samples can have larger norm, and we remove the ϵN\epsilon N samples with the largest norm, all samples in SS have norm at most O(σdlog⁡d)O(\sigma\sqrt{d\log d}). This gives an upper bound on the spectral norm of Σ0\Sigma_{0},

This proves ∥Σ0∥2≤\poly(d)∥Σ∥2\left\|\Sigma_{0}\right\|_{2}\leq\poly(d)\left\|\Sigma\right\|_{2}. Moreover, by the definition of condition number we know that Σ⪰σ2κI\Sigma\succeq\frac{\sigma^{2}}{\kappa}I, which implies Σ0⪯(σ2\poly(d))I⪯(κ\poly(d))Σ\Sigma_{0}\preceq(\sigma^{2}\poly(d))I\preceq(\kappa\poly(d))\Sigma.

We conclude the proof by noting that Σ0\Sigma_{0} can be computed by multiplying a d×∣S∣d\times|S| matrix with an ∣S∣×d|S|\times d matrix. This can be done in time O~(d3.26/ϵ2)\widetilde{O}(d^{3.26}/\epsilon^{2}) by fast rectangular matrix multiplication (Lemma 2.2). ∎

Let us first prove the guarantee for the crude O(ϵ)O(\sqrt{\epsilon}) additive estimation.

Under the same setting as Theorem 1.3, there exists universal constant C0C_{0} such that Algorithm 4 outputs an estimate Σ^\widehat{\Sigma} that satisfies ∥Σ^−Σ∥F=O(ϵ)∥Σ∥2{\left\|\widehat{\Sigma}-\Sigma\right\|}_{F}=O(\sqrt{\epsilon})\left\|\Sigma\right\|_{2} with high probability in time O~(d3.26)/\poly(ϵ)\widetilde{O}(d^{3.26})/\poly(\epsilon).

By Lemma 3.1, in Algorithm 4, we can compute Σ0⪰Σ\Sigma_{0}\succeq\Sigma such that ∥Σ0∥2≤\poly(d)∥Σ∥2\left\|\Sigma_{0}\right\|_{2}\leq\poly(d)\left\|\Sigma\right\|_{2}. Lemma 3.2 allows us to iteratively compute Σt+1\Sigma_{t+1} such that Σ⪯Σt+1⪯Σ+O(ϵ)Σt\Sigma\preceq\Sigma_{t+1}\preceq\Sigma+O(\sqrt{\epsilon})\Sigma_{t}. It follows that ∥Σt+1∥2≤∥Σ∥2+O(ϵ)∥Σt∥2\left\|\Sigma_{t+1}\right\|_{2}\leq\left\|\Sigma\right\|_{2}+O(\sqrt{\epsilon})\left\|\Sigma_{t}\right\|_{2}, and thus after O(log⁡d)O(\log d) iterations we have a matrix ΣT\Sigma_{T} with ∥ΣT∥2≤2∥Σ∥2\left\|\Sigma_{T}\right\|_{2}\leq 2\left\|\Sigma\right\|_{2}. Using Lemma 3.2 with ΣT\Sigma_{T}, we can get a matrix Σ^\widehat{\Sigma} with ∥Σ^−Σ∥F=O(ϵ)∥ΣT∥2=O(ϵ)Σ\|\widehat{\Sigma}-\Sigma\|_{F}=O(\sqrt{\epsilon})\left\|\Sigma_{T}\right\|_{2}=O(\sqrt{\epsilon})\Sigma. The running time follows from the running time of Lemmas 3.1 and 3.2. ∎

Suppose the constant hiding in the O(⋅)O(\cdot) notation in Lemma B.1 is C0C_{0}, we have the following immediate corollary of Lemma B.1.

In Algorithm 3, the matrix M0M_{0} satisfies ∥M0−Σ∥F≤C0ϵ∥Σ∥2{\left\|M_{0}-\Sigma\right\|}_{F}\leq C_{0}\sqrt{\epsilon}\left\|\Sigma\right\|_{2}.

In Algorithm 3 we will choose C1=20CrC_{1}=20C_{r} and define S1S_{1} to be the subspace where the eigenvalues of M0M_{0} are at least C1ϵC_{1}\sqrt{\epsilon}. We can then show the following lemma:

In Algorithm 3, with high probability, the matrix M1M_{1} satisfies

We assume the calls to compute M0,M1M_{0},M_{1} are successful, which happens with high probability.

We continue to bound ∥Σ[S1⊥]∥2\left\|\Sigma[S_{1}^{\perp}]\right\|_{2}. Notice that by Corollary B.2,

Here the last step uses the fact when ϵ0\epsilon_{0} is small enough ∥M0∥2≤2∥Σ∥\left\|M_{0}\right\|_{2}\leq 2\left\|\Sigma\right\|. ∎

We will now show that M2M_{2} computed by Algorithm 3 has low additive error in the subspace S12S_{12}.

In Algorithm 3, with high probability, the matrix M2M_{2} satisfies

Moreover, if we consider ΠS12Xi\Pi_{S_{12}}X_{i} as vectors of dimension equal to the dimension of S12S_{12}, the algorithm runs in time O~(d3.26)/\poly(ϵ)\widetilde{O}(d^{3.26})/\poly(\epsilon).

We assume the calls for computing matrices M0,M1,M2M_{0},M_{1},M_{2} are all successful, which happens with high probability.

Let Yi=ΠS12XiY_{i}=\Pi_{S_{12}}X_{i}, we know the covariance of these samples are exactly equal to Σ[S12]\Sigma[S_{12}].

In this case, by the guarantee of Theorem 1.2 we know

We can left and right multiply by M21/2M_{2}^{1/2} and get

When ϵ\epsilon is small enough this implies ∥M2∥2≤2∥Σ[S12]∥2≤2∥Σ∥2\left\|M_{2}\right\|_{2}\leq 2\left\|\Sigma[S_{12}]\right\|_{2}\leq 2\left\|\Sigma\right\|_{2}, therefore as desired we have

The only thing left to establish is the running time. To bound the running time we will show κ(Σ[S12])=O(1/ϵ)\kappa(\Sigma[S_{12}])=O(1/\epsilon). Here we restrict the attention to the subspace S12S_{12}, so if S12S_{12} as dimension kk, κ\kappa is the ratio of the largest eigenvalue and the kk-th eigenvalue.

Let S⋆S^{\star} be the subspace of eigenvectors of Σ\Sigma with eigenvalue at most ϵ∥Σ∥2\epsilon\left\|\Sigma\right\|_{2}. We first show the following claim:

For any unit vector v∈S⋆v\in S^{\star}, ∥ΠS12v∥22≤1/5\left\|\Pi_{S_{12}}v\right\|_{2}^{2}\leq 1/5.

Since ∥ΠS12v∥22=∥ΠS1v∥22+∥ΠS2v∥22\left\|\Pi_{S_{12}}v\right\|_{2}^{2}=\left\|\Pi_{S_{1}}v\right\|_{2}^{2}+\left\|\Pi_{S_{2}}v\right\|_{2}^{2}, we will bound the contributions separately. Notice that for any v∈S⋆v\in S^{\star}, we have v⊤Σv≤ϵv^{\top}\Sigma v\leq\epsilon, therefore by Corollary B.2,

On the other hand, v⊤M0v≥C1ϵ∥Σ∥2∥ΠS1v∥22v^{\top}M_{0}v\geq C_{1}\sqrt{\epsilon}\left\|\Sigma\right\|_{2}\left\|\Pi_{S_{1}}v\right\|_{2}^{2}. Combining the two equations we get ∥ΠS1v∥22≤2Cr/C1=1/10\left\|\Pi_{S_{1}}v\right\|_{2}^{2}\leq 2C_{r}/C_{1}=1/10. The proof for ∥ΠS2v∥22\left\|\Pi_{S_{2}}v\right\|_{2}^{2} is exactly the same except we use Lemma B.3. ∎

For any two subspaces UU and VV, one can check that

where ∠(u,v)\angle(u,v) is the angle between u,vu,v. Therefore we know for any vector v∈S12v\in S_{12}, ∥ΠS⋆v∥22≤1/5\left\|\Pi_{S^{\star}}v\right\|_{2}^{2}\leq 1/5. This implies for every v∈S12v\in S_{12},

This shows λk(ΣS12)≥4ϵ5∥Σ∥2\lambda_{k}(\Sigma_{S_{12}})\geq\frac{4\epsilon}{5}\left\|\Sigma\right\|_{2}, so κ≤54ϵ=O(1/ϵ)\kappa\leq\frac{5}{4\epsilon}=O(1/\epsilon). ∎

Finally we give the guarantee for M3M_{3}.

In Algorithm 3, with high probability, the matrix M3M_{3} satisfies

We assume the calls to compute M0,M1,M3M_{0},M_{1},M_{3} are successful, which happens with high probability.

Set Yi=(ϵ1/2ΠS1+ϵ1/4ΠS2+ΠS3)XiY_{i}=(\epsilon^{1/2}\Pi_{S_{1}}+\epsilon^{1/4}\Pi_{S_{2}}+\Pi_{S_{3}})X_{i}. Let ΣY\Sigma_{Y} denote the covariance of YY. It is easy to check that ΣY⪯3(ϵΣ[S1]+ϵΣ[S2]+Σ[S3])\Sigma_{Y}\preceq 3\left(\epsilon\Sigma[S_{1}]+\sqrt{\epsilon}\Sigma[S_{2}]+\Sigma[S_{3}]\right). By Lemma B.2,

Combining these we have ∥ΣY∥2≤O(ϵ)∥Σ∥2\left\|\Sigma_{Y}\right\|_{2}\leq O(\epsilon)\left\|\Sigma\right\|_{2}. Therefore by Lemma B.1 we know the estimation M3M_{3} satisfies ∥M3−ΣY∥F≤O(ϵ1.5)∥Σ∥2{\left\|M_{3}-\Sigma_{Y}\right\|}_{F}\leq O(\epsilon^{1.5})\left\|\Sigma\right\|_{2}.

On the other hand, it is easy to check that ΣY[S1,S3]=1ϵΣ[S1,S3]\Sigma_{Y}[S_{1},S_{3}]=\frac{1}{\sqrt{\epsilon}}\Sigma[S_{1},S_{3}], therefore we have

Finally we are ready to combine all the steps.

We will assume the four calls to Algorithm 1 and Algorithm 4 are all successful, which happens with high probability. The running time follows from Lemma B.1 and Lemma B.4. Now the resulting matrix looks like

By Lemmas B.3, B.4, B.5 we know for each one of these nine blocks the error is bounded by O(ϵlog⁡(1/ϵ))∥Σ∥2O(\epsilon\log(1/\epsilon))\left\|\Sigma\right\|_{2}. Therefore, the entire matrix also has error at most O(ϵlog⁡(1/ϵ))∥Σ∥2O(\epsilon\log(1/\epsilon))\left\|\Sigma\right\|_{2}. ∎

B.2 Robust Mean Estimation for Bounded-Covariance Distributions

We use the robust mean estimation algorithm for bounded-covariance distributions from [CDG19] to achieve Lemma 3.4.

We state this algorithm (Algorithm 5) to be self-contained.

Notice that Algorithm 5 is almost identical to Algorithm 2, except the stopping criteria in the “if” statement. Therefore, we can speed up Algorithm 5 using Proposition 3.6, as we do for Algorithm 2.

B.3 Robust Mean Estimation with Approximately Known Covariance

In this section, we prove the error guarantee part of Lemma 3.5, i.e., correctness of Algorithm 2. Note that we will not worry about running time here, so we can use the naive implementation of Algorithm 2 which runs in time O~(d4)/\poly(ϵ)\widetilde{O}(d^{4})/\poly(\epsilon). For the same reason, we ignore the additional structure in our input and focus on the mean estimation problem. For the rest of this section, we use dd to denote the dimensionality of the problem, and N=Ω~(d/ϵ2)N=\widetilde{\Omega}(d/\epsilon^{2}) to denote the number of samples. (We have d=(d′)2d=(d^{\prime})^{2} if we are trying to estimate the covariance matrix of a (d′)(d^{\prime})-dimensional Gaussian.)

We use (Xi)i=1N(X_{i})_{i=1}^{N} to denote the input, which is a set of dd-dimensional ϵ\epsilon-corrupted samples drawn from some ground-truth distribution DD. We know DD has covariance matrix Σ\Sigma with ∥Σ−I∥2≤τ\left\|\Sigma-I\right\|_{2}\leq\tau, and the goal is to estimate the unknown mean μ⋆\mu^{\star} of DD. We first restate Lemma 3.5.

We use G⋆G^{\star} for the original set of NN good samples drawn from DD. After ϵ\epsilon-fraction of the samples are corrupted, we use G⊆G⋆G\subseteq G^{\star} for the remaining good samples and BB for the corrupted samples. The input to the algorithm is G∪BG\cup B. We have ∣G∣≥(1−ϵ)N|G|\geq(1-\epsilon)N and ∣B∣≤ϵN|B|\leq\epsilon N. Let ΔN,ϵ\Delta_{N,\epsilon} denote the convex hull of all uniform distributions over subsets S⊆[N]S\subseteq[N] of size ∣S∣=(1−ϵ)N|S|=(1-\epsilon)N:

Every weight vector w∈ΔN,ϵw\in\Delta_{N,\epsilon} correspond to a fractional set of (1−ϵ)N(1-\epsilon)N samples.

By standard concentration results, we know that degree-22 polynomials of Gaussian random variables are exponentially concentrated around their mean.

To avoid dealing with the randomness of the good samples, we require the following deterministic conditions on the original set of NN good samples G⋆G^{\star} (which hold with high probability when N=Ω~(d/ϵ2)N=\widetilde{\Omega}(d/\epsilon^{2}) when DD satisfies Definition B.6). For all w∈ΔN,2ϵw\in\Delta_{N,2\epsilon}, we require the following conditions to hold for δ1=O(ϵlog⁡(1/ϵ))\delta_{1}=O(\epsilon\log(1/\epsilon)) and δ2=O(τ+ϵlog⁡2(1/ϵ))\delta_{2}=O(\tau+\epsilon\log^{2}(1/\epsilon)):

At a high level, they state that with high probability, the good samples are never too far from μ⋆\mu^{\star}, and the empirical first and second moments of the good samples behave as we expect them to. More specifically, δ1\delta_{1} upper bounds the change in the mean when we remove any ϵ\epsilon-fraction of the samples, and δ2\delta_{2} upper bounds the change in the second-moment matrix. The second-order condition follows from the fact that ∥Σ−I∥2≤τ\left\|\Sigma-I\right\|_{2}\leq\tau, the triangle inequality for the spectral norm, and with high probability for our choice of NN,

We adapt the proof of [CDG19] to prove the following lemma, which holds for general distributions that satisfy the concentration bounds above.

Assume the concentration bounds (Conditions (8) and (9)) hold for the good samples with parameters δ1\delta_{1} and δ2\delta_{2} where δ2≥δ12\delta_{2}\geq\delta_{1}^{2}. Let δ=ϵδ2\delta=\sqrt{\epsilon\delta_{2}}. Then Algorithm 2, with threshold (1+O(δ2))(1+O(\delta_{2})) in the “if” statement, will output a weight vector ww such that the weighted empirical mean μ^w=∑i=1NwiXi\widehat{\mu}_{w}=\sum_{i=1}^{N}w_{i}X_{i} satisfies ∥μ−μ^∥2≤O(δ)\left\|\mu-\widehat{\mu}\right\|_{2}\leq O(\delta) for δ=O(δ)\delta=O(\delta).

Lemma 3.5 follows immediately from Lemma B.7, because the output of Algorithm 2 has error δ=O(ϵδ2)=O(ϵ(τ+ϵlog⁡2(1/ϵ)))=O(ϵτ+ϵlog⁡(1/ϵ))\delta=O(\sqrt{\epsilon\delta_{2}})=O(\sqrt{\epsilon(\tau+\epsilon\log^{2}(1/\epsilon))})=O(\sqrt{\epsilon\tau}+\epsilon\log(1/\epsilon)) as needed.

To prove Lemma B.7, we will show that the win-win analysis still holds in our setting by proving two structural lemmas. Lemma B.9 proves that a good primal solution for any guess ν\nu will give an accurate weighted empirical mean. Lemma B.10 shows that we can use the top eigenvector of a near-optimal dual solution to move ν\nu closer to μ⋆\mu^{\star} by a constant factor.

First we prove a helper lemma. Lemma B.8 gives upper and lower bounds on the optimal value of the SDPs (1) and (2). For example, Lemma B.8 allows us to estimate how far ν\nu is from μ⋆\mu^{\star} from the optimal value of the SDPs.

In particular, when ϵ0<1/20\epsilon_{0}<1/20 and r=Ω(δ2)r=\Omega(\sqrt{\delta_{2}}), we can simplify the above as

One feasible primal solution is to set wi=1∣G∣w_{i}=\frac{1}{|G|} for all i∈Gi\in G (and wi=0w_{i}=0 for all i∈Bi\in B):

We used Condition (8), since ww can be viewed as a weight vector on G⋆G^{\star} where w∈ΔN,ϵw\in\Delta_{N,\epsilon}.

One feasible dual solution is M=yy⊤M=yy^{\top} where y=μ⋆−ν∥μ⋆−ν∥2y=\frac{\mu^{\star}-\nu}{\left\|\mu^{\star}-\nu\right\|_{2}}. The dual objective value is the mean of the smallest (1−ϵ)(1-\epsilon)-fraction of ((Xi−ν)⊤M(Xi−ν))i=1N\left((X_{i}-\nu)^{\top}M(X_{i}-\nu)\right)_{i=1}^{N}, which is at least

This is because the smallest (1−ϵ)N(1-\epsilon)N entries in GG must include the smallest (1−2ϵ)N(1-2\epsilon)N entries. Let wi′=1∣S∣w^{\prime}_{i}=\frac{1}{|S|} for all i∈Si\in S and wi′=0w^{\prime}_{i}=0 otherwise. Note that S⊂GS\subset G and ∣S∣=(1−2ϵ)N|S|=(1-2\epsilon)N, so w′w^{\prime} can be viewed as a weight vector on G⋆G^{\star} with w′∈ΔN,2ϵw^{\prime}\in\Delta_{N,2\epsilon}. Therefore we have

Next we show that a good primal solution ww for any guess ν\nu will give an accurate estimate μ^w\widehat{\mu}_{w}. Lemma B.9 proves the contrapositive statement: if the weighted empirical mean μ^w\widehat{\mu}_{w} is far from μ⋆\mu^{\star}, then no matter what our current guess ν\nu is, ww cannot be a good solution to the primal SDP.

Fix any w∈ΔN,2ϵw\in\Delta_{N,2\epsilon}. If ∥μ⋆−ν∥2=Ω(δ2)\left\|\mu^{\star}-\nu\right\|_{2}=\Omega(\sqrt{\delta_{2}}), then because ww is feasible and by Lemma B.8,

Therefore, for the rest of this proof, we can assume ∥μ⋆−ν∥2=O(δ2)\left\|\mu^{\star}-\nu\right\|_{2}=O(\sqrt{\delta_{2}}).

We project the samples along the direction of (μ^w−μ⋆)(\widehat{\mu}_{w}-\mu^{\star}). Consider the unit vector y=(μ^w−μ⋆)/∥μ^w−μ⋆∥2y=(\widehat{\mu}_{w}-\mu^{\star})/\left\|\widehat{\mu}_{w}-\mu^{\star}\right\|_{2}. To bound from below the maximum eigenvalue, it is sufficient to show that

We first bound from below the contribution of the bad samples by Ω(δ2)\Omega(\delta_{2}). By triangle inequality,

The last line follows from our choice of yy, δ≥max⁡(δ1,ϵδ2)\delta\geq\max(\delta_{1},\epsilon\sqrt{\delta_{2}}), and the good samples satisfy Condition (8). By Cauchy-Schwarz,

Since wB≤2ϵw_{B}\leq 2\epsilon, we have ∑i∈Bwi⟨Xi−ν,y⟩2=Ω(δ2/ϵ)=Ω(δ2)\sum_{i\in B}w_{i}\langle X_{i}-\nu,y\rangle^{2}=\Omega(\delta^{2}/\epsilon)=\Omega(\delta_{2}).

We continue to lower bound the contribution of the good samples to the quadratic form by 1−O(δ2)1-O(\delta_{2}). By Condition (8),

In the last step, we used δ1∥μ⋆−ν∥2≤2δ1δ2=O(δ2)\delta_{1}\left\|\mu^{\star}-\nu\right\|_{2}\leq 2\delta_{1}\sqrt{\delta_{2}}=O(\delta_{2}). Putting together the contribution of good and bad samples, we have ∑i=1Nwi⟨Xi−ν,y⟩2≥1−O(δ2)+Ω(δ2)=1+Ω(δ2)\sum_{i=1}^{N}w_{i}\langle X_{i}-\nu,y\rangle^{2}\geq 1-O(\delta_{2})+\Omega(\delta_{2})=1+\Omega(\delta_{2}). ∎

Lemma B.9 guarantees that, any solution to the primal SDP whose objective value is at most 1+O(δ2)1+O(\delta_{2}) will give good weights, and this is independent of our current guess ν\nu.

We now deal with the other possibility: the primal SDP has no good solution. Lemma B.10 shows that in this case, we can solve the dual SDP (2) and move ν\nu closer to μ⋆\mu^{\star} by a constant factor. We simplify the proof by assuming that we can solve the dual SDP exactly. This assumption is wlog as shown in [CDG19].

We know M⪰0M\succeq 0 and \tr(M)=1\tr(M)=1. Without loss of generality, we can assume MM is symmetric.

Since the objective value is the average of the smallest (1−ϵ)N(1-\epsilon)N entries of (Xi−ν)⊤M(Xi−ν)(X_{i}-\nu)^{\top}M(X_{i}-\nu) and one way to choose (1−ϵ)N(1-\epsilon)N entries is to focus on the good samples, using Condition (8),

Therefore, we have ⟨M,(μ⋆−ν)(μ⋆−ν)⊤⟩≥45∥μ⋆−ν∥22\langle M,(\mu^{\star}-\nu)(\mu^{\star}-\nu)^{\top}\rangle\geq\frac{4}{5}\left\|\mu^{\star}-\nu\right\|_{2}^{2}.

We will continue to show that the top eigenvector of MM aligns with (ν−μ⋆)(\nu-\mu^{\star}). Let λ1≥λ2≥…≥λd≥0\lambda_{1}\geq\lambda_{2}\geq\ldots\geq\lambda_{d}\geq 0 denote the eigenvalues of MM, and let v1,…,vdv_{1},\ldots,v_{d} denote the corresponding eigenvectors. The conditions on MM implies that ∑i=1dλd=1\sum_{i=1}^{d}\lambda_{d}=1. We decompose (μ⋆−ν)(\mu^{\star}-\nu) and write it as μ⋆−ν=∑i=1dαivi\mu^{\star}-\nu=\sum_{i=1}^{d}\alpha_{i}v_{i} where ∑i=1dαi2=∥μ⋆−ν∥22\sum_{i=1}^{d}\alpha_{i}^{2}=\left\|\mu^{\star}-\nu\right\|_{2}^{2}. Using these decompositions, we can rewrite ⟨M,(μ⋆−ν)(μ⋆−ν)⊤⟩=∑i=1dλiαi2\langle M,(\mu^{\star}-\nu)(\mu^{\star}-\nu)^{\top}\rangle=\sum_{i=1}^{d}\lambda_{i}\alpha_{i}^{2}.