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 matrix with , one can write in its singular value decomposition, where the columns of are the left singular vectors, is a diagonal matrix, and the columns of are the right singular vectors. Although has orthonormal columns, not much can be immediately said about the squared lengths of its rows. These values are known as the leverage scores, and measure the extent to which the singular vectors of 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 ; 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 , output a constant factor approximation to . Using randomization, this can be solved in 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 for various vectors ; in the most common setting, such products require time. Thus the work per iteration of these methods is , and the number of iterations that are performed depends on the desired accuracy, spectral properties of , numerical stability issues, and other concerns, and can be large. A recent survey suggests that is typically for Krylov methods (such as Arnoldi and Lanczos iterations) to approximate the 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 , sometimes up to a log factor, with constant factors that are independent of any numerical properties of . 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, has a single randomly chosen non-zero entry in each column , for a random mapping . With probability , , and with probability , .
We stress that our choice of matrices does not preserve the norms of an arbitrary set of vectors with high probability, and so the above approach cannot work for our choice of matrices . We instead critically use that these vectors all come from a -dimensional subspace (namely, ), and therefore have a very special structure. The structural fact we use is that there is a fixed set of size which depends only on the subspace, such that for any unit vector , contains the indices of all coordinates of larger than in magnitude. The key property here is that the set is independent of , 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 selects exactly the set of large leverage scores of the columns space !
Given this observation, by setting for a large enough constant , we have that with probability , there are no two distinct with for which . That is, we avoid the birthday paradox, and the coordinates in are “perfectly hashed” with large probability. Call this event , which we condition on.
Given a unit vector in the subspace, we can write it as , where consists of with the coordinates in replaced with , while consists of with the coordinates in replaced with . We seek to bound
Finally, we can bound as follows. Define to be the set of coordinates for which for a coordinate , that is, those coordinates in which “collide” with an element of . Then, , where is a vector which agrees with on coordinates , and is on the remaining coordinates. By Cauchy-Schwarz, this is at most . We have already argued that for unit vectors . Moreover, we can again apply Theorem 2 of to bound , since, conditioned on the coordinates of hashing to the set of items that the coordinates of hash to, they are otherwise random, and so we again have a mapping of our form (with a smaller and applied to a smaller ) applied to a vector with small infinity-norm. Therefore, with high probability. Finally, by Bernstein bounds, since the coordinates of are small and is sufficiently large, with high probability. Hence, conditioned on event , with probability , 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 and for every , is small then the remainder of the analysis of does not require that be small. Since our vectors come from a subspace, it suffices to show that for every , is small, where is the -th leverage score of . Therefore we do not need to perform this analysis for each , but can condition on a single event, and this effectively allows us to increase in the outline above, thereby reducing the size of , and also the size of since we have . 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 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 -approximation to least squares regression by slightly over-sampling rows of the adjoined matrix proportional to its leverage scores, and solving the induced subproblem. This results in a better dependence on .
We can also compose our subspace embedding with a fast JL transform to further reduce to the optimal value of about . Since 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 in our running times for regression with a dependence on the rank of , which may be smaller.
3 Recent Related Work
here is the exponent for asymptotically fast matrix multiplication, and is an arbitrary constant. (Some constant factors here are increasing in .)
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 or denote the Frobenius norm of matrix , and denote the spectral norm of .
is a random map so that for each , for with probability .
is a binary matrix with , and all remaining entries .
is an random diagonal matrix, with each diagonal entry independently chosen to be or with equal probability.
We will refer to a matrix of the form as a sparse embedding matrix.
Analysis
It will be convenient to regard the rows of and to be re-arranged so that the are in non-increasing order, so is largest; of course this order is unknown and un-used by our algorithms.
Let be a parameter. Throughout, we let , and .
We will use the notation , a function on event , that returns 1 when holds, and 0 otherwise.
The following variation of Bernstein’s inequalitySee Wikipedia entry on Bernstein’s inequalities (probability theory). will be helpful.
For and independent random variables with , if , then
Proof: Here Bernstein’s inequality says that for , so that and ,
By the quadratic formula, the latter is no more than when
which holds for and .
We begin the analysis by considering for fixed unit vectors . Since , there must be a unit vector so that , and so by Cauchy-Schwartz, . This implies that . 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 , and , let be the event that
where . If
then .
Proof: We will apply Lemma 1 to prove that the bound holds for fixed with failure probability , and then apply a union bound.
Let denote the random variable . We have , , and . Applying Lemma 1 with gives
when , or .
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 of Lemma 2 occurs, and for unit , for all , we have for that . Hence
Putting this and (3.1) into the of Theorem 4, we have,
2 Handling vectors with large entries
A small number of entries can be handled directly.
For given , let denote the event that for all . Then . Given event , we have that for any ,
Proof: Since , the probability that some such has is at most . The last claim follows by a union bound.
3 Handling all vectors
We have seen that 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 as in Lemma 2, suppose the event and hold. Then for unit vector , with failure probability at most ,
Proof: With the event , for each there is at most one with ; let , and otherwise. We have for integer using Khintchine’s inequality
where , and the last inequality uses the assumption that holds, and . Putting and applying the Markov inequality, we have
Therefore, with failure probability at most , we have
Suppose the events and hold, and is as in Lemma 2. Then for there is an absolute constant such that, if , then for unit vector , with failure probability , , when .
Proof: Assuming and , we apply Lemmas 5, 3, and 6 , and have with failure probability at most ,
for the given , putting and assuming . Thus suffices.
for .
For any matrix , if for every we have , then for every unit vector , we have .
The following is our main theorem in this section.
There is such that with probability at least , is a subspace embedding matrix for ; that is, for all , . The embedding can be applied in time. For , where is a parameter in , it suffices if .
Proof: For suitable , , and , with failure probability at most , events and both hold. Conditioned on this, and assuming is sufficiently small as in Lemma 7, we have with failure probability for any fixed that . Hence by Lemma 8, with failure probability , for all . We need , and the parameter conditions of Lemmas 2, Lemma 3, and Lemma 7 holding. Listing these conditions:
, where can be set to be ;
;
.
We put , , and require . For the last condition it suffices that , and . The last condition implies the fourth condition for small enough constant . Also, since , the bound for implies that suffices for Condition 3. Thus when the leverage scores are such that is small, can be . Since , suffices, and so suffices for the conditions of the theorem.
Partitioning Leverage Scores
Let . We partition the leverage scores with into groups , , where
Let , and . Since , we have for all that .
We may also use to refer to the collection of rows of with leverage scores in .
For given hash function and corresponding , let denote the collision indices of , those such that for some . Let .
First, we bound the spectral norm of a submatrix of the orthogonal basis of , where the submatrix comprises rows of .
We want to bound the spectral norm of the matrix whose rows comprise those rows of in the collision set . We let be the number of hash buckets. The expected number of collisions in the buckets is Let be the event that the number of such collisions in the buckets is at most . Let . By a Markov and a union bound, . We will assume that occurs.
While each row in 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 .
Applying the above fact with these bounds for and , we have
With probability , for all leverage score groups , and for an orthonormal basis of , the submatrix of consisting of rows in , that is, those in that collide in a hash bucket with another row in under , has squared spectral norm .
Proof: Fix a . If , then with probability , the items in are perfectly hashed into the bins. So with probability , for all , if , then there are no collisions. Condition on this event.
Now consider a for which . Then
When sampling with replacement, the expected number of distinct items is
2 Within-Group Errors
In this subsection, we show that for all , the error in estimating using is at most .
For , the error in estimating by using contributed by collisions among coordinates for is
and we need a bound on this quantity that holds with high probability.
By a standard balls-and-bins analysis, every bucket has collisions, with high probability, since ; we assume this event.
The squared Euclidean norm of the vector of all that appear in the summands, that is, with , is at most by Lemma 13. Thus the squared Euclidean norm of the vector comprising all summands in (2) is at most
By Khintchine’s inequality, for ,
and therefore is less than the last quantity, with failure probability at most .
Putting , with failure probability at most , for any fixed vector , the squared error in estimating using the sketch of is at most . Assuming the event from the section above, we have . We have, using ,
and , and finally
using . Putting these bounds on the terms together, the squared error is , or , for , so that the error is .
Since the dimension of is bounded by , it follows from the net argument of Lemma 8 that for all , , and so the total error for unit is .
There is an absolute constant for which for any parameters , , and for sparse embedding dimension , for all unit , , with failure probability at most , where denotes the member of derived from .
3 Handling the Cross Terms
To complete the optimization, we must also handle the error due to “cross terms”.
Let be an arbitrary parameter. For , let the event be that the number of bins containing both an item in and in is at most Let , the event that no pair of groups has too many inter-group collisions.
Proof: Fix a . Then the expected number of bins containing an item in both and in is at most and so by a Markov bound the number of bins containing an item in both and is at most with probability at least . The lemma follows by a union bound over the choices of .
In the remainder of the analysis, we set for a parameter . Let be the event that no bin contains more than elements of , where is an absolute constant.
Proof: Observe that By standard balls and bins analysis with the given , with , with probability at least no bin contains more than elements, for a constant .
Condition on events and occurring. Consider any unit vector in the column space of . Consider any . Define the vector : for , and otherwise. Then,
Proof: Since occurs, the number of bins containing both an item in and is at most . Call this set of bins . Moreover, since occurs, for each bin , there are at most elements from in the bin and at most elements from in the bin. Hence, for any , we have, using for all ,
The following is our main theorem concerning cross-terms in this section.
There is an absolute constant for which for any parameters , , and for sparse embedding dimension , the event
occurs with failure probability at most , where 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 for which for any parameters , , and for sparse embedding dimension , for all unit , , with failure probability at most .
Generalized Sparse Embedding Matrices
Proof: We use Theorem 20 together with Lemma 8; for the latter, we need that for any fixed , with probability at least . By Theorem 20, we have this for for an arbitrarily large constant . Hence, by Lemma 8, there is a constant so that with probability at least , for all , . Here we use that can be made arbitrarily large, independent of .
2 The construction
Let and , be such that Theorem 20 and Corollary 21 apply with parameters and , for a sufficiently large constant . Further, let
where is a sufficiently large absolute constant, and let .
Let be a random hash function. For , define . Note that .
We choose independent matrices , with each as in Theorem 20 with parameters and . Here is a matrix. Finally, let be an permutation matrix which, when applied to a matrix , maps the rows of in the set to the set of rows , maps the rows of in the set to the set of rows , and for a general , maps the set of rows of in the set to the set of rows .
The map is defined to be the product of a block-diagonal matrix and the matrix :
can be computed in time.
Proof: As is a permutation matrix, can be computed in time and has the same number of non-zero entries of . For each non-zero entry of , we multiply it by for some , which takes time. Hence, the total time to compute is .
3 Analysis
where is a sufficiently large absolute constant.
Let , and for of at most unit norm, let . Since , this implies that . Since is a permutation matrix, we have .
is a random sparse embedding matrix with rows and columns.
Proof: has a single non-zero entry in each column, and the value of this non-zero entry is random in . Hence, it remains to show that the distribution of locations of the non-zero entries of is the same as that in a sparse embedding matrix. This follows from the distribution of the values , and the definition of .
Let . For , let be the event of Lemma 2, applied to matrix , with , and . Suppose holds. This event has probability at least . Then there is an absolute constant such that with failure probability at most ,
Proof: We apply Lemma 3 with the sparse embedding matrix , and , the number of rows of , taking on the role of in Lemma 2, so that the parameter as in the lemma statement. (And since , , so .) Since , it suffices for Lemma 2 if is at least , or .
With , by a union bound occurs with failure probability , as claimed.
We have, for given , that with failure probability , . Applying a union bound, and using
3.2 Vectors with large entries
Again, let . Since , we have
The following is a standard non-weighted balls-and-bins analysis.
Suppose the previously defined constant is sufficiently large. Let be the event that , for all . Then .
Hence, by a Chernoff bound, for a constant ,
The lemma now follows by a union bound over all .
Assume that holds. Let be the event that for all , . Then .
Proof: For , let be the at most -dimensional subspace which is the restriction of the column space to coordinates with and . By Corollary 21, for any fixed , with probability at least , for all , . By a union bound and sufficiently large , this holds for all with probability at least . This condition implies , since can be expressed as , where each , and letting denote the rows of corresponding to entries from ,
A re-scaling to completes the proof.
4 Putting it all together
where by Lemma 23, each is a sparse embedding matrix with rows and columns.
For as in Lemma 24, and assuming events , , and , there is absolute constant such that with failure probability ,
Proof: We generalize Lemma 6 slightly to bound each summand .
For a given , and for each , let
where is the hash function for . We have for integer using Khintchine’s inequality,
where , and , and the last inequality uses the assumption that holds. Putting and applying the Markov inequality, we have for all that
Moreover, , which under is at most . Therefore, with failure probability at most , we have
The following is our main theorem in this section.
For given , with probability at least , for , is an embedding matrix for ; that is, for all , . can be applied to in time.
yielding the bound claimed. From Lemma 24, event occurs with failure probability at most . From Lemma 25 and 26 the joint occurrence of and holds with failure probability at most . Given these events, from Lemmas 27 and 24, we have with failure probability at most that
Setting , where is from Lemma 8, and recalling that , we have
for absolute constant . Using Lemma 8, we have that with failure probability at most , that
for suitable choice of . Adjusting by a constant factor gives the result.
Approximating Leverage Scores
For any constant , there is an algorithm which with probability at least , outputs a vector so that for all , . The running time is
The success probability can be amplified by independent repetition and taking the coordinate-wise median of the vectors 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 of , while the second theorem gives an algorithm which also outputs the indices of linearly independent columns of . The algorithm takes time and succeeds with probability at least . Hence, in what follows, we can assume that 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 , computing , then computing a change of basis matrix so that has orthonormal columns. The analysis there then shows that the row norms are equal to . To obtain these row norms quickly, an Johnson-Lindenstrauss matrix is sampled, and one first computes , followed by . Using a fast Johnson-Lindenstrauss transform , one can compute in time. has rows, and one can compute the matrix in time by computing a QR-factorization. Computing can be done in time, and computing can be done in time.
Our only change to this procedure is to use a different matrix , which is the composition of our subspace embedding matrix of Theorem 28 with parameter , together with a fast Johnson Lindenstrauss transform . That is, we set . Here, is an matrix, see Section 2.3 of for an instantiation of . Then, can be computed in time by Lemma 22. Moreover, can be computed in time. One can then compute the matrix above in time by computing a QR-factorization of . Then one can compute in time, and computing can be done in time. Hence, the total time is 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 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 , where is adjoined with the vector , it suffices to compute and and output argmin. We use the fact that , and apply Theorem 19 with .
The theorem implies that with probability at least , all vectors in the space spanned by the columns of and have their norms preserved up to a -factor. Notice that and can be computed in time. Now we have a regression problem with rows and columns. Using the Fast Johnson-Lindenstrauss transform, this can be solved in time, see, Theorem 12 of . The success probability is at least . This is time.
Our remaining algorithms will be stated for generalized regression.
The regression problem can be slightly generalized to
where and 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 is not significantly different than for an embedding involving alone, this is not true for : 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 and matrices with rows, where has columns, and given , there is , so that for a generalized sparse embedding matrix , or fast JL matrix, or subsampled randomized Hadamard matrix, or leverage-score sketching matrix for under the condition that has orthonormal columns,
Proof: For a generalized sparse embedding matrix with parameters and , first suppose , so that is the embedding matrix of §2. Let . Then , where is the -th column of and is the -th column of . Thorup and Zhang have shown that and Consequently, from which for an appropriate , the lemma follows by Chebyshev’s inequality. For , , 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 , and using the independence of the , the second moment of is the expectation of
or using the cyclic property of the trace, the fact that , and the fact that ,
and so the lemma follows for large enough in , by Chebyshev’s inequality.
Given matrix of rank for , and , an fast JL matrix with is a subspace embedding for with failure probability at most , for any fixed , and requires time to apply to .
A similar fact holds for subsampled Hadamard transforms.
(Pythagorean Theorem) If and matrices with the same number of rows and columns, then implies .
(Normal Equations) Given matrix , and matrix consider the problem
The solution to this problem is , where is the Moore-Penrose inverse of . Moreover, , and so if is any vector in the column space of , then . Using Fact 34, for any ,
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 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 .
Proof: We estimate the leverage scores of to relative error , using the algorithm of Theorem 29, which has the side effect of finding independent columns of , so that we can assume that .
If is a basis for , then for any there is a so that , and vice versa, so that conditions satisfied by are satisfied by . That is, we can (and will hereafter) assume that has orthonormal columns, when considering products .
5 Affine Embeddings
We also use affine embeddings for which a stronger condition than Theorem 36 is satisfied.
and is a -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 is a basis for , then for any there is a so that , and vice versa, so that conditions satisfied by are satisfied by . That is, we can (and will hereafter) assume that has orthonormal columns.
Using the fact that for any , the embedding property, the fact that , 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 depend on the number of columns of .
Regarding the multiplicative error bound of , Lemma 32 tells us that SRHT achieves this bound for , and the other two need .
Regarding subspace embedding, as noted in the introduction, an SRHT matrix achieves this for . A sparse embedding requires , as in Theorem 19, and leverage score samplers need , 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 : just solve the sketched version of the problem.
For low-rank approximation, discussed in §8, we require 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 of a solution is maintained, for iterations , using data obtained from previous iterations. The convergence of these methods depends on the condition number 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 and , plus for vector arithmetic, or .
Pre-conditioning reduces the number of iterations needed for a given accuracy: suppose for non-singular matrix , the condition number is small. Then a CG-like method applied to would converge quickly, and moreover for iterate that has error small, the corresponding would have . The running time per iteration would have an additional for computing products involving .
That is, is very well-conditioned. Plugging this bound into (10), after iterations is at most times its starting value.
Thus starting with a solution with relative error at most 1, and applying iterations of a CG-like method with , the relative error is reduced to and the work is (where we assume has been reduced to , as in the leverage computation), plus the work to find . We have
Note that only the matrix from the leverage score computation is needed, not the leverage scores, so the term in the running time need not have a factor; however, since reducing to columns requires that factor, the resulting running time without that factor is , depends on .
The matrix 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 with relative error at most 1, and for , let . Then using the normal equations,
where is the SVD of .
and by choosing , say, iterations suffice for this scheme also to attain relative error.
That is, this method is never much worse than CG-like methods, but comparable in running time when ; when , 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 , where denotes the best rank- approximation to . We seek low-rank matrices whose distance to is within of .
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 .
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 for basis vectors implies that .
The following lemma implies a regression algorithm that is linear in , but has a worse dependence in its additive term.
Compute and an orthonormal basis for , where is as in Lemma 46 with ;
Compute and for the product of a SRHT matrix with a sparse embedding, where and . (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 is any constant in .
As in the proof of Theorem 29, in time we can replace the input matrix with a new matrix with the same column space of and full column rank, where is rank of . We therefore assume has full rank in what follows.
Let and assume . Split into matrices , each , so that is the submatrix of indexed by the -th block of rows.
We invoke Theorem 28 with the parameters , , , and , choosing a generalized sparse embedding matrix matrix with rows. Theorem 28 has the guarantee that for each fixed , is a subspace embedding with probability at least . It follows by a union bound that with probability at least , for all , is a subspace embedding. We condition on this event occurring.
Let be an matrix, and let . Then there exists an -well-conditioned basis for the column space of such that if , then and ; if , then and , and if then and . An change of basis matrix for which is a well-conditioned basis can be computed in time.
Apply Theorem 48 to to obtain an change of basis matrix so that is an -well-conditioned basis of the column space of matrix ;
Output , where for , and for .
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 ) is reduced from to .
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 and leverage score sampling. We compare the Frobenius error of the resulting with that of the best rank- approximation.
In our experiments, the matrices tested are .
The resulting low-rank approximation was tested for (the number of columns of ) taking values of the form, for integer , while . The number of rows of was chosen such that the condition number of was at most . (Since has orthogonal columns, its condition number is 1, so a large enough leverage score sample will have this property.) For such and , we took the ratio of the Frobenius norm of the error to the Frobenius norm of the error of the best rank- approximation. The resulting points were generated, for all test matrices, for three independent trials, resulting in a set of points .
The test matrices are from the University of Florida Sparse Matrix Collection, essentially most of those with at most nonzero entries, and with 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 on the curve, at most one percent of points gave a result where but .
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 , we bound , and then show that this implies that is small. Using that and (12), we have
To show that this bound implies that is small, we use the subadditivity of and the property of any conforming matrices and , that , to obtain
By hypothesis, for all , so that has eigenvalues bounded in magnitude by , which implies singular values with the same bound, so that . Thus , or
since . This bounds , and so proves the lemma.
We handle the first term in (14) as follows:
For the second term in (14), for ,
Combining (13) with (14) and the bounds on the terms in (14) above,
The lemma now follows by Chebyshev’s inequality, for appropriate .
Proof of Lemma 41: Lemma 15 of shows that with arbitrarily low failure probability, and the other direction follows from a similar argument. Briefly: the expectation of is , by construction, and Lemma 11 of implies that with arbitrarily small failure probability, all rows of will have squared norm at most , where is a value in . Assuming that this bound holds, it follows from Hoeffding’s inequality that the probability that is at most , or , so that suffices to make the failure probability at most .
By relating the -norm and the -norm, for , we have
Since and , for we have with probability
and for with probability
Applying Theorem 48, we have, from the definition of a -well-conditioned basis, that
Combining (15) and (16), we have that with probability at least ,
Hence is an -well-conditioned basis. The time to compute is by Theorem 28. Notice that is an matrix, which is , and so the time to compute from is , since .