Low Rank Approximation and Regression in Input Sparsity Time

Kenneth L. Clarkson, David P. Woodruff

Introduction

A large body of work has been devoted to the study of fast randomized approximation algorithms for problems in numerical linear algebra. Several well-studied problems in this area include least squares regression, low rank approximation, and approximate computation of leverage scores. These problems have many applications in data mining , recommendation systems , information retrieval , web search , clustering , and learning mixtures of distributions . The use of randomization and approximation allows one to solve these problems much faster than with deterministic methods.

Another problem we consider is approximating the leverage scores. Given an n×dn\times d matrix AA with n≫dn\gg d, one can write A=UΣV⊤A=U\Sigma V^{\top} in its singular value decomposition, where the columns of UU are the left singular vectors, Σ\Sigma is a diagonal matrix, and the columns of VV are the right singular vectors. Although UU has orthonormal columns, not much can be immediately said about the squared lengths ∥Ui∥22\|U_{i}\|_{2}^{2} of its rows. These values are known as the leverage scores, and measure the extent to which the singular vectors of AA are correlated with the standard basis. The leverage scores are basis-independent, since they are equal to the diagonal elements of the projection matrix onto the span of the columns of AA; see for background on leverage scores as well as a list of applications. The leverage scores will also play a crucial role in our work, as we shall see. The goal of approximating the leverage scores is to, simultaneously for each i∈[n]i\in[n], output a constant factor approximation to ∥Ui∥22\|U_{i}\|_{2}^{2}. Using randomization, this can be solved in O(ndlog⁡n+d3log⁡dlog⁡n)O(nd\log n+d^{3}\log d\log n) time .

There are also solutions for these problems based on sampling. They either get a weaker additive error , or they get bounded relative error but are slow . Many of the latter algorithms were improved independently by Deshpande and Vempala and Sarlós , and in followup work . There are also solutions based on iterative and conjugate-gradient methods, see, e.g., , or as recent examples. These methods repeatedly compute matrix-vector products AxAx for various vectors xx; in the most common setting, such products require Θ(nnz⁡(A))\Theta(\operatorname{\mathtt{nnz}}(A)) time. Thus the work per iteration of these methods is Θ(nnz⁡(A))\Theta(\operatorname{\mathtt{nnz}}(A)), and the number of iterations NN that are performed depends on the desired accuracy, spectral properties of AA, numerical stability issues, and other concerns, and can be large. A recent survey suggests that NN is typically Θ(k)\Theta(k) for Krylov methods (such as Arnoldi and Lanczos iterations) to approximate the kk leading singular vectors . One can also use some of these techniques together, for example by first obtaining a preconditioner using the Johnson-Lindenstrauss (JL) transform, and then running an iterative method.

We resolve the above gaps by achieving algorithms for least squares regression, low rank approximation, and approximate leverage scores, whose time complexities have a leading order term that is O(nnz⁡(A))O(\operatorname{\mathtt{nnz}}(A)), sometimes up to a log factor, with constant factors that are independent of any numerical properties of AA. Our results are as follows:

see Theorem 38. We also note improved results for constrained regression, §7.6.

2 Techniques

In fact, our subspace embedding is nothing other than the CountSketch matrix in the data stream literature , see also . This matrix was also studied by Dasgupta, Kumar, and Sarlós . Formally, SS has a single randomly chosen non-zero entry Sh(j),jS_{h(j),j} in each column jj, for a random mapping h:[n]↦[t]h:[n]\mapsto[t]. With probability 1/21/2, Sh(j),j=1S_{h(j),j}=1, and with probability 1/21/2, Sh(j),j=−1S_{h(j),j}=-1.

We stress that our choice of matrices SS does not preserve the norms of an arbitrary set of exp⁡(d)\exp(d) vectors with high probability, and so the above approach cannot work for our choice of matrices SS. We instead critically use that these exp⁡(d)\exp(d) vectors all come from a dd-dimensional subspace (namely, C(A)C(A)), and therefore have a very special structure. The structural fact we use is that there is a fixed set HH of size d/αd/\alpha which depends only on the subspace, such that for any unit vector y∈C(A)y\in C(A), HH contains the indices of all coordinates of yy larger than α\sqrt{\alpha} in magnitude. The key property here is that the set HH is independent of yy, or in other words, only a small set of coordinates could ever be large as we range over all unit vectors in the subspace. The set HH selects exactly the set of large leverage scores of the columns space C(A)C(A)!

Given this observation, by setting t≥K∣H∣2t\geq K|H|^{2} for a large enough constant KK, we have that with probability 1−1/K1-1/K, there are no two distinct j≠j′j\neq j^{\prime} with j,j′∈Hj,j^{\prime}\in H for which h(j)=h(j′)h(j)=h(j^{\prime}). That is, we avoid the birthday paradox, and the coordinates in HH are “perfectly hashed” with large probability. Call this event E\mathcal{E}, which we condition on.

Given a unit vector yy in the subspace, we can write it as yH+yLy^{H}+y^{L}, where yHy^{H} consists of yy with the coordinates in [n]∖H[n]\setminus H replaced with , while yLy^{L} consists of yy with the coordinates in HH replaced with . We seek to bound

Finally, we can bound ⟨SyH,SyL⟩\langle Sy^{H},Sy^{L}\rangle as follows. Define G⊆[n]∖HG\subseteq[n]\setminus H to be the set of coordinates jj for which h(j)=h(j′)h(j)=h(j^{\prime}) for a coordinate j′∈Hj^{\prime}\in H, that is, those coordinates in [n]∖H[n]\setminus H which “collide” with an element of HH. Then, ⟨SyH,SyL⟩=⟨SyH,SyL′⟩\langle Sy^{H},Sy^{L}\rangle=\langle Sy^{H},Sy^{L^{\prime}}\rangle, where yL′y^{L^{\prime}} is a vector which agrees with yLy^{L} on coordinates j∈Gj\in G, and is on the remaining coordinates. By Cauchy-Schwarz, this is at most ∥SyH∥2⋅∥SyL′∥2\|Sy^{H}\|_{2}\cdot\|Sy^{L^{\prime}}\|_{2}. We have already argued that ∥SyH∥2=∥yH∥2≤1\|Sy^{H}\|_{2}=\|y^{H}\|_{2}\leq 1 for unit vectors yy. Moreover, we can again apply Theorem 2 of to bound ∥SyL′∥2\|Sy^{L^{\prime}}\|_{2}, since, conditioned on the coordinates of yL′y^{L^{\prime}} hashing to the set of items that the coordinates of yHy^{H} hash to, they are otherwise random, and so we again have a mapping of our form (with a smaller tt and applied to a smaller nn) applied to a vector with small infinity-norm. Therefore, ∥SyL′∥2≤O(ε)+∥yL′∥2\|Sy^{L^{\prime}}\|_{2}\leq O(\varepsilon)+\|y^{L^{\prime}}\|_{2} with high probability. Finally, by Bernstein bounds, since the coordinates of yLy^{L} are small and tt is sufficiently large, ∥yL′∥2≤ε\|y^{L^{\prime}}\|_{2}\leq\varepsilon with high probability. Hence, conditioned on event E\mathcal{E}, ∥Sy∥2=(1±ε)∥y∥2\|Sy\|_{2}=(1\pm\varepsilon)\|y\|_{2} with probability 1−exp⁡(−d)1-\exp(-d), and we can complete the argument by union-bounding over a sufficiently fine net.

The first idea for bringing this down is that the analysis of can itself be tightened by using that we are applying it on vectors coming from a subspace instead of on a set of arbitrary vectors. This involves observing that in the analysis of , if on input vector yy and for every i∈[t]i\in[t], ∑j∣h(j)=iyj2\sum_{j\mid h(j)=i}y_{j}^{2} is small then the remainder of the analysis of does not require that ∥y∥∞\|y\|_{\infty} be small. Since our vectors come from a subspace, it suffices to show that for every i∈[t]i\in[t], ∑j∣h(j)=i∥Uj∥22\sum_{j\mid h(j)=i}\|U_{j}\|_{2}^{2} is small, where ∥Uj∥22\|U_{j}\|_{2}^{2} is the jj-th leverage score of AA. Therefore we do not need to perform this analysis for each yy, but can condition on a single event, and this effectively allows us to increase α\alpha in the outline above, thereby reducing the size of HH, and also the size of tt since we have t=Ω(∣H∣2)t=\Omega(|H|^{2}). In fact, we instead follow a simpler and slightly tighter analysis of based on the Hanson-Wright inequality.

We also note that for applications such as least squares regression, it suffices to set ε\varepsilon to be a constant in the subspace embedding, since we can use an approach in which, given constant-factor approximations to all of the leverage scores, can then achieve a (1+ε)(1+\varepsilon)-approximation to least squares regression by slightly over-sampling rows of the adjoined matrix A∘bA\circ b proportional to its leverage scores, and solving the induced subproblem. This results in a better dependence on ε\varepsilon.

We can also compose our subspace embedding with a fast JL transform to further reduce tt to the optimal value of about d/ε2d/\varepsilon^{2}. Since S⋅AS\cdot A already has small dimensions, applying a fast JL transform is now efficient.

Finally, we can use a recent result of to replace most dependencies on dd in our running times for regression with a dependence on the rank rr of AA, which may be smaller.

3 Recent Related Work

here ω\omega is the exponent for asymptotically fast matrix multiplication, and α>0\alpha>0 is an arbitrary constant. (Some constant factors here are increasing in α\alpha.)

Paul, Boutsidis, Magdon-Ismail, and Drineas implemented our subspace embeddings and found that in the TechTC-300 matrices, a collection of 300 sparse matrices of document-term data, with an average of 150 to 200 rows and 15,000 columns, our subspace embeddings as used for the projection step in their SVM classifier are about 20 times faster than the Fast JL Transform, while maintaining the same classification accuracy. Despite this large improvement in the time for projecting the data, further research is needed for SVM classification, as the JL Transform empirically possesses additional properties important for SVM which make it faster to classify the projected data, even though the time to project the data using our method is faster.

4 Outline

Sparse Embedding Matrices

We let ∥A∥F{\|A\|}_{F} or ∥A∥{\|A\|} denote the Frobenius norm of matrix AA, and ∥A∥2{\|A\|}_{2} denote the spectral norm of AA.

h:[n]↦[t]h:[n]\mapsto[t] is a random map so that for each i∈[n]i\in[n], h(i)=t′h(i)=t^{\prime} for t′∈[t]t^{\prime}\in[t] with probability 1/t1/t.

Φ∈{0,1}t×n\Phi\in\{0,1\}^{t\times n} is a t×nt\times n binary matrix with Φh(i),i=1\Phi_{h(i),i}=1, and all remaining entries .

DD is an n×nn\times n random diagonal matrix, with each diagonal entry independently chosen to be +1+1 or −1-1 with equal probability.

We will refer to a matrix of the form ΦD\Phi D as a sparse embedding matrix.

Analysis

It will be convenient to regard the rows of AA and UU to be re-arranged so that the uiu_{i} are in non-increasing order, so u1u_{1} is largest; of course this order is unknown and un-used by our algorithms.

Let T>0T>0 be a parameter. Throughout, we let s≡min⁡{i∣ui≤T}s\equiv\min\{i|u_{i}\leq T\}, and s′≡max⁡{i∣∑s≤j≤iuj≤1}s^{\prime}\equiv\max\{i|\sum_{s\leq j\leq i}u_{j}\leq 1\}.

We will use the notation ⟦P⟧\llbracket P\rrbracket, a function on event PP, that returns 1 when PP holds, and 0 otherwise.

The following variation of Bernstein’s inequalitySee Wikipedia entry on Bernstein’s inequalities (probability theory). will be helpful.

For L,T≥0L,T\geq 0 and independent random variables Xi∈[0,T]X_{i}\in[0,T] with V≡∑iVar⁡[Xi]V\equiv\sum_{i}\operatorname{\mathbf{Var}}[X_{i}], if V≤LT2/6V\leq LT^{2}/6, then

Proof: Here Bernstein’s inequality says that for Yi≡Xi−E⁡[Xi]Y_{i}\equiv X_{i}-\operatorname{\mathbf{E}}[X_{i}], so that E⁡[Yi2]=Var⁡[Xi]=V\operatorname{\mathbf{E}}[Y^{2}_{i}]=\operatorname{\mathbf{Var}}[X_{i}]=V and ∣Yi∣≤T|Y_{i}|\leq T,

By the quadratic formula, the latter is no more than −L-L when

which holds for z≥LTz\geq LT and V≤LT2/6V\leq LT^{2}/6.

We begin the analysis by considering ys:ny_{s:n} for fixed unit vectors y∈C(A)y\in C(A). Since ∥y∥=1{\|y\|}=1, there must be a unit vector xx so that y=Uxy=Ux, and so by Cauchy-Schwartz, ∥yi∥2≤∥Ui,∗∥2∥x∥2=ui{\|y_{i}\|}^{2}\leq{\|U_{i,*}\|}^{2}{\|x\|}^{2}=u_{i}. This implies that ∥ys:n∥∞2≤us\|y_{s:n}\|_{\infty}^{2}\leq u_{s}. We extend this to all unit vectors in subsequent sections.

The following is similar to Lemma 6 of , and is a standard balls-and-bins analysis.

For δh,T,t>0\delta_{h},T,t>0, and s≡min⁡{i∣ui≤T}s\equiv\min\{i\mid u_{i}\leq T\}, let Eh\mathcal{E}_{h} be the event that

where W≡Tlog⁡(t/δh)+r/tW\equiv T\log(t/\delta_{h})+r/t. If

then Pr⁡[Eh]≥1−δh\Pr[\mathcal{E}_{h}]\geq 1-\delta_{h}.

Proof: We will apply Lemma 1 to prove that the bound holds for fixed j∈[t]j\in[t] with failure probability δh/t\delta_{h}/t, and then apply a union bound.

Let XiX_{i} denote the random variable ui⟦h(i)=j,i≥s⟧u_{i}\llbracket h(i)=j,i\geq s\rrbracket. We have 0≤Xi≤T0\leq X_{i}\leq T, E⁡[X]=∑i≥sui/t≤r/t\operatorname{\mathbf{E}}[X]=\sum_{i\geq s}u_{i}/t\leq r/t, and V=∑i≥sE⁡[Xi2]=∑i≥sui2/t=∥us:n∥2/tV=\sum_{i\geq s}\operatorname{\mathbf{E}}[X_{i}^{2}]=\sum_{i\geq s}u_{i}^{2}/t={\|u_{s:n}\|}^{2}/t. Applying Lemma 1 with L=log⁡(t/δh)L=\log(t/\delta_{h}) gives

when ∥us:n∥2/t≤LT2/6{\|u_{s:n}\|}^{2}/t\leq LT^{2}/6, or t≥6∥us:n∥2/LT2t\geq 6{\|u_{s:n}\|}^{2}/LT^{2}.

Proof: We will use the following theorem, due to Hanson and Wright.

Our analysis uses some ideas from the proofs for Lemmas 7 and 8 of .

Since by assumption event Eh\mathcal{E}_{h} of Lemma 2 occurs, and for unit y∈C(A)y\in C(A), yi′2≤ui′y_{i^{\prime}}^{2}\leq u_{i^{\prime}} for all i′i^{\prime}, we have for j∈[t]j\in[t] that ∑i′∈h−1(j),i′≥syi′2≤W\sum_{i^{\prime}\in h^{-1}(j),i^{\prime}\geq s}y^{2}_{i^{\prime}}\leq W. Hence

Putting this and (3.1) into the QQ of Theorem 4, we have,

2 Handling vectors with large entries

A small number of entries can be handled directly.

For given ss, let EB\mathcal{E_{B}} denote the event that h(i)≠h(i′)h(i)\neq h(i^{\prime}) for all i,i′<si,i^{\prime}<s. Then δB≡1−Pr⁡[EB]≤s2/t\delta_{B}\equiv 1-\Pr[\mathcal{E}_{B}]\leq s^{2}/t. Given event EB\mathcal{E}_{B}, we have that for any yy,

Proof: Since Pr⁡[h(i)=h(i′)]=1/t\Pr[h(i)=h(i^{\prime})]=1/t, the probability that some such i≠i′i\neq i^{\prime} has h(i)=h(i′)h(i)=h(i^{\prime}) is at most s2/ts^{2}/t. The last claim follows by a union bound.

3 Handling all vectors

We have seen that ΦD\Phi D preserves the norms for vectors with small entries (Lemma 3) and large entries (Lemma 5). Before proving a general bound, we need to prove a bound on the “cross terms”.

For WW as in Lemma 2, suppose the event Eh\mathcal{E}_{h} and EB\mathcal{E}_{B} hold. Then for unit vector y∈C(A)y\in C(A), with failure probability at most δC\delta_{C},

Proof: With the event EB\mathcal{E}_{B}, for each i≥si\geq s there is at most one i′<si^{\prime}<s with h(i)=h(i′)h(i)=h(i^{\prime}); let zi≡yi′Di′i′z_{i}\equiv y_{i^{\prime}}D_{i^{\prime}i^{\prime}}, and zi≡0z_{i}\equiv 0 otherwise. We have for integer p≥1p\geq 1 using Khintchine’s inequality

where Cp≤Γ(p+1/2)1/p=O(p)C_{p}\leq\Gamma(p+1/2)^{1/p}=O(p), and the last inequality uses the assumption that Eh\mathcal{E}_{h} holds, and ∑i′<syi′2≤1\sum_{i^{\prime}<s}y_{i^{\prime}}^{2}\leq 1. Putting p=log⁡(1/δC)p=\log(1/\delta_{C}) and applying the Markov inequality, we have

Therefore, with failure probability at most δC\delta_{C}, we have

Suppose the events Eh\mathcal{E}_{h} and EB\mathcal{E}_{B} hold, and WW is as in Lemma 2. Then for δy>0\delta_{y}>0 there is an absolute constant KyK_{y} such that, if W≤Kyϵ2/log⁡(1/δy)W\leq K_{y}\epsilon^{2}/\log(1/\delta_{y}), then for unit vector y∈C(A)y\in C(A), with failure probability δy\delta_{y}, ∥ΦDy∥2=(1±ε)∥y∥2{\|\Phi Dy\|}_{2}=(1\pm\varepsilon){\|y\|}_{2}, when δy≤1/2\delta_{y}\leq 1/2.

Proof: Assuming Eh\mathcal{E}_{h} and EB\mathcal{E}_{B}, we apply Lemmas 5, 3, and 6 , and have with failure probability at most δL+δC\delta_{L}+\delta_{C},

for the given WW, putting δL=δC=δy/2\delta_{L}=\delta_{C}=\delta_{y}/2 and assuming δy≤1/2\delta_{y}\leq 1/2. Thus Ky≤1/9(KL+KC)2K_{y}\leq 1/9(K_{L}+K_{C})^{2} suffices.

∣E∣≤ecr|E|\leq e^{cr} for c=(1γ+2)c=(\frac{1}{\gamma}+2).

For any r×rr\times r matrix JJ, if for every u,v∈Eu,v\in E we have ∣u⊤Jv∣≤ε|u^{\top}Jv|\leq\varepsilon, then for every unit vector ww, we have ∣w⊤Jw∣≤ε(1−γ)2|w^{\top}Jw|\leq\frac{\varepsilon}{(1-\gamma)^{2}}.

The following is our main theorem in this section.

There is t=O((r/ϵ)4log⁡2(r/ϵ))t=O((r/\epsilon)^{4}\log^{2}(r/\epsilon)) such that with probability at least 9/109/10, ΦD\Phi D is a subspace embedding matrix for AA; that is, for all y∈C(A)y\in C(A), ∥ΦDy∥2=(1±ε)∥y∥2{\|\Phi Dy\|}_{2}=(1\pm\varepsilon){\|y\|}_{2}. The embedding ΦD\Phi D can be applied in O(nnz⁡(A))O(\operatorname{\mathtt{nnz}}(A)) time. For s=min⁡{i′∣ui′≤T}s=\min\{i^{\prime}\mid u_{i^{\prime}}\leq T\}, where TT is a parameter in Ω(ϵ2/rlog⁡(r/ϵ))\Omega(\epsilon^{2}/r\log(r/\epsilon)), it suffices if t≥max⁡{s2/30,r/T}t\geq\max\{s^{2}/30,r/T\}.

Proof: For suitable tt, TT, and ss, with failure probability at most δh+δB\delta_{h}+\delta_{B}, events Eh\mathcal{E}_{h} and EB\mathcal{E}_{B} both hold. Conditioned on this, and assuming WW is sufficiently small as in Lemma 7, we have with failure probability δy\delta_{y} for any fixed y∈C(A)y\in C(A) that ∥ΦDy∥2=(1±ε)∥y∥2\|\Phi Dy\|_{2}=(1\pm\varepsilon)\|y\|_{2}. Hence by Lemma 8, with failure probability δh+δB+δyKsubr\delta_{h}+\delta_{B}+\delta_{y}K_{sub}^{r}, ∥ΦDy∥2=(1±6ε)∥y∥2\|\Phi Dy\|_{2}=(1\pm 6\varepsilon)\|y\|_{2} for all y∈C(A)y\in C(A). We need δh+δB+δyKsubr≤1/10\delta_{h}+\delta_{B}+\delta_{y}K_{sub}^{r}\leq 1/10, and the parameter conditions of Lemmas 2, Lemma 3, and Lemma 7 holding. Listing these conditions:

δh+δB+δyKsubr≤1/10\delta_{h}+\delta_{B}+\delta_{y}K_{sub}^{r}\leq 1/10, where δB\delta_{B} can be set to be s2/ts^{2}/t;

t≥6∥us:n∥2/log⁡(t/δh)T2t\geq 6{\|u_{s:n}\|}^{2}/\log(t/\delta_{h})T^{2};

W=Tlog⁡(t/δh)+r/t≤Kyϵ2/log⁡(1/δy)W=T\log(t/\delta_{h})+r/t\leq K_{y}\epsilon^{2}/\log(1/\delta_{y}).

We put δy=Ksub−r/30\delta_{y}=K_{sub}^{-r}/30, δh=1/30\delta_{h}=1/30, and require t≥s2/30t\geq s^{2}/30. For the last condition it suffices that T=O(ϵ2/rlog⁡(t))T=O(\epsilon^{2}/r\log(t)), and t=Ω(r2/ϵ2)t=\Omega(r^{2}/\epsilon^{2}). The last condition implies the fourth condition for small enough constant ε\varepsilon. Also, since ∥us:n∥2=∑i≥sui2≤∑i≥suiT≤rT{\|u_{s:n}\|}^{2}=\sum_{i\geq s}u_{i}^{2}\leq\sum_{i\geq s}u_{i}T\leq rT, the bound for TT implies that t=O((r/ϵ)2log⁡(t))t=O((r/\epsilon)^{2}\log(t)) suffices for Condition 3. Thus when the leverage scores are such that ss is small, tt can be O((r/ϵ)2log⁡(r/ϵ))O((r/\epsilon)^{2}\log(r/\epsilon)). Since ∑iui=r\sum_{i}u_{i}=r, s≤r/Ts\leq r/T suffices, and so t=O((r/T)2)=O((r/ϵ)4log⁡2(r/ϵ))t=O((r/T)^{2})=O((r/\epsilon)^{4}\log^{2}(r/\epsilon)) suffices for the conditions of the theorem.

Partitioning Leverage Scores

Let q≡log⁡21/T=O(log⁡(r/ε))q\equiv\log_{2}1/T=O(\log(r/\varepsilon)). We partition the leverage scores uiu_{i} with ui≥Tu_{i}\geq T into groups GjG_{j}, j∈[q]j\in[q], where

Let βj≡2−j\beta_{j}\equiv 2^{-j}, and nj≡∣Gj∣n_{j}\equiv|G_{j}|. Since ∑i=1nui=r\sum_{i=1}^{n}u_{i}=r, we have for all jj that nj≤r/βjn_{j}\leq r/\beta_{j}.

We may also use GjG_{j} to refer to the collection of rows of UU with leverage scores in GjG_{j}.

For given hash function hh and corresponding Φ\Phi, let Gj′⊂GjG^{\prime}_{j}\subset G_{j} denote the collision indices of GjG_{j}, those i∈Gji\in G_{j} such that h(i)=h(i′)h(i)=h(i^{\prime}) for some i′∈Gji^{\prime}\in G_{j}. Let kj≡∣Gj′∣k_{j}\equiv|G^{\prime}_{j}|.

First, we bound the spectral norm of a submatrix of the orthogonal basis UU of C(A)C(A), where the submatrix comprises rows of Gj′G^{\prime}_{j}.

We want to bound the spectral norm of the matrix B^\hat{B} whose rows comprise those rows of UU in the collision set Gj′G^{\prime}_{j}. We let t=Θ(r2q6/ϵ2)t=\Theta(r^{2}q^{6}/\epsilon^{2}) be the number of hash buckets. The expected number of collisions in the tt buckets is E⁡[∣Gj′∣]=(nj2)t≤nj22t.\operatorname{\mathbf{E}}[|G^{\prime}_{j}|]=\frac{{n_{j}\choose 2}}{t}\leq\frac{n_{j}^{2}}{2t}. Let Dj\mathcal{D}_{j} be the event that the number kj≡∣Gj′∣k_{j}\equiv|G^{\prime}_{j}| of such collisions in the tt buckets is at most nj2q2/tn_{j}^{2}q^{2}/t. Let D=∩j=1qDj\mathcal{D}=\cap_{j=1}^{q}\mathcal{D}_{j}. By a Markov and a union bound, Pr⁡[D]≥1−1/(2q)\Pr[\mathcal{D}]\geq 1-1/(2q). We will assume that D\mathcal{D} occurs.

While each row in BB has some independent probability of participating in a collision, we first analyze a sampling scheme with replacement.

Our analysis will use a special case of the version of matrix Bernstein inequalities described by Recht.

Also M≡∥Hm∥2≤2βj+1njM\equiv{\|H_{m}\|}_{2}\leq 2\beta_{j}+\frac{1}{n_{j}}.

Applying the above fact with these bounds for ρm2\rho_{m}^{2} and MM, we have

With probability 1−o(1)1-o(1), for all leverage score groups GjG_{j}, and for UU an orthonormal basis of C(A)C(A), the submatrix B^j\hat{B}_{j} of UU consisting of rows in Gj′G^{\prime}_{j}, that is, those in GjG_{j} that collide in a hash bucket with another row in GjG_{j} under Φ\Phi, has squared spectral norm O(q(βj+1/nj+r/t+nj/t))O(q(\beta_{j}+1/n_{j}+\sqrt{r/t}+n_{j}/t)).

Proof: Fix a j∈[q]j\in[q]. If nj≡∣Gj∣≤t/q2n_{j}\equiv|G_{j}|\leq\sqrt{t}/q^{2}, then with probability 1−o(1/q)1-o(1/q), the items in GjG_{j} are perfectly hashed into the tt bins. So with probability 1−o(1)1-o(1), for all j∈[q]j\in[q], if nj≤t/q2n_{j}\leq\sqrt{t}/q^{2}, then there are no collisions. Condition on this event.

Now consider a j∈[q]j\in[q] for which nj≥t/qn_{j}\geq\sqrt{t}/q. Then

When sampling with replacement, the expected number of distinct items is

2 Within-Group Errors

In this subsection, we show that for all y∈Ljy\in L_{j}, the error in estimating ∥y∥2{\|y\|}^{2} using y⊤DΦ⊤ΦDyy^{\top}D\Phi^{\top}\Phi Dy is at most O(ε)O(\varepsilon).

For y∈Ljy\in L_{j}, the error in estimating ∥y∥2{\|y\|}^{2} by using y⊤DΦ⊤ΦDyy^{\top}D\Phi^{\top}\Phi Dy contributed by collisions among coordinates yiy_{i} for i∈Gji\in G_{j} is

and we need a bound on this quantity that holds with high probability.

By a standard balls-and-bins analysis, every bucket has O(log⁡t)=O(q)O(\log t)=O(q) collisions, with high probability, since nj≤r/T≤O(r2/ε2)=O(t)n_{j}\leq r/T\leq O(r^{2}/\varepsilon^{2})=O(t); we assume this event.

The squared Euclidean norm of the vector of all yiy_{i} that appear in the summands, that is, with i∈Gj′i\in G^{\prime}_{j}, is at most βj+1/nj+r/t+nj/t)\beta_{j}+1/n_{j}+\sqrt{r/t}+n_{j}/t) by Lemma 13. Thus the squared Euclidean norm of the vector comprising all summands in (2) is at most

By Khintchine’s inequality, for p≥1p\geq 1,

and therefore ∣κj∣2|\kappa_{j}|^{2} is less than the last quantity, with failure probability at most 4−p4^{-p}.

Putting p=kj′≡min⁡{r,kj}p=k^{\prime}_{j}\equiv\min\{r,k_{j}\}, with failure probability at most 4−kj′4^{-k^{\prime}_{j}}, for any fixed vector y∈Ljy\in L_{j}, the squared error in estimating ∥y∥2{\|y\|}^{2} using the sketch of yy is at most O(kj′(q2βj(βj+1/nj+r/t+nj/t))O(k^{\prime}_{j}(q^{2}\beta_{j}(\beta_{j}+1/n_{j}+\sqrt{r/t}+n_{j}/t)). Assuming the event D\cal D from the section above, we have kj′≤min⁡{r,q⋅nj2q/t}k^{\prime}_{j}\leq\min\{r,q\cdot n_{j}^{2}q/t\}. We have, using βjnj≤r\beta_{j}n_{j}\leq r,

and r⋅q2βjnj/t≤q2r2/tr\cdot q^{2}\beta_{j}n_{j}/t\leq q^{2}r^{2}/t, and finally

using βjnj≤r\beta_{j}n_{j}\leq r. Putting these bounds on the terms together, the squared error is O(q4r2/t)O(q^{4}r^{2}/t), or ϵ2/q2\epsilon^{2}/q^{2}, for t=Ω(q6r2/ϵ2)t=\Omega(q^{6}r^{2}/\epsilon^{2}), so that the error is O(ϵ/q)O(\epsilon/q).

Since the dimension of LjL_{j} is bounded by kj′k^{\prime}_{j}, it follows from the net argument of Lemma 8 that for all y∈Ljy\in L_{j}, ∥Sy∥2=∥y∥2±O(ϵ/q){\|Sy\|}^{2}={\|y\|}^{2}\pm O(\epsilon/q), and so the total error for unit y∈C(A)y\in C(A) is O(ϵ)O(\epsilon).

There is an absolute constant C′>0C^{\prime}>0 for which for any parameters δ1∈(0,1)\delta_{1}\in(0,1), P≥1P\geq 1, and for sparse embedding dimension t=O(P(r/ε)2log⁡6(r/ε))t=O(P(r/\varepsilon)^{2}\log^{6}(r/\varepsilon)), for all unit y∈C(A)y\in C(A), ∑j∈[q]∥Syj∥=1±C′ϵ/Pδ1\sum_{j\in[q]}{\|Sy^{j}\|}=1\pm C^{\prime}\epsilon/P\delta_{1}, with failure probability at most δ1+O(1/log⁡r)\delta_{1}+O(1/\log r), where yjy^{j} denotes the member of LjL_{j} derived from yy.

3 Handling the Cross Terms

To complete the optimization, we must also handle the error due to “cross terms”.

Let δ1∈(0,1)\delta_{1}\in(0,1) be an arbitrary parameter. For j≠j′∈{1,…,q}j\neq j^{\prime}\in\{1,\ldots,q\}, let the event Ej,j′\mathcal{E}_{j,j^{\prime}} be that the number of bins containing both an item in GjG_{j} and in Gj′G_{j^{\prime}} is at most njnj′q2tδ1.\frac{n_{j}n_{j^{\prime}}q^{2}}{t\delta_{1}}. Let E=∩j,j′Ej,j′\mathcal{E}=\cap_{j,j^{\prime}}\mathcal{E}_{j,j^{\prime}}, the event that no pair of groups has too many inter-group collisions.

Proof: Fix a j≠j′∈{1,…,q}j\neq j^{\prime}\in\{1,\ldots,q\}. Then the expected number of bins containing an item in both GjG_{j} and in Gj′G_{j^{\prime}} is at most t⋅njt⋅nj′t=njnj′t,t\cdot\frac{n_{j}}{t}\cdot\frac{n_{j^{\prime}}}{t}=\frac{n_{j}n_{j^{\prime}}}{t}, and so by a Markov bound the number of bins containing an item in both GjG_{j} and Gj′G_{j^{\prime}} is at most njnj′q2tδ1\frac{n_{j}n_{j^{\prime}}q^{2}}{t\delta_{1}} with probability at least 1−δ1/q21-\delta_{1}/q^{2}. The lemma follows by a union bound over the (q2){q\choose 2} choices of j,j′j,j^{\prime}.

In the remainder of the analysis, we set t=P(r/ε)2q6t=P(r/\varepsilon)^{2}q^{6} for a parameter P≥1P\geq 1. Let F\mathcal{F} be the event that no bin contains more than CqCq elements of ∪i=1qGj\cup_{i=1}^{q}G_{j}, where C>0C>0 is an absolute constant.

Proof: Observe that ∣∪i=1qGj∣=∑i=1qnj≤r∑i=1q2j≤2r2/ε2.|\cup_{i=1}^{q}G_{j}|=\sum_{i=1}^{q}n_{j}\leq r\sum_{i=1}^{q}2^{j}\leq 2r^{2}/\varepsilon^{2}. By standard balls and bins analysis with the given tt, with P≥1P\geq 1, with probability at least 1−1/r1-1/r no bin contains more than CqCq elements, for a constant C>0C>0.

Condition on events E\mathcal{E} and F\mathcal{F} occurring. Consider any unit vector y=Axy=Ax in the column space of AA. Consider any j≠j′∈[q]j\neq j^{\prime}\in[q]. Define the vector yjy^{j}: yij=yiy^{j}_{i}=y_{i} for i∈Gji\in G_{j}, and yij=0y^{j}_{i}=0 otherwise. Then,

Proof: Since E\mathcal{E} occurs, the number of bins containing both an item in GjG_{j} and Gj′G_{j^{\prime}} is at most njnj′q2/(tδ1)n_{j}n_{j^{\prime}}q^{2}/(t\delta_{1}). Call this set of bins SS. Moreover, since F\mathcal{F} occurs, for each bin i∈Si\in S, there are at most Clog⁡rC\log r elements from GjG_{j} in the bin and at most Clog⁡rC\log r elements from Gj′G_{j^{\prime}} in the bin. Hence, for any S=Φ⋅DS=\Phi\cdot D, we have, using njβj≤rn_{j}\beta_{j}\leq r for all jj,

The following is our main theorem concerning cross-terms in this section.

There is an absolute constant C′>0C^{\prime}>0 for which for any parameters δ1∈(0,1)\delta_{1}\in(0,1), P≥1P\geq 1, and for sparse embedding dimension t=O(P(r/ε)2log⁡6r)t=O(P(r/\varepsilon)^{2}\log^{6}r), the event

occurs with failure probability at most δ1+1r\delta_{1}+\frac{1}{r}, where yj,yj′y^{j},y^{j^{\prime}} are as defined in Lemma 17.

Proof: The theorem follows at once by combining Lemma 15, Lemma 16, and Lemma 17.

4 Putting it together

Putting the bounds for within-group and cross-term errors together, and replacing the use of Lemma 5 in the proof of Theorem 11, we have the following theorem.

There is an absolute constant C′>0C^{\prime}>0 for which for any parameters δ1∈(0,1)\delta_{1}\in(0,1), P≥1P\geq 1, and for sparse embedding dimension t=O(P(r/ε)2log⁡6(r/ε))t=O(P(r/\varepsilon)^{2}\log^{6}(r/\varepsilon)), for all unit y∈C(A)y\in C(A), ∥Sy∥=1±C′ϵ/Pδ1{\|Sy\|}=1\pm C^{\prime}\epsilon/P\delta_{1}, with failure probability at most δ1+O(1/log⁡r)\delta_{1}+O(1/\log r).

Generalized Sparse Embedding Matrices

Proof: We use Theorem 20 together with Lemma 8; for the latter, we need that for any fixed y∈Ly\in L, ∥By∥22=(1±ε/6)∥y∥22\|By\|_{2}^{2}=(1\pm\varepsilon/6)\|y\|_{2}^{2} with probability at least 1−δsub1-\delta_{sub}. By Theorem 20, we have this for δsub=(δε/r)CKN\delta_{sub}=(\delta\varepsilon/r)^{C_{KN}} for an arbitrarily large constant CKN>0C_{KN}>0. Hence, by Lemma 8, there is a constant Ksub>0K_{sub}>0 so that with probability at least 1−(Ksub)O(log⁡(r/εδ))(δε/r)CKN=1−(δε/r)CsubKN1-(K_{sub})^{O(\log(r/\varepsilon\delta))}(\delta\varepsilon/r)^{C_{KN}}=1-(\delta\varepsilon/r)^{C_{subKN}}, for all y∈Ly\in L, ∥By∥22=(1±ε)∥y∥22\|By\|_{2}^{2}=(1\pm\varepsilon)\|y\|_{2}^{2}. Here we use that CKN>0C_{KN}>0 can be made arbitrarily large, independent of KsubK_{sub}.

2 The construction

Let a=Θ(ε−1log⁡(r/εδ))a=\Theta(\varepsilon^{-1}\log(r/\varepsilon\delta)) and v=Θ(ε−1)v=\Theta(\varepsilon^{-1}), be such that Theorem 20 and Corollary 21 apply with parameters aa and vv, for a sufficiently large constant CsubKN>0C_{subKN}>0. Further, let

where Ct>0C_{t}>0 is a sufficiently large absolute constant, and let t≡avqt\equiv avq.

Let h:[n]→[q]h:[n]\rightarrow[q] be a random hash function. For i=1,2,…,qi=1,2,\ldots,q, define ai=∣h−1(i)∣a_{i}=|h^{-1}(i)|. Note that ∑i=1qai=n\sum_{i=1}^{q}a_{i}=n.

We choose independent matrices B(1),…,B(q)B^{(1)},\ldots,B^{(q)}, with each B(i)B^{(i)} as in Theorem 20 with parameters aa and vv. Here B(i)B^{(i)} is a va×aiva\times a_{i} matrix. Finally, let PP be an n×nn\times n permutation matrix which, when applied to a matrix AA, maps the rows of AA in the set h−1(1)h^{-1}(1) to the set of rows {1,2,…,a1}\{1,2,\ldots,a_{1}\}, maps the rows of AA in the set h−1(2)h^{-1}(2) to the set of rows {a1+1,…,a1+a2}\{a_{1}+1,\ldots,a_{1}+a_{2}\}, and for a general i∈[q]i\in[q], maps the set of rows of AA in the set h−1(i)h^{-1}(i) to the set of rows {a1+a2+⋯+ai−1+1,…,a1+a2+⋯+ai}\{a_{1}+a_{2}+\cdots+a_{i-1}+1,\ldots,a_{1}+a_{2}+\cdots+a_{i}\}.

The map SS is defined to be the product of a block-diagonal matrix and the matrix PP:

S⋅AS\cdot A can be computed in O(nnz⁡(A)(log⁡(r/εδ))/ε)O(\operatorname{\mathtt{nnz}}(A)(\log(r/\varepsilon\delta))/\varepsilon) time.

Proof: As PP is a permutation matrix, P⋅AP\cdot A can be computed in O(nnz⁡(A))O(\operatorname{\mathtt{nnz}}(A)) time and has the same number of non-zero entries of AA. For each non-zero entry of P⋅AP\cdot A, we multiply it by B(i)B^{(i)} for some ii, which takes O(a)=O(log⁡(r/εδ)/ε)O(a)=O(\log(r/\varepsilon\delta)/\varepsilon) time. Hence, the total time to compute S⋅AS\cdot A is O(nnz⁡(A)(log⁡(r/εδ))/ε)O(\operatorname{\mathtt{nnz}}(A)(\log(r/\varepsilon\delta))/\varepsilon).

3 Analysis

where CTC_{T} is a sufficiently large absolute constant.

Let s≡min⁡{i′∣ui≤T}s\equiv\min\{i^{\prime}\mid u_{i}\leq T\}, and for y′∈C(A)y^{\prime}\in C(A) of at most unit norm, let y≡ys:n′y\equiv y^{\prime}_{s:n}. Since yi2≤uiy_{i}^{2}\leq u_{i}, this implies that ∥y∥∞2≤T\|y\|_{\infty}^{2}\leq T. Since PP is a permutation matrix, we have ∥Py∥∞2≤T\|Py\|_{\infty}^{2}\leq T.

NjN_{j} is a random sparse embedding matrix with qv=t/aqv=t/a rows and nn columns.

Proof: NjN_{j} has a single non-zero entry in each column, and the value of this non-zero entry is random in {+1,−1}\{+1,-1\}. Hence, it remains to show that the distribution of locations of the non-zero entries of NjN_{j} is the same as that in a sparse embedding matrix. This follows from the distribution of the values a1,…,aqa_{1},\ldots,a_{q}, and the definition of PP.

Let δ∈(0,1)\delta\in(0,1). For j=1,…,aj=1,\ldots,a, let Ehj\mathcal{E}_{h}^{j} be the event Eh\mathcal{E}_{h} of Lemma 2, applied to matrix NjN_{j}, with δh≡δ/a\delta_{h}\equiv\delta/a, and W≡Tlog⁡(qv/δh)+r/qv≤2r/CTqW\equiv T\log(qv/\delta_{h})+r/qv\leq 2r/C_{T}q. Suppose ∩j∈[a]Ehj\cap_{j\in[a]}\mathcal{E}_{h}^{j} holds. This event has probability at least 1−δ1-\delta. Then there is an absolute constant KLK_{L} such that with failure probability at most δL\delta_{L},

Proof: We apply Lemma 3 with NjN_{j} the sparse embedding matrix ΦD\Phi D, and qvqv, the number of rows of NjN_{j}, taking on the role of tt in Lemma 2, so that the parameter W=Tlog⁡(qv/δh)+r/qvW=T\log(qv/\delta_{h})+r/qv as in the lemma statement. (And since t=avqt=avq, qv/δh=t/δqv/\delta_{h}=t/\delta, so W=r/CTq+r/qv≤2r/CTqW=r/C_{T}q+r/qv\leq 2r/C_{T}q.) Since ∥us:n∥2≤rT{\|u_{s:n}\|}^{2}\leq rT, it suffices for Lemma 2 if qvqv is at least 2rT/T2log⁡(t/δh)=2CTq2rT/T^{2}\log(t/\delta_{h})=2C_{T}q, or v≥2CTv\geq 2C_{T}.

With δh=δ/a\delta_{h}=\delta/a, by a union bound ∩j∈[a]Ehj\cap_{j\in[a]}E_{h}^{j} occurs with failure probability δ\delta, as claimed.

We have, for given NjN_{j}, that with failure probability δL/a\delta_{L}/a, ∣∥Njys:n∥2−∥ys:n∥2∣≤KLWlog⁡(a/δL)|{\|N_{j}y_{s:n}\|}^{2}-{\|y_{s:n}\|}^{2}|\leq K_{L}\sqrt{W\log(a/\delta_{L})}. Applying a union bound, and using

3.2 Vectors with large entries

Again, let s≡min⁡{i′∣ui′≤T}s\equiv\min\{i^{\prime}\mid u_{i^{\prime}}\leq T\}. Since ∑iui=r\sum_{i}u_{i}=r, we have

The following is a standard non-weighted balls-and-bins analysis.

Suppose the previously defined constant Ct>0C_{t}>0 is sufficiently large. Let Enw\mathcal{E}_{nw} be the event that ∣h−1(i)∩[s]∣≤Ctlog⁡(r/εδ)|h^{-1}(i)\cap[s]|\leq C_{t}\log(r/\varepsilon\delta), for all i∈[q]i\in[q]. Then Pr⁡[Enw]≥1−δ/r\Pr[\mathcal{E}_{nw}]\geq 1-\delta/r.

Hence, by a Chernoff bound, for a constant Ct>0C_{t}>0,

The lemma now follows by a union bound over all i∈[q]i\in[q].

Assume that Enw\mathcal{E}_{nw} holds. Let Es\mathcal{E}_{s} be the event that for all y∈C(A)y\in C(A), ∥Sy1:(s−1)∥2=(1±ε/2)∥y1:(s−1)∥2\|Sy_{1:(s-1)}\|^{2}=(1\pm\varepsilon/2)\|y_{1:(s-1)}\|^{2}. Then Pr⁡[Es]≥1−δ/r\Pr[\mathcal{E}_{s}]\geq 1-\delta/r.

Proof: For i=1,2,…,qi=1,2,\ldots,q, let LiL^{i} be the at most Ctlog⁡(r/εδ)C_{t}\log(r/\varepsilon\delta)-dimensional subspace which is the restriction of the column space C(A)C(A) to coordinates jj with h(j)=ih(j)=i and j<sj<s. By Corollary 21, for any fixed ii, with probability at least 1−(δε/r)CsubKN1-(\delta\varepsilon/r)^{C_{subKN}}, for all y∈Liy\in L^{i}, ∥Sy∥2=(1±ε)∥y∥2\|Sy\|^{2}=(1\pm\varepsilon)\|y\|^{2}. By a union bound and sufficiently large CsubKN>0C_{subKN}>0, this holds for all i∈[q]i\in[q] with probability at least 1−q(δε/r)CsubKN>1−δ/r1-q(\delta\varepsilon/r)^{C_{subKN}}>1-\delta/r. This condition implies Es\mathcal{E}_{s}, since y1:(s−1)y_{1:(s-1)} can be expressed as ∑i∈[q]y(i)\sum_{i\in[q]}y^{(i)}, where each y(i)∈Liy^{(i)}\in L^{i}, and letting B^(i)\hat{B}^{(i)} denote the vava rows of SS corresponding to entries from B(i)B^{(i)},

A re-scaling to ε/2\varepsilon/2 completes the proof.

4 Putting it all together

where by Lemma 23, each NjN_{j} is a sparse embedding matrix with qv=t/aqv=t/a rows and nn columns.

For WW as in Lemma 24, and assuming events ∩j=1aEhj\cap_{j=1}^{a}\mathcal{E}_{h}^{j}, Enw\mathcal{E}_{nw}, and Es\mathcal{E}_{s}, there is absolute constant KCK_{C} such that with failure probability δC\delta_{C},

Proof: We generalize Lemma 6 slightly to bound each summand ⟨Njy1:(s−1),Njys:n⟩\langle N_{j}y_{1:(s-1)},N_{j}y_{s:n}\rangle.

For a given jj, and for each i≥si\geq s, let

where hjh_{j} is the hash function for Φ(j)P\Phi^{(j)}P. We have for integer p≥1p\geq 1 using Khintchine’s inequality,

where Vj≡∑m∈hj−1([s−1])zm2V_{j}\equiv\sum_{m\in h_{j}^{-1}([s-1])}z_{m}^{2}, and Cp≤Γ(p+1/2)1/p=O(p)C_{p}\leq\Gamma(p+1/2)^{1/p}=O(p), and the last inequality uses the assumption that Ehj\mathcal{E}^{j}_{h} holds. Putting p=log⁡(a/δC)p=\log(a/\delta_{C}) and applying the Markov inequality, we have for all j∈[a]j\in[a] that

Moreover, 1a∑j∈[a]Vj=∥Sy1:(s−1)∥2\frac{1}{a}\sum_{j\in[a]}V_{j}={\|Sy_{1:(s-1)}\|}^{2}, which under Es\mathcal{E}_{s} is at most (1+ε/2)∥y1:(s−1)∥2≤1+ε/2(1+\varepsilon/2){\|y_{1:(s-1)}\|}^{2}\leq 1+\varepsilon/2. Therefore, with failure probability at most δC\delta_{C}, we have

The following is our main theorem in this section.

For given δ>0\delta>0, with probability at least 1−δ1-\delta, for t=O(rε−4log⁡(r/εδ)(r+log⁡(1/εδ)))t=O(r\varepsilon^{-4}\log(r/\varepsilon\delta)(r+\log(1/\varepsilon\delta))), SS is an embedding matrix for AA; that is, for all y∈C(A)y\in C(A), ∥Sy∥2=(1±ε)∥y∥2\|Sy\|_{2}=(1\pm\varepsilon)\|y\|_{2}. SS can be applied to AA in O(nnz⁡(A)ϵ−1log⁡(r/δ))O(\operatorname{\mathtt{nnz}}(A)\epsilon^{-1}\log(r/\delta)) time.

yielding the bound claimed. From Lemma 24, event ∩j∈[a]Ehj\cap_{j\in[a]}\mathcal{E}^{j}_{h} occurs with failure probability at most δ\delta. From Lemma 25 and 26 the joint occurrence of Enw\mathcal{E}_{nw} and Es\mathcal{E}_{s} holds with failure probability at most 2δ/r≤δ2\delta/r\leq\delta. Given these events, from Lemmas 27 and 24, we have with failure probability at most δL+δC\delta_{L}+\delta_{C} that

Setting δC=δL=δKsub−r\delta_{C}=\delta_{L}=\delta K_{sub}^{-r}, where KsubK_{sub} is from Lemma 8, and recalling that a=O(ε−1log⁡(r/εδ))a=O(\varepsilon^{-1}\log(r/\varepsilon\delta)), we have

for absolute constant CT′C^{\prime}_{T}. Using Lemma 8, we have that with failure probability at most δ+δ+Ksubr(2δKsub−r)≤4δ\delta+\delta+K_{sub}^{r}(2\delta K_{sub}^{-r})\leq 4\delta, that

for suitable choice of CT′C^{\prime}_{T}. Adjusting δ\delta by a constant factor gives the result.

Approximating Leverage Scores

For any constant ε>0\varepsilon>0, there is an algorithm which with probability at least 2/32/3, outputs a vector (u1′,…,un′)(u_{1}^{\prime},\ldots,u_{n}^{\prime}) so that for all i∈[n]i\in[n], ui′=(1±ε)uiu_{i}^{\prime}=(1\pm\varepsilon)u_{i}. The running time is

The success probability can be amplified by independent repetition and taking the coordinate-wise median of the vectors u′u^{\prime} across the repetitions.

Proof: We first run the algorithm of Theorem 2.6 and Theorem 2.7 of . The first theorem gives an algorithm which outputs the rank rr of AA, while the second theorem gives an algorithm which also outputs the indices i1,…,iri_{1},\ldots,i_{r} of linearly independent columns of AA. The algorithm takes O(nnz⁡(A)log⁡d)+O(r3)O(\operatorname{\mathtt{nnz}}(A)\log d)+O(r^{3}) time and succeeds with probability at least 1−O(log⁡d)/d1/31-O(\log d)/d^{1/3}. Hence, in what follows, we can assume that AA has full rank.

We follow the same procedure as Algorithm 1 in , using our improved subspace embedding. The proof of proceeds by choosing a subspace embedding Π1\Pi_{1}, computing Π1A\Pi_{1}A, then computing a change of basis matrix RR so that Π1AR\Pi_{1}AR has orthonormal columns. The analysis there then shows that the row norms ∥(AR)i,∗∥22\|(AR)_{i,*}\|_{2}^{2} are equal to ui(1±ε)u_{i}(1\pm\varepsilon). To obtain these row norms quickly, an r×O(log⁡n)r\times O(\log n) Johnson-Lindenstrauss matrix Π2\Pi_{2} is sampled, and one first computes RΠ2R\Pi_{2}, followed by A(RΠ2)A(R\Pi_{2}). Using a fast Johnson-Lindenstrauss transform Π1\Pi_{1}, one can compute Π1A\Pi_{1}A in O(nrlog⁡n)O(nr\log n) time. Π1\Pi_{1} has O(rlog⁡nlog⁡r)O(r\log n\log r) rows, and one can compute the r×rr\times r matrix RR in O(r3log⁡nlog⁡r)O(r^{3}\log n\log r) time by computing a QR-factorization. Computing RΠ2R\Pi_{2} can be done in O(r2log⁡n)O(r^{2}\log n) time, and computing A(RΠ2)A(R\Pi_{2}) can be done in O(nnz⁡(A)log⁡n)O(\operatorname{\mathtt{nnz}}(A)\log n) time.

Our only change to this procedure is to use a different matrix Π1\Pi_{1}, which is the composition of our subspace embedding matrix SS of Theorem 28 with parameter t=O(r2log⁡r)t=O(r^{2}\log r), together with a fast Johnson Lindenstrauss transform FF. That is, we set Π1=F⋅S\Pi_{1}=F\cdot S. Here, FF is an O(rlog⁡2r)×tO(r\log^{2}r)\times t matrix, see Section 2.3 of for an instantiation of FF. Then, S⋅AS\cdot A can be computed in O(nnz⁡(A)log⁡r)O(\operatorname{\mathtt{nnz}}(A)\log r) time by Lemma 22. Moreover, F⋅(SA)F\cdot(SA) can be computed in O(t⋅rlog⁡r)=O(r3log⁡2r)O(t\cdot r\log r)=O(r^{3}\log^{2}r) time. One can then compute the matrix RR above in O(r3log⁡2r)O(r^{3}\log^{2}r) time by computing a QR-factorization of FSAFSA. Then one can compute RΠ2R\Pi_{2} in O(r2log⁡n)O(r^{2}\log n) time, and computing A(RΠ2)A(R\Pi_{2}) can be done in O(nnz⁡(A)log⁡n)O(\operatorname{\mathtt{nnz}}(A)\log n) time. Hence, the total time is O(nnz⁡(A)log⁡n+r3log⁡2r+r2log⁡n)O(\operatorname{\mathtt{nnz}}(A)\log n+r^{3}\log^{2}r+r^{2}\log n) time.

The rest of the correctness proof is identical to the analysis in .

Least Squares Regression

We will give several different algorithms. First, we give an algorithm showing that the dependence on nnz⁡(A)\operatorname{\mathtt{nnz}}(A) can be linear. Next we shift to the generalized case, with multiple right-hand-sides, and after some analytical preliminaries, give an algorithm based on sampling using leverage scores. Finally, we discuss affine embeddings, constrained regression, and iterative methods.

Proof: By Theorem 11 applied to the column space C(A∘b)C(A\circ b), where A∘bA\circ b is AA adjoined with the vector bb, it suffices to compute ΦDA\Phi DA and ΦDb\Phi Db and output argminx∥ΦDAx−ΦDb∥2{}_{x}{\|\Phi DAx-\Phi Db\|}_{2}. We use the fact that d≥rd\geq r, and apply Theorem 19 with t=O(d2ε−2log⁡6(d/ε))t=O(d^{2}\varepsilon^{-2}\log^{6}(d/\varepsilon)).

The theorem implies that with probability at least 9/109/10, all vectors yy in the space spanned by the columns of AA and bb have their norms preserved up to a (1+ε)(1+\varepsilon)-factor. Notice that ΦDA\Phi DA and ΦDb\Phi Db can be computed in O(nnz⁡(A))O(\operatorname{\mathtt{nnz}}(A)) time. Now we have a regression problem with d′=O(d2ε−2log⁡6(d/ε))d^{\prime}=O(d^{2}\varepsilon^{-2}\log^{6}(d/\varepsilon)) rows and dd columns. Using the Fast Johnson-Lindenstrauss transform, this can be solved in O(d′dlog⁡(d/ε)+d3ε−1log⁡d)O(d^{\prime}d\log(d/\varepsilon)+d^{3}\varepsilon^{-1}\log d) time, see, Theorem 12 of . The success probability is at least 9/109/10. This is O(d3ε−2log⁡7(d/ε))O(d^{3}\varepsilon^{-2}\log^{7}(d/\varepsilon)) time.

Our remaining algorithms will be stated for generalized regression.

The regression problem can be slightly generalized to

where XX and BB are matrices rather than vectors. This problem, also called multiple-response regression, is important in the analysis of our low-rank approximation algorithms, and also of independent interest. Moreover, while an analysis involving the embedding of A∘bA\circ b is not significantly different than for an embedding involving AA alone, this is not true for A∘BA\circ B: different techniques must be considered. This subsection gives the needed theorems needed for analyzing algorithms for generalized regression, and also gives a general result for affine embeddings.

The following fact is due to Rudelson, but has since seen many proofs, and follows readily from Noncommutative Bernstein inequalities , which are very similar to matrix Bernstein inequalities .

2 Preliminaries

We collect a few standard lemmas and facts in this subsection.

(Approximate Matrix Multiplication) For AA and BB matrices with nn rows, where AA has nn columns, and given ϵ>0\epsilon>0, there is t=Θ(ϵ−2)t=\Theta(\epsilon^{-2}), so that for a t×nt\times n generalized sparse embedding matrix SS, or t×nt\times n fast JL matrix, or tlog⁡(nd)×nt\log(nd)\times n subsampled randomized Hadamard matrix, or leverage-score sketching matrix for AA under the condition that AA has orthonormal columns,

Proof: For a generalized sparse embedding matrix with parameters kk and vv, first suppose v=1v=1, so that SS is the embedding matrix of §2. Let X=A⊤S⊤SB−ABX=A^{\top}S^{\top}SB-AB. Then Xi,j=Ai⊤S⊤SBj−Ai⊤BjX_{i,j}=A_{i}^{\top}S^{\top}SB_{j}-A_{i}^{\top}B_{j}, where AiA_{i} is the ii-th column of AA and BjB_{j} is the jj-th column of BB. Thorup and Zhang have shown that E[Xi,j]=0{\bf E}[X_{i,j}]=0 and Var[Xi,j]=O(1/t)∥Ai∥22∥Bj∥22.{\bf Var}[X_{i,j}]=O(1/t){\|A_{i}\|}_{2}^{2}{\|B_{j}\|}_{2}^{2}. Consequently, E[Xi,j2]=Var[Xi,j]=O(1/t)⋅∥Ai∥22∥Bj∥22,{\bf E}[X_{i,j}^{2}]={\bf Var}[X_{i,j}]=O(1/t)\cdot{\|A_{i}\|}_{2}^{2}{\|B_{j}\|}_{2}^{2}, from which for an appropriate t=Θ(ϵ−2)t=\Theta(\epsilon^{-2}), the lemma follows by Chebyshev’s inequality. For v>1v>1, Xi,j=vt∑i∈[t/v]X^i,jX_{i,j}=\frac{v}{t}\sum_{i\in[t/v]}\hat{X}_{i,j}, see (5.4), so that‘

and similarly the lemma follows for the sparse embedding matrices. The result for fast JL matrices was shown by Sarlós, and for subsampled Hadamard by Drineas et al., proof of Lemma 5. (The claim also follows from norm-preserving properties of these transforms, see .)

For leverage-score sampling, first note that

we have E⁡[A⊤S⊤SB−A⊤B]=0\operatorname{\mathbf{E}}[A^{\top}S^{\top}SB-A^{\top}B]=0, and using the independence of the zmz_{m}, the second moment of ∥A⊤S⊤SB−A⊤B∥F{\|A^{\top}S^{\top}SB-A^{\top}B\|}_{F} is the expectation of

or using the cyclic property of the trace, the fact that pi≥∥Ai,∗∥2/2∥A∥2p_{i}\geq{\|A_{i,*}\|}^{2}/2{\|A\|}^{2}, and the fact that tr⁡[B⊤AA⊤B]=∥A⊤B∥2≤∥A∥2∥B∥2\operatorname{\mathtt{tr}}[B^{\top}AA^{\top}B]={\|A^{\top}B\|}^{2}\leq{\|A\|}^{2}{\|B\|}^{2},

and so the lemma follows for large enough tt in O(ε−2)O(\varepsilon^{-2}), by Chebyshev’s inequality.

Given n×dn\times d matrix AA of rank k≤n1/2−γk\leq n^{1/2-\gamma} for γ>0\gamma>0, and ϵ>0\epsilon>0, an m×nm\times n fast JL matrix Π\Pi with m=Θ(k/ϵ2)m=\Theta(k/\epsilon^{2}) is a subspace embedding for AA with failure probability at most δ\delta, for any fixed δ>0\delta>0, and requires O(ndlog⁡n)O(nd\log n) time to apply to AA.

A similar fact holds for subsampled Hadamard transforms.

(Pythagorean Theorem) If CC and DD matrices with the same number of rows and columns, then C⊤D=0C^{\top}D=0 implies ∥C+D∥F2=∥C∥F2+∥D∥F2{\|C+D\|}_{F}^{2}={\|C\|}_{F}^{2}+{\|D\|}_{F}^{2}.

(Normal Equations) Given n×dn\times d matrix CC, and n×d′n\times d^{\prime} matrix DD consider the problem

The solution to this problem is X∗=C−DX^{*}=C^{-}D, where C−C^{-} is the Moore-Penrose inverse of CC. Moreover, C⊤(CX∗−D)=0C^{\top}(CX^{*}-D)=0, and so if cc is any vector in the column space of CC, then c⊤(CX∗−D)=0c^{\top}(CX^{*}-D)=0. Using Fact 34, for any XX,

3 Generalized Regression: Conditions

The main theorem in this subsection is the following. It could be regarded as a generalization of Lemma 1 of .

Before proving Theorem 36, we will need the following lemma.

and taking square roots and adjusting ε\varepsilon by a constant factor completes the proof.

4 Generalized Regression: Algorithm

Our main algorithm for regression is given in the proof of the following theorem.

and obtaining a coreset of size O(r(ε−1+log⁡r))O(r(\varepsilon^{-1}+\log r)).

Proof: We estimate the leverage scores of AA to relative error 1/21/2, using the algorithm of Theorem 29, which has the side effect of finding rr independent columns of AA, so that we can assume that d=rd=r.

If UU is a basis for C(A)C(A), then for any XX there is a YY so that UX=AYUX=AY, and vice versa, so that conditions satisfied by UXUX are satisfied by AYAY. That is, we can (and will hereafter) assume that AA has rr orthonormal columns, when considering products AYAY.

5 Affine Embeddings

We also use affine embeddings for which a stronger condition than Theorem 36 is satisfied.

and SS is a 3ε3\varepsilon-affine embedding.

Note that even when only the weaker first statement holds, the sketch still can be used for optimization, since adding a constant to the objective function of an optimization does not change the solution. Note also that

Proof: If UU is a basis for C(A)C(A), then for any XX there is a YY so that UX=AYUX=AY, and vice versa, so that conditions satisfied by UXUX are satisfied by AYAY. That is, we can (and will hereafter) assume that AA has rr orthonormal columns.

Using the fact that ∥W∥2=tr⁡W⊤W{\|W\|}^{2}=\operatorname{\mathtt{tr}}W^{\top}W for any WW, the embedding property, the fact that ∥A∥≤r{\|A\|}\leq\sqrt{r}, and the matrix product approximation condition of Lemma 32,

To apply this theorem to sparse embeddings, we will need the following lemma.

Note that none of the dimensions tt depend on the number of columns of BB.

Regarding the multiplicative error bound of ϵ/r\epsilon/\sqrt{r}, Lemma 32 tells us that SRHT achieves this bound for t=O(log⁡(n)2ε−2r)t=O(\log(n)^{2}\varepsilon^{-2}r), and the other two need t=O(ε−2r)t=O(\varepsilon^{-2}r).

Regarding subspace embedding, as noted in the introduction, an SRHT matrix achieves this for t=O(ε−2(log⁡r)(r+log⁡n)2)t=O(\varepsilon^{-2}(\log r)(\sqrt{r}+\sqrt{\log n})^{2}). A sparse embedding requires t=O(ε−2r2log⁡6(r/ε))t=O(\varepsilon^{-2}r^{2}\log^{6}(r/\varepsilon)), as in Theorem 19, and leverage score samplers need t=O(ε−2rlog⁡r)t=O(\varepsilon^{-2}r\log r), as mentioned in Fact 31.

Thus the conditions are satisfied for Theorem 39 to yield the the claims for SRHT and for sparse embeddings, and for the weak condition for leverage score samplers.

6 Affine Embeddings and Constrained Regression

yielding an immediate reduction yielding a solution with relative error ε\varepsilon: just solve the sketched version of the problem.

For low-rank approximation, discussed in §8, we require XX to satisfy a rank condition; the same techniques apply.

7 Iterative Methods for Regression

Another approach to regression is to apply an iterative method (from the general class of Krylov, CG-like methods) to a pre-conditioned version of the problem. In such methods, an estimate x(m)x^{(m)} of a solution is maintained, for iterations m=0,1…m=0,1\ldots, using data obtained from previous iterations. The convergence of these methods depends on the condition number κ(A⊤A)=sup⁡x,∥x∥=1∥Ax∥2inf⁡x,∥x∥=1∥Ax∥2\kappa(A^{\top}A)=\frac{\sup_{x,{\|x\|}=1}{\|Ax\|}^{2}}{\inf_{x,{\|x\|}=1}{\|Ax\|}^{2}} from the input matrix. A classical result ( via or Theorem 10.2.6,), is that

Thus the running time of CG-like methods, such as CGNR , depends on the (unknown) condition number. The running time per iteration is the time needed to compute matrix vector products AxAx and A⊤vA^{\top}v, plus O(n+d)O(n+d) for vector arithmetic, or O(nnz⁡(A))O(\operatorname{\mathtt{nnz}}(A)).

Pre-conditioning reduces the number of iterations needed for a given accuracy: suppose for non-singular matrix RR, the condition number κ(R⊤A⊤AR)\kappa(R^{\top}A^{\top}AR) is small. Then a CG-like method applied to ARAR would converge quickly, and moreover for iterate y(m)y^{(m)} that has error α(m)≡∥ARy(m)−b∥\alpha^{(m)}\equiv{\|ARy^{(m)}-b\|} small, the corresponding x←Ry(m)x\leftarrow Ry^{(m)} would have ∥Ax−b∥=α(m){\|Ax-b\|}=\alpha^{(m)}. The running time per iteration would have an additional O(d2)O(d^{2}) for computing products involving RR.

That is, ARAR is very well-conditioned. Plugging this bound into (10), after mm iterations ∥AR(x(m)−x∗)∥2{\|AR(x^{(m)}-x^{*})\|}^{2} is at most 2ε0m2\varepsilon_{0}^{m} times its starting value.

Thus starting with a solution x(0)x^{(0)} with relative error at most 1, and applying 1+log⁡(1/ε)1+\log(1/\varepsilon) iterations of a CG-like method with ε0=1/e\varepsilon_{0}=1/e, the relative error is reduced to ε\varepsilon and the work is O((nnz⁡(A)+r2)log⁡(1/ε))O((\operatorname{\mathtt{nnz}}(A)+r^{2})\log(1/\varepsilon)) (where we assume dd has been reduced to rr, as in the leverage computation), plus the work to find RR. We have

Note that only the matrix RR from the leverage score computation is needed, not the leverage scores, so the nnz⁡(A)\operatorname{\mathtt{nnz}}(A) term in the running time need not have a log⁡(n)\log(n) factor; however, since reducing AA to rr columns requires that factor, the resulting running time without that factor is O(nnz⁡(A)log⁡(1/ε)+d3log⁡2d+d2log⁡(1/ε))O(\operatorname{\mathtt{nnz}}(A)\log(1/\varepsilon)+d^{3}\log^{2}d+d^{2}\log(1/\varepsilon)), depends on dd.

The matrix ARAR is so well-conditioned that a simple iterative improvement scheme has the same running time up to a constant factor. Again start with a solution x(0)x^{(0)} with relative error at most 1, and for m≥0m\geq 0, let x(m+1)←x(m)+R⊤A⊤(b−ARx(m))x^{(m+1)}\leftarrow x^{(m)}+R^{\top}A^{\top}(b-ARx^{(m)}). Then using the normal equations,

where AR=UΣV⊤AR=U\Sigma V^{\top} is the SVD of ARAR.

and by choosing ϵ0=1/2\epsilon_{0}=1/2, say, O(log⁡(1/ε))O(\log(1/\varepsilon)) iterations suffice for this scheme also to attain ε\varepsilon relative error.

That is, this method is never much worse than CG-like methods, but comparable in running time when d′<rd^{\prime}<r; when d′>rd^{\prime}>r, it is a little worse in asymptotic running time than solving the normal equations.

Low Rank Approximation

This section gives algorithms for low-rank approximation, understood using generalized regression analysis, as in earlier work such as . Let Δk≡∥A−[A]k∥F\Delta_{k}\equiv{\|A-[A]_{k}\|}_{F}, where [A]k[A]_{k} denotes the best rank-kk approximation to AA. We seek low-rank matrices whose distance to AA is within 1+ε1+\varepsilon of Δk\Delta_{k}.

While Theorem 11 and Theorem 28 are stated in terms of specific constant probability of success, they can be re-stated and proven so that the failure probabilities are arbitrarily small, but still constant. In the following we’ll assume that adjustments have been done, so that the sum of a fixed number of such failure probabilities is at most 1/51/5.

We will apply embedding matrices composed of products of such matrices, so we need to check that this operation preserves the properties we need.

Proof: This follows from two applications of Lemma 32, together with the observation that ∥SAx∥=(1±ϵ)∥Ax∥{\|SAx\|}=(1\pm\epsilon){\|Ax\|} for basis vectors xx implies that ∥SA∥=(1±ϵ)∥A∥{\|SA\|}=(1\pm\epsilon){\|A\|}.

The following lemma implies a regression algorithm that is linear in nnz⁡(A)\operatorname{\mathtt{nnz}}(A), but has a worse dependence in its additive term.

Compute AR⊤AR^{\top} and an orthonormal basis UU for C(AR⊤)C(AR^{\top}), where RR is as in Lemma 46 with r=kr=k;

Compute SUSU and SASA for SS the product of a v′×vv^{\prime}\times v SRHT matrix with a v×nv\times n sparse embedding, where v=Θ(ε−4k2log⁡6(k/ε))v=\Theta(\varepsilon^{-4}k^{2}\log^{6}(k/\varepsilon)) and v′=Θ(ε−3klog⁡2(k/ε))v^{\prime}=\Theta(\varepsilon^{-3}k\log^{2}(k/\varepsilon)). (Instead of this affine embedding construction, an alternative might use leverage score sampling, where even the weaker claim of Theorem 42 would be enough.)

using (8). From lemma 4.3 of , the solution to

Here pp is any constant in [1,∞)[1,\infty).

As in the proof of Theorem 29, in O(nnz⁡(A)log⁡d)+O(r3)O(\operatorname{\mathtt{nnz}}(A)\log d)+O(r^{3}) time we can replace the input matrix AA with a new matrix with the same column space of AA and full column rank, where rr is rank of AA. We therefore assume AA has full rank in what follows.

Let w=Θ(r6log⁡n(r+log⁡n))w=\Theta(r^{6}\log n(r+\log n)) and assume w∣nw\mid n. Split AA into n/wn/w matrices A1,…,An/wA_{1},\ldots,A_{n/w}, each w×rw\times r, so that AiA_{i} is the submatrix of AA indexed by the ii-th block of ww rows.

We invoke Theorem 28 with the parameters n=wn=w, rr, ε=1/2\varepsilon=1/2, and δ=1/(100n)\delta=1/(100n), choosing a generalized sparse embedding matrix matrix SS with t=O(rlog⁡n(r+log⁡n))t=O(r\log n(r+\log n)) rows. Theorem 28 has the guarantee that for each fixed ii, SAiSA_{i} is a subspace embedding with probability at least 1−δ1-\delta. It follows by a union bound that with probability at least 1−1/(100w)1-1/(100w), for all i∈[n/w]i\in[n/w], SAiSA_{i} is a subspace embedding. We condition on this event occurring.

Let AA be an n×rn\times r matrix, and let p∈[1,∞)p\in[1,\infty). Then there exists an (α,β,p)(\alpha,\beta,p)-well-conditioned basis for the column space of AA such that if p<2p<2, then α=r1/2+1/p\alpha=r^{1/2+1/p} and β=1\beta=1; if p=2p=2, then α=r1/2\alpha=r^{1/2} and β=1\beta=1, and if p>2p>2 then α=r1/2+1/p\alpha=r^{1/2+1/p} and β=r1/2−1/p\beta=r^{1/2-1/p}. An r×rr\times r change of basis matrix UU for which A⋅UA\cdot U is a well-conditioned basis can be computed in O(nr5log⁡n)O(nr^{5}\log n) time.

Apply Theorem 48 to FAFA to obtain an r×rr\times r change of basis matrix UU so that FAUFAU is an (α,β,p)(\alpha,\beta,p)-well-conditioned basis of the column space of matrix FAFA;

Output AU/(rγp)AU/(r\gamma_{p}), where γp≡2t1/p−1/2\gamma_{p}\equiv\sqrt{2}t^{1/p-1/2} for p≤2p\leq 2, and γp≡2w1/2−1/p\gamma_{p}\equiv\sqrt{2}w^{1/2-1/p} for p≥2p\geq 2.

The following lemma is the analogue of that in proved for the Fast Johnson Lindenstauss Transform. However, the proof in only used that the Fast Johnson Lindenstrauss Transform is a subspace embedding. We state it here with our new parameters, and give the analogous proof in the Appendix for completeness.

while the leading term in the complexity (for n≫rn\gg r) is reduced from O(nr5log⁡n)O(nr^{5}\log n) to O(nnz⁡(A)log⁡n)O(\operatorname{\mathtt{nnz}}(A)\log n).

We adjust Theorem 4.1 of and obtain the following.

Preliminary Experiments

Some preliminary experiments show that a low-rank approximation technique that is a simplified version of these algorithms is promising, and in practice may perform much better than the general bounds of our results.

Here we apply the algorithm of Theorem 47, except that we skip the randomized Hadamard and simply use a sparse embedding R^\hat{R} and leverage score sampling. We compare the Frobenius error of the resulting LDW⊤LDW^{\top} with that of the best rank-kk approximation.

In our experiments, the matrices tested are n×dn\times d.

The resulting low-rank approximation was tested for tRt_{R} (the number of columns of R^\hat{R}) taking values of the form⌊1.6z−0.5⌋\lfloor 1.6^{z}-0.5\rfloor, for integer z≥1z\geq 1, while tR≤d/5t_{R}\leq d/5. The number tSt_{S} of rows of SS was chosen such that the condition number of SUSU was at most 1.21.2. (Since UU has orthogonal columns, its condition number is 1, so a large enough leverage score sample will have this property.) For such tRt_{R} and tSt_{S}, we took the ratio ReR_{e} of the Frobenius norm of the error to the Frobenius norm of the error of the best rank-kk approximation. The resulting points (k/tR,Re−1)(k/t_{R},R_{e}-1) were generated, for all test matrices, for three independent trials, resulting in a set of points PP.

The test matrices are from the University of Florida Sparse Matrix Collection, essentially most of those with at most 10510^{5} nonzero entries, and with nn up to about 7000. There were 1155 matrices tested, from 70 sub-collections of matrices, each such sub-collection representing a particular application area.

The curve in Figure 1 represents the results of these tests, where for a particular point (x,y)(x,y) on the curve, at most one percent of points (t/kR,Re−1)∈P(t/k_{R},R_{e}-1)\in P gave a result where k/tR<xk/t_{R}<x but Re−1>yR_{e}-1>y.

Acknowledgements

We acknowledge the support from XDATA program of the Defense Advanced Research Projects Agency (DARPA), administered through Air Force Research Laboratory contract FA8750-12-C-0323. We thank Jelani Nelson and the anonymous STOC referees for helpful comments.

References

Appendix A Deferred proofs

To bound ∥β∥F{\|\beta\|}_{F}, we bound ∥A⊤S⊤SAβ∥F{\|A^{\top}S^{\top}SA\beta\|}_{F}, and then show that this implies that ∥β∥F{\|\beta\|}_{F} is small. Using that AA⊤A=AAA^{\top}A=A and (12), we have

To show that this bound implies that ∥β∥F{\|\beta\|}_{F} is small, we use the subadditivity of ∥∥F{\|\|}_{F} and the property of any conforming matrices CC and DD, that ∥CD∥F≤∥C∥2∥D∥F{\|CD\|}_{F}\leq{\|C\|}_{2}{\|D\|}_{F}, to obtain

By hypothesis, ∥SAx∥2=(1±ϵ0)∥x∥2{\|SAx\|}^{2}=(1\pm\epsilon_{0}){\|x\|}^{2} for all xx, so that A⊤S⊤SA−IA^{\top}S^{\top}SA-I has eigenvalues bounded in magnitude by ϵ02\epsilon_{0}^{2}, which implies singular values with the same bound, so that ∥A⊤S⊤SA−I∥2≤ϵ02{\|A^{\top}S^{\top}SA-I\|}_{2}\leq\epsilon^{2}_{0}. Thus ∥β∥F≤ϵ∥B−AX∗∥F+ϵ02∥β∥F{\|\beta\|}_{F}\leq\sqrt{\epsilon}{\|B-AX^{*}\|}_{F}+\epsilon^{2}_{0}{\|\beta\|}_{F}, or

since ϵ02≤1/2\epsilon^{2}_{0}\leq 1/2. This bounds ∥β∥F{\|\beta\|}_{F}, and so proves the lemma.

We handle the first term in (14) as follows:

For the second term in (14), for i≠j∈[d]i\neq j\in[d],

Combining (13) with (14) and the bounds on the terms in (14) above,

The lemma now follows by Chebyshev’s inequality, for appropriate t=Ω(ε−2)t=\Omega(\varepsilon^{-2}).

Proof of Lemma 41: Lemma 15 of shows that ∥SA∥≤(1+ε)∥A∥{\|SA\|}\leq(1+\varepsilon){\|A\|} with arbitrarily low failure probability, and the other direction follows from a similar argument. Briefly: the expectation of ∥SA∥2{\|SA\|}^{2} is ∥A∥2{\|A\|}^{2}, by construction, and Lemma 11 of implies that with arbitrarily small failure probability, all rows of SASA will have squared norm at most β≡αt∥A∥2\beta\equiv\frac{\alpha}{t}{\|A\|}^{2}, where α\alpha is a value in O(log⁡n)O(\log n). Assuming that this bound holds, it follows from Hoeffding’s inequality that the probability that ∣∥SA∥2−∥A∥2∣≥ε∥A∥2|{\|SA\|}^{2}-{\|A\|}^{2}|\geq\varepsilon{\|A\|}^{2} is at most 2exp⁡(−2[ε∥A∥2]2/tβ2)2\exp(-2[\varepsilon{\|A\|}^{2}]^{2}/t\beta^{2}), or 2exp⁡(−2ε2t/α2)2\exp(-2\varepsilon^{2}t/\alpha^{2}), so that t=Θ(ε−2(log⁡n)2)t=\Theta(\varepsilon^{-2}(\log n)^{2}) suffices to make the failure probability at most 1/101/10.

By relating the 22-norm and the pp-norm, for 1≤p≤21\leq p\leq 2, we have

Since ∥Ax∥pp=∥y∥pp=∑i∥zi∥p{\|Ax\|}_{p}^{p}={\|y\|}_{p}^{p}=\sum_{i}{\|z_{i}\|}^{p} and ∥FAx∥pp=∑i∥Szi∥pp{\|FAx\|}_{p}^{p}=\sum_{i}{\|Sz_{i}\|}_{p}^{p}, for p∈p\in we have with probability 1−1/(100w)1-1/(100w)

and for p∈[2,∞)p\in[2,\infty) with probability 1−1/(100w)1-1/(100w)

Applying Theorem 48, we have, from the definition of a (α,β,p)(\alpha,\beta,p)-well-conditioned basis, that

Combining (15) and (16), we have that with probability at least 1−1/(100w)1-1/(100w),

Hence AU/(rγp)AU/(r\gamma_{p}) is an (α,β3r(tw)∣1/p−1/2∣,p)(\alpha,\beta\sqrt{3}r(tw)^{|1/p-1/2|},p)-well-conditioned basis. The time to compute FAFA is O(nnz⁡(A)log⁡n)O(\operatorname{\mathtt{nnz}}(A)\log n) by Theorem 28. Notice that FAFA is an nt/w×nnt/w\times n matrix, which is O(n/r5)×rO(n/r^{5})\times r, and so the time to compute UU from FAFA is O((n/r5)r5log⁡n)=O(nnz⁡(A)log⁡n)O((n/r^{5})r^{5}\log n)=O(\operatorname{\mathtt{nnz}}(A)\log n), since nnz⁡(A)≥n\operatorname{\mathtt{nnz}}(A)\geq n.