Subspace Iteration Randomization and Singular Value Problems
Ming Gu
Introduction
Randomized algorithms have established themselves as some of the most competitive methods for rapid low-rank matrix approximation, which is vital in many areas of scientific computing, including principal component analysis and face recognition , large scale data compression and fast approximate algorithms for PDEs and integral equations . In this paper, we consider randomized algorithms for low-rank approximations and singular value approximations within the subspace iteration framework, leading to results that simultaneously retain the reliability of randomized algorithms and the typical faster convergence of subspace iteration methods.
Given any matrix with , its singular value decomposition (SVD) is described by the equation
where is an column orthogonal matrix; is an orthogonal matrix; and with . Writing and in terms of their columns,
then and are the left and right singular vectors corresponding to , the -th largest singular value of . For any , we let
be the (rank-) truncated SVD of . The matrix is unique only if . The assumption that will be maintained throughout this paper for ease of exposition. Our results still hold for by applying all the algorithms on . Similarly, all our main results are derived under the assumption that . But they remain unchanged even if , and hence remain valid by a continuity argument. All our analysis is done without consideration of round-off errors, and thus need not hold exactly true in finite precision, especially when the user tolerances for the low-rank approximation are close to machine precision levels. Additionally, we assume throughout this paper that all matrices are real. In general, is an ideal rank- approximation to , due to the following celebrated property of the SVD:
While there are results similar to Theorem 1 for all unitarily invariant matrix norms, our work on low-rank matrix approximation bounds will only focus on the two most popular of such norms: the 2-norm and the Frobenius norm.
Theorem 1 states that the truncated SVD provides a rank- approximation to with the smallest possible 2-norm error and Frobenius-norm error. In the 2-norm, any rank- approximation will result in an error no less than , and in the Frobenius-norm, any rank- approximation will result in an error no less than . Additionally, the singular values of are exactly the first singular values of , and the singular vectors of are the corresponding singular vectors of . Note, however, that while the solution to problem (3) must be , solutions to problem (2) are not unique and include, for example, the rank- matrix defined below for any :
This subtle distinction between the 2-norm and Frobenius norm will later on become very important in our analysis of randomized algorithms (see Remark 3.4.) In Theorem 8 we prove an interesting result related to Theorem 1 for rank- approximations that only solve problems (2) and (3) approximately.
To compute a truncated SVD of a general matrix , one of the most straightforward techniques is to compute the full SVD and truncate it, with a standard linear algebra software package like the LAPACK . This procedure is stable and accurate, but it requires floating point operations, or flops. This is prohibitively expensive for applications such as data mining, where the matrices involved are typically sparse with huge dimensions. In other practical applications involving the truncated SVD, often the very objective of computing a rank- approximation is to avoid excessive computation on . Hence it is desirable to have schemes that can compute a rank- approximation more efficiently. Depending on the reliability requirements, a good rank- approximation can be a matrix that is accurate to within a constant factor from the optimal, such as a rank-revealing factorization (more below), or it can be a matrix that closely approximates the truncated SVD itself.
Many approaches have been taken in the literature for computing low-rank approximations, including rank-revealing decompositions based on the QR, LU, or two-sided orthogonal (aka UTV) factorizations . Recently, there has been an explosion of randomized algorithms for computing low-rank approximations . There is also software package available for computing interpolative decompositions, a form of low-rank approximation, and for computing the PCA, with randomized sampling . These algorithms are attractive for two main reasons: they have been shown to be surprisingly efficient computationally; and like subspace methods, the main operations involved in many randomized algorithms can be optimized for peak machine performance on modern architectures. For a detailed analysis of randomized algorithms and an extended reference list, see ; for a survey of randomized algorithms in data analysis, see .
The subspace iteration is a classical approach for computing singular values. There is extensive convergence analysis on subspace iteration methods and a large literature on accelerated subspace iteration methods . In general, it is well-suited for fast computations on modern computers because its main computations are in terms of matrix-matrix products and QR factorizations that have been highly optimized for maximum efficiency on modern serial and parallel architectures . There are two well-known weaknesses of subspace iteration, however, that limit its practical use. On one hand, subspace iteration typically requires very good separation between the wanted and unwanted singular values for good convergence. On the other hand, good convergence also often critically depends on the choice of a good start matrix .
Another classical class of approximation methods for computing an approximate SVD are the Krylov subspace methods, such as the Lanczos algorithm (see, for example .) The computational cost of these methods depends heavily on several factors, including the start vector, properties of the input matrix and the need to stabilize the algorithm. One of the most important part of the Krylov subspace methods, however, is the need to do a matrix-vector product at each iteration. In contrast to matrix-matrix products, matrix-vector products perform very poorly on modern architectures due to the limited data reuse involved in such operations, In fact, one focus of Krylov subspace research is on effective avoidance of matrix-vector operations in Krylov subspace methods (see, for example .)
This work focuses on the surprisingly strong performance of randomized algorithms in delivering highly accurate low-rank approximations and singular values. To illustrate, we introduce Algorithm 1.1, one of the basic randomized algorithms (see .)
Compute an orthogonal column basis for .
Compute , the rank- truncated SVD of .
Throughout this paper, a random matrix, such as in Algorithm 1.1, is a standard Gaussian matrix, i.e., its entries are independent standard normal variables of zero mean and standard deviation .
While other random matrices might work equally well, the choice of the Gaussian matrix provides two unique advantages: First, the distribution of a standard Gaussian matrix is rotationally invariant: If is an orthonormal matrix, then is itself a standard Gaussian matrix with the same statistical properties as . Second, our analysis is much simplified by the vast literature on the singular value probability density functions of the Gaussian matrix.
While Algorithm 1.1 looks deceptively simple, its analysis is long, arduous, and involves very strong doses of statistics . The following theorem establishes an error bound on the accuracy of as a low-rank approximation to . There are similar results in the Frobenius norm.
(Halko, Martinsson, Tropp [35, Corollary 10.9]) The column-orthonormal matrix produced by Step 3 in Algorithm 1.1 satisfies
with failure probability at most .
Comparing Theorem 2 with Theorem 1, it is clear that Algorithm 1.1 could provide a very good low rank approximation to with probability at least , despite its simple operations, provided that . While algorithms differ in their algorithm design, efficiency, and domain applicability, they typically share the same advantages of computational efficiency and approximation accuracy.
Algorithm 1.1 is the combination of Stages A and B of the Proto Algorithm in , where the truncated SVD is considered separately from low-rank approximation. In Section 2.3 we will discuss the pros and cons of SVD truncation vs. no truncation. Algorithm 1.1 is a special case of the randomized subspace iteration method (see Algorithm 2.2), for which Halko, Martinsson, Tropp have developed similar results.
However, while the upper bound in Theorem 2 can be very satisfactory for many applications, there may be situations where singular value approximations are also desirable. In addition, it is well-known that in practical computations randomized algorithms often far outperform their error bounds , whereas the results in do not suggest convergence of the computed rank- approximation to the truncated SVD in either Algorithm 1.1 or the more general randomized subspace iteration method.
Our entire work is based on novel analysis of the subspace iteration method, and we consider randomized algorithms within the subspace iteration framework. This allows us to take advantage of existing theories and technical machinery in both fields.
Current analysis on randomized algorithms focuses on the errors in the approximation of by a low rank matrix, whereas classical analysis on subspace iteration methods focuses on the accuracy in the approximate singular values. Our analysis allows us to obtain both kinds of results for both of these methods, leading to the stronger rank-revealing approximations. In terms of randomized algorithms, our matrix approximation bounds are in general tighter and can be drastically better than existing ones; in terms of singular values, our relative convergence lower bounds can be interpreted as simultaneously convergence error bounds and rank-revealing lower bounds.
Our analysis has lead us to some interesting conclusions, all with high probability (more precise statements are in Sections 5 through 7):
The leading singular values computed by randomized algorithms are at least a good fraction of the true ones, regardless of how the singular values are distributed, and they converge quickly to the true singular values in case of rapid singular value decay. In particular, this result implies that randomized algorithms can also be used as efficient and reliable condition number estimators.
The above results, together with the fact that randomized algorithms compute low-rank approximations up to a dimension dependent constant factor from optimal, mean that these low-rank approximations are in fact rank-revealing factorizations. In addition, for rapidly decaying singular values, these approximations can be as accurate as a truncated SVD.
The subspace iteration method in general and the power method in particular is still slowly convergent without over-sampling in the start matrix. We present an alternative choice of the start matrix based on our analysis, and demonstrate its competitiveness.
The rest of this paper is organized as follows: In Section 2 we discuss subspace iteration methods and their randomized versions in more detail; in Section 3 we list a number of preliminary as well as key results needed for later analysis; in Section 4 we derive deterministic lower bounds on singular values and upper bounds on low-rank approximations; in Section 5 we provide both average case and large deviation bounds on singular values and low-rank approximations; in Section 6 we compare these approximations with other rank-revealing factorizations; in Section 7 we discuss how randomized algorithms can be used as efficient and reliable condition number estimators; in Section 8 we present supporting numerical experimental results; and in Section 9 we draw some conclusions and point out possible directions for future research.
Much of our analysis has its origin in the analysis of subspace iteration and randomized algorithms . It relies both on linear algebra tools as well as statistical analysis to do some of the needed heavy lifting to reach our conclusions. To limit the length of this paper, we have put the more detailed parts of the analysis as well as some additional numerical experimental results in the Supplemental Material, which is accessible at SIAM’s on-line portal.
Algorithms
In this section, we present the main algorithms that are discussed in the rest of this paper. We also discuss subtle differences between our presentation of randomized algorithms and that in .
We start with the classical subspace iteration method for computing the largest few singular values of a given matrix.
Compute .
Compute an orthogonal column basis for .
Compute , the rank- truncated SVD of .
Given the availability of Lanczos-type algorithms for the singular value computations, the classical subspace iteration method is not widely used in practice except when . We present it here for later comparisons with its randomized version. We ignore the vast literature of accelerated subspace iteration methods (see, for example ) in this paper since our main goal here is to analyze the convergence behavior of subspace iteration method with and without randomized start matrix .
We have presented Algorithm 2.1 in an over-simplified form above to convey the basic ideas involved. In practice, the computation of would be prone to round-off errors. For better numerical accuracy, Algorithm A.1 in the Appendix should be used numerically to compute the matrix in Algorithm 2.1. In practical computations, however, Algorithm A.1 is often performed once every few iterations, to balance efficiency and numerical stability (see Saad .) In the rest of Section 2, any QR factorization of the matrix should be computed numerically through periodic use of Algorithm A.1.
While there is little direct analysis of subspace iteration methods for singular values (Algorithm 2.1) in the literature, one can generalize results of subspace iteration methods for symmetric matrices to the singular value case in a straightforward fashion. The symmetric matrix version of Theorem 3 can be found in .
(Bathe and Wilson) Assume that Algorithm 2.1 converges as . Then
2 Randomized Algorithms
In order to enhance the convergence of Algorithm 2.1 in the absence of any useful information about the leading singular vectors, a sensible approach is to replace the deterministic start matrix with a random one, leading to
Compute a rank- approximation with Algorithm 2.1.
Since Algorithm 2.2 is the special case of Algorithm 2.1 with being chosen as random, all our results for Algorithm 2.1 equally hold for Algorithm 2.2.
The only difference between Algorithm 2.1 and Algorithm 2.2 is in the choice of , yet this difference will lead to drastically different convergence behavior. One of the main purposes of this paper is to show that the slow or non-convergence of Algorithm 2.1 due to bad choice of vanishes with near certainty in Algorithm 2.2. In particular, a single iteration ( in Algorithm 2.2) in the randomized subspace iteration method is often sufficient to return good enough singular values and low-rank approximations (Section 5).
Our analysis of deterministic and randomized subspace iteration method was in large part motivated by the analysis and discussion of randomized algorithms in . We have chosen to present the algorithms in Section 2 in forms that are not identical to those in for ease of stating our results in Sections 4 through 8. Versions of Algorithm 2.2 have also appeared in for solving large-scale discrete inverse problems.
3 To Truncate or not to Truncate
The randomized algorithms in Section 2 are presented in a slight different form than those in . One key difference is in the step of SVD truncation, which is considered an optional postprocessing step there. In this section, we discuss the pros and cons of SVD truncation. We start with the following simple lemma, versions of which appear in .
Lemma 4 makes it obvious that any SVD truncation of will only result in a less accurate approximation in the 2-norm and Frobenius norm. This is strong motivation for no SVD truncation. The SVD truncation of also involves the computation of the SVD of in some form, which also results in extra computation.
Setup
In this section we build some of the technical machinery needed for our heavy analysis later on. We start by reciting two well-known results in matrix analysis, and then develop a number of theoretical tools that outline our approach in the low-rank approximation analysis. Some of these results may be of interest in their own right. For any matrix , we use to denote its -th largest singular value.
The Cauchy interlacing theorem shows the limitations of any approximation with an orthogonal projection.
(Golub and van Loan [30, p. 411]) Let be an matrix and be a matrix with orthonormal columns. Then for .
A direct consequence of Theorem 5 is that , where is any submatrix of .
Weyl’s monotonicity theorem relates singular values of matrices and to those of .
(Weyl’s monotonicity theorem [43, Thm. 3.3.16]) Let and be matrices with . Then
The Hoffman-Wielandt theorem bounds the errors in the differences between the singular values of and those of in terms of .
(Hoffman and Wielandt ) Let and be matrices with . Then
Below we develop a number of theoretical results that will form the basis for our later analysis on low-rank approximations. Theorem 8 below is of potentially broad independent interest. Let be a rank- approximation to . Theorem 8 below relates the approximation error in the Frobenius norm to that in the 2-norm as well as the approximation errors in the leading singular values. It will be called the Reverse Eckart and Young Theorem due to its complimentary nature with Theorem 1 in the Frobenius norm.
(Reverse Eckart and Young) Given any matrix , and let be a matrix with rank at most such that
when is larger than or close to . On the other hand, if , then equation (6) simplifies to
where the last ratio can be much smaller than , implying a much better rank- approximation in . Similar comments apply to equation (5). This interesting feature of Theorem 8 is one of the reasons why our eventual 2-norm and Frobenius norm upper bounds are much better than those in Theorem 2 in the event that . This also has made our proofs in Appendix B somewhat involved in places.
Equation (7) asserts that a small in equation (5) necessarily means good approximations to all the leading singular values of . In particular, means the leading singular values of and must be the same. However, our singular value analysis will not be based on Equation (7), as our approach in Section 4 provides us with much better results.
Proof of Theorem 8: Write . It follows from Theorem 6 that for any :
since is a rank- matrix. It follows that
Plugging this into equation (5) yields (6).
As to equation (7), we observe that the through the last singular values of are all zero, given that has rank . Hence the result trivially follows from Theorem 7,
Our next theorem is a generalization of Theorem 1.
Problem (9) in Theorem 9 is a type of restricted SVD problem. Oddly enough, this problem becomes much harder to solve for the 2-norm. In fact, might not even be the solution to the corresponding restricted SVD problem in 2-norm. Combining Theorems 8 and 9, we obtain
Our low-rank approximation analysis in the -norm will be based on equation (11). While this is sufficient, it also makes our -norm results perhaps weaker than they should be due to the mixture of the -norm and the Frobenius norm.
By Theorem 1, is the best Frobenius norm approximation to , whereas by Theorem 9 is the best restricted Frobenius norm approximation to . This leads to the following interesting consequence
Thus we can expect to also be an excellent rank- approximation to as long as points to the principle singular vector directions.
Result (9) is now an immediate consequence of Theorem 1. To prove (10), we observe that
The third term in the last equation is zero because Combining this last relation with equation (12) gives us relation (10). Q.E.D.
Deterministic Analysis
In this section we perform deterministic convergence analysis on Algorithm 2.1. Theorem 12 is a relative convergence lower bound, and Theorem 13 is an upper bound on the matrix approximation error. Both appear to be new for subspace iteration. Our approach, while quite novel, was motivated in part by the analysis of subspace iteration methods by Saad and randomized algorithms in . Since Algorithm 1.1 is a special case of Algorithm 2.2 with , which in turn is a special case of Algorithm 2.1 with an initial random matrix, our analysis applies to them as well and will form the basis for additional probabilistic analysis in Section 5.
We begin by noticing that the output in Algorithm 2.1 is also the rank- truncated SVD of the matrix , due to the fact that is column orthonormal. In fact, columns of are nothing but an orthonormal basis for the column space of matrix . This is the reason why Algorithm 2.1 is called subspace iteration. Lemma 10 below shows how to obtain alternative orthonormal bases for the same column space. We omit the proof.
The matrix has at least as many columns as rows. Assume it is of full row rank so that its pseudo-inverse satisfies
Below we present a special choice of that will reveal the manner in which convergence to singular values and low-rank approximations takes place. Ideally, such an would orient the first columns of {\displaystyle U\left(\begin{array}[]{c}\left(\begin{array}[]{cc}\Sigma_{1}&\cr&\Sigma_{2}\end{array}\right)^{2q+1}\widehat{\Omega}_{1}\cr\cr\Sigma_{3}^{2q+1}\widehat{\Omega}_{2}\end{array}\right)X} in the directions of the leading singular vectors in . We choose
By equation (16), the QR factorization of can now be written in the following partition:
We will use this representation to derive convergence upper bounds for singular value and rank-k approximations. In particular, we will make use of the fact that the above QR factorization also embeds another one
We are now ready to derive a lower bound on .
Let be defined in equation (16), and assume that the matrix has full row rank, then the matrix computed in Algorithm 2.1 must satisfy
It might seem more intuitive in equation (15) to choose where solves the following least squares problem
Our choice of seems as effective and allows simpler analysis.
Proof of Lemma 11: We note by Lemma 10 that
From equations (20) and (18), we see that the matrix
is simply a submatrix of the middle matrix on the right hand side of equation (20). By Remark 3.1, it follows immediately that
Combining these two relations, and together with the fact that , we obtain (19). Q.E.D.
2 Deterministic Bounds
In this section we develop the analysis in Section 4.1 into deterministic lower bounds for singular values and upper bounds for rank-k approximations.
Since the interlacing theorem 5 asserts an upper bound , equation (19) provides a nice lower bound on . These bounds mean that is a good approximation to as long as is small. This consideration is formalized in the theorem below.
Proof of Theorem 12: By the definition of the matrix in equation (16), it is straightforward to get
This, together with lower bound (19), gives the result in Theorem 12 for . To prove Theorem 12 for any , we observe that since , all that is needed is to repeat all previous arguments for a rank truncated SVD. Q.E.D.
Now we consider rank-k approximation upper bounds. Toward this end and considering Theorem 9, we would like to start with an upper bound on . By Lemma 10 and equation (17), we have
Since , and since \widehat{Q}_{1}={\displaystyle U\left(\begin{array}[]{c}I\cr 0\cr H_{1}\end{array}\right)\widehat{R}_{11}^{-1}} according to equation (18), the above right hand side becomes
where we have used the fact that (see (18))
However, when is taken to be Gaussian, only the bounds in Theorem 13 allow average case analysis for all values of (See Section 5.2.)
Not surprisingly, the two key factors governing the singular value convergence of Algorithm 2.1 also govern the convergence of the low-rank approximation. Hence Remark 4.2 applies equally well to Theorem 13.
Proof of Theorem 13: We first assume that the matrix in equation (16) has full column rank. Rewrite
The last expression is a symmetric positive semi-definite matrix. This allows us to write
By a continuity argument, the last relation remains valid even if does not have full column rank.
Due to the special form of in equation (16), we can write as
Plugging this into equation (34) and dividing both the nomerator and denominator by ,
Comparing this with Theorems 8 and 9 proves Theorem 13. Q.E.D.
Statistical Analysis
This section carries out the needed statistical analysis to reach our approximation error bounds. In Section 5.1 we make a list of the statistical tools used in this analysis; in Section 5.2 we perform average value analysis on our error bounds; and in Section 5.3 we provide large deviation bounds.
The simplest of needed statistical results necessary for our analysis is the following proposition from .
For fix matrices and standard Gaussian matrix , we have
The following large deviation bound for the pseudo-inverse of a Gaussian matrix is also from .
The following theorem provides classical tail bounds for functions of Gaussian matrices. It was taken from [Thm. 4.5.7].
Suppose that is a real valued Lipschitz function on matrices:
Draw a standard Gaussian matrix . Then
The two propositions below will be used in our average case error bounds analysis, both for singular values and rank-k approximations. Their proofs are lengthy and can be found in the Supplemental Material.
Let , , and , and let be an Gaussian matrix. Then
There are lower and upper bounds similar to Proposition 17 for the pseudo-inverse of a Gaussian, with a significant complication. When is a square Gaussian matrix, it is non-singular with probability . However, the probability density function for its pseudo-inverse could have a very long tail according to Lemma 15. A similar argument could also be made when is almost a square matrix. This complication will have important implications for parameter choices in Algorithm 2.2 (see Sections 5.2 and 5.3.) Function below is base-.
2 Average Case Error Bounds
This section is devoted to the average case analysis of Algorithm 2.2. This work requires us to study the average case behavior on the upper and lower bounds in Theorems 12 and 13. As observed in Section 2.2, the distribution of a standard Gaussian matrix is rotationally invariant, and hence the matrices and are themselves independent standard Gaussian matrices. With the tools established in Section 5.1, our analysis here consists mostly of stitching together the right pieces from there.
Let be the SVD of , and let be a rank- approximation computed by Algorithm 2.2. Then for
Theorem 19 strongly suggests that in general some over-sampling in the number of columns can significantly improve convergence in the singular value approximation. This is consistent with the literature and is very significant for practical implementations.
Since for all , Theorem 19 implies that for and for all ,
In other words, Algorithm 2.2 approximates the leading singular values by a good fraction on average, regardless of how the singular values are distributed, even for . This result is surprising and yet valuable. It will have applications in condition number estimation (see Sections 5.3 and 7 for more discussion.)
For matrices with rapidly decaying singular values, convergence could be so rapid that one could even set in some cases (Section 5.3.) This is the basis of the excitement about Algorithm 2.2 in that very little work is typically sufficient to realize an excellent low-rank approximation. The faster the singular values decay, the faster Algorithm 2.2 converges.
Proof of Theorem 19: As in Theorem 12, we will only prove Theorem 19 for . All other values of can be proved by simply citing Theorem 19 for a rank- SVD truncation. Since and are independent of each other, we will take expectations over and in turn, based on Propositions 17 and 18.
Let . By Theorem 12 and Proposition 17,
For , we further take expectation over according to Proposition 18. By equation (50),
To complete the proof, we note that the results for and can be obtained similarly by taking expectation of over equation (50) and simplifying. Q.E.D.
It is now time for average case analysis of low-rank matrix approximations. Again, we base our arguments on Propositions 17 and 18. For ease of notation, let
For the sake of simplicity, in Theorem 19 below we have omitted
Let be a rank- approximation computed by Algorithm 2.2. Then
Remark 3.2 applies to Theorem 20 as well.
Proof of Theorem 20: We only prove Theorem 20 for the Frobenius norm. The case for the 2-norm is completely analogous. As in the proof for Theorem 19, this one involves taking expectations over first and next. Let . Fixing in Theorem 13 and taking expectation on according to Proposition 17, we obtain immediately
For , we further take expectation over according to Proposition 18. By equation (48),
which is the Frobenius norm upper bound in Theorem 20.
For , we again take expectation over in equation (53) according to Proposition 18:
which is bounded above by the corresponding expression in Theorem 20.
Now, we turn our attention to the case . Taking expectations as before,
Plugging in the expressions for and in equation (53),
which is bounded above by the corresponding expression in Theorem 20 since . Q.E.D.
3 Large Deviation Bounds
In this section we develop approximation error tail bounds. Theorems 12 and 13 dictate that our main focus will be in developing probabilistic upper bounds on .
with exception probability at most .
Proof of Theorem 21: Since and are independent from each other, we can study how the error depends on the matrix when is reasonably bounded. To this end, we define an event as follows:
Invoking the conclusion of Lemma 15, we find that
In other words, we have just shown that with probability at least .
where has the same dimensions as . It is straightforward to show that
under event . Also under event and by Proposition 14, we have
Applying the concentration of measure equation, Theorem 16, conditionally to under event ,
Use the equation (54) to remove the restriction on , therefore,
so that . With this choice of and ,
Plugging this bound into the formulas in Theorem 12 and Remark 4.3 proves Theorem 21. Q.E.D.
While the value of oversampling size does not look so important in the average case error bounds as long as , it makes an oversized difference in large deviation bounds. Consider the case with a tiny . In this case, may still be quite large, and quite a few extra number of iterations might be necessary to ensure satisfactory convergence with small exception probability.
For , the large deviation bound is brutal. For very small values of , such as in the case of the randomized power method (see Algorithm A.3), it seems unreasonable to require a relatively large value of . On the other hand, a small value would significantly impact convergence. We will address this conflicting issue of choosing further in Section 8.
But for any large enough values of (such as or more, for example,) a reasonable choice would be to choose so is a modest number. We will now choose
This choice gives . For a typical choice of , equation (55) gives . For this value of , the exception probability is smaller than that of matching DNA fingerprints . Given that the ”random numbers” generated on modern computers are really only pseudo random numbers that may have quite different upper tail distributions than the true Gaussian (see, for example ), and given that only finite precision computations are typically done in practice, it is probably meaningless to require to be much less than , the double precision. Additionally, with this choice of , the large deviation bounds are very similar to the average case error bounds, suggesting that the typical behavior is also the worst case behavior, with probability .
Our final observation on Theorem 21 is so important that we present it in the form of a Corollary. We will not prove it because it is a direct consequence.
In the notation of Theorem 21, we must have for ,
with exception probability at most .
This is a surprisingly strong result. We will discuss its implications in terms of rank-revealing factorizations in Section 6 and condition number estimation in Section 7.
Rank-revealing Factorizations
Rank-revealing factorizations were first discussed in Chan . Generally speaking, there are rank-revealing UTV factorizations , QR factorizations , and LU factorizations . While there is no uniform definition of the rank-revealing factorization, a comparison of different forms of rank-revealing factorizations has appeared in Foster and Liu . For the discussions in this section, we make the following definition, which is loosely consistent with those in .
Given matrices and and integer , we call a rank-revealing rank- approximation to if and if there exist polynomials , and such that
A rank-revealing rank- approximation differs from an ordinary rank- approximation in the extra condition (57), which requires some accuracy in all leading singular values. Therefore a rank-revealing rank- approximation is likely a stronger approximation than a simple low rank approximation. To see why (57) is so important, we consider for an example the case where the leading singular values of are identical: . This includes the identity matrix as a special case. Now choose in equation (4). It follows that is an optimal rank- approximation to , which is likely unacceptable to most users. On the other hand, obviously does not satisfy condition (57) for any polynomial , and therefore is not a rank-revealing rank- approximation to . Similarly, any orthogonal matrix would satisfy the bound in Theorem 2 for such an matrix, and only the matrix from Algorithm 2.2 would satisfy Theorem 21.
By definition, Algorithm 2.2 produces a rank-revealing rank- approximation with probability at least . In this section, we compare this approximation with the strong RRQR factorization developed in Gu and Eisenstat .
(Gu and Eisenstat ) Let be an matrix and let . For any given parameter , there exists a permutation such that
where for any and ,
Let {\displaystyle\widehat{A}_{k}=Q\left(\begin{array}[]{cc}R_{11}&R_{12}\\ &0\end{array}\right)\Pi^{T}}. Then is a rank- matrix. It follows from equation (59) that
These properties are compatible with the inequalities in Theorem 21. The strong RRQR factorization in Theorem 23 also includes a permutation that selects linearly independent columns of such that . Such information could be useful in some applications .
But the matrix , being a two-sided orthogonal approximation, does not contain any information about such permutation. On the other hand, it is likely to be cheaper to compute due to the matrix-matrix product operations involved, and for rapidly decaying singular values or by potentially increasing the value of , it could make a much better approximation than .
Condition Number Estimation
For any given square non-singular matrix , define
as its condition number. Here is any matrix norm, such as the matrix -norm, -norm, -norm, Frobenius norm, or -norm. Condition numbers are of central importance in solving many matrix computation problems, such as linear equations, least squares problems, eigenvalue/eigenvector problems, and sparse matrix problems. For a detailed discussion of condition number estimation, see the survey paper by Higham and the references therein. More recent work includes Laub and Xia .
A typical condition estimator uses a matrix norm estimator to estimate and separately, and multiply them together to get an estimate for . A typical matrix norm estimator, in turn, only accesses the matrix through matrix-matrix or matrix-vector multiplications, without the need to directly access entries of . Thus the costs of estimating and are similar if a factorization for is available. The goal in matrix norm estimation is to compute a reliable estimate of up to a factor that does not grow too fast with the dimension of , perhaps without direct access to entries of , at a cost that is considerably less than that of matrix factorization or inversion, something that is believed to be impossible (see Remark 5.9.)
Compute .
The is the -th unit vector. While it could occasionally take much longer, Hager’s method typically takes very few (less than ) iterations to converge to a local maximum that is within a reasonable factor (like or less) of . As Algorithm 2.2 already computes a reliable estimate for , it is straightforward to combine Algorithms 2.2 and 7.1 to obtain a reliable estimate for , which satisfies .
Compute rank- approximation to using Algorithm 2.2
Set to be the right singular vector of .
Run Algorithm 7.1 on with initial vector .
Since is a rank-1 matrix, is straightforward to compute. The number of iterations in Algorithm 7.1 can be restricted to as few as or . This is because Algorithm 7.1 is only used to find a column whose vector -norm provides the estimate for , no local maximum to problem (60) is necessary. Corollary 24 directly follows from Corollary 22.
For any , the output from Algorithm 7.2 must satisfy
with exception probability at most .
Hager’s method has been generalized by Higham to estimate the matrix -norm for any and the mixed matrix norm for and . In particular, the -norm is the special case with and . Algorithm 7.2 can be trivially generalized to those cases as well, by replacing Hager’s method in Algorithm 7.2 with its generalized version, leading to a Corollary 24-like conclusion for reliability. We omit the details.
Kuczyński and Woźniakowski developed probabilistic error bounds for estimating the condition number using the Lanczos algorithm for unit start vectors under the uniform distribution. However, our results appear to be much stronger.
Below, we demonstrate the robustness of Algorithm 7.2 through the following example. Let
where are scalars, is an dimensional vector, and is an matrix. If we take the initial vector in Algorithm 7.1 to be the vector of all ’s (the default choice in LAPACK), then Algorithm 7.1 will always return as the -norm estimate, regardless of .
Numerical Experiments
In this section we perform numerical experiments to shed more light on randomized algorithms. Our main purpose of these experiments is to provide numerical support to our probabilistic analysis and to demonstrate that different applications can lead to different singular value distributions in the matrix and impose different accuracy requirements, and thus demand different levels of computational effort on the randomized algorithms.
In the case of a small , it seems unreasonable to require a potentially large value of as suggested in equation (55). However, for a truely small value of , going random is still not enough to overcome the potential problem of slow convergence associated with a poor start matrix in Algorithm 2.2, and some additional work maybe needed (see Sections 5.)
This discussion is particularly relevant for , which corresponds to the classical power method, Algorithm A.2, and its randomized version, Algorithm A.3, in Appendix A. Any value of seems to be too much work, but does not lead to fast enough convergence.
According to Corollary 22, Algorithm 2.2 can already compute order of magnitude approximations to all the leading singular values with . Thus, an obvious improvement of Algorithm 2.2 for small values of would be to compute with Algorithm 1.1 and then compute a subspace approximation with Algorithm 2.1. Algorithm 8.1 below is designed for subspace computations where or smaller.
Improved Randomized Subspace Iteration for small
Set to be approximate right singular vector matrix.
We perform our experiments with matrices of the form
where are -dimensional Gaussian random variables with mean and standard deviation , and where are -dimensional Gaussian random variables with mean and standard deviation . We choose different values to control the ratio of the two leading singular values of .
For the case of large ratio, Algorithm 8.1 converged to in about steps, as opposed to about steps for Algorithm A.3. For the case of a small ratio, both algorithms performed equally well. Algorithm 8.1 converged slightly more quickly, but that is offset by the extra work needed to compute the initial .
Figure 1 confirms our analysis. At the cost of the initial step to obtain a good start vector, Algorithm 8.1 can converge significantly faster than Algorithm A.3.
2 low-rank approximation
In this experiment, we consider a matrix of the form
where are equi-spaced points on the edge of the disc and equi-spaced points on the edge of the disc (see Figure 2.) We compare the performance of Algorithms 1.1 and 2.2 against that of svds, the matlab version of ARPACK for finding a few selected singular values of large matrices. We choose . The results are summarized in Table 1.
Since the singular values of this matrix decay relatively quickly, Algorithm 1.1 seems to out-perform Algorithm 2.2 for any values of . Algorithm 1.1 also outperforms svds. As Algorithm 1.1 mostly computes matrix-matrix products whereas each step of svds involves a matrix-vector product, we would expect Algorithm 1.1 to have even better performance than svds on modern serial and parallel architectures. This example demonstrates that for matrices with fast decaying singular values, randomized algorithms can be as competitive as the best methods for computing highly accurate low-rank approximations.
3 Structured Matrix Computations
In this example, we demonstrate the effectiveness of randomized algorithms for low-rank approximation in the context of structured matrix computations. is a sparse SPD matrix arising from circuit simulations. It is publicly available in the University of Flordia Sparse Matrix Collection . Figure 3 depicts its sparsity pattern in the symmetric minimum degree ordering . A direct factorization of this matrix creates a large amount of fill-in. In particular, the Schur complement of the leading principal submatrix, to be called , is a dense submatrix. Here we compute hierarchical semiseparable (HSS) preconditioners to with the techniques in and report the numbers of preconditioned conjugate gradient (PCG) steps to iteratively solve for a linear system of equations for a random right hand side . The PCG is a very popular technique for solving large SPD systems of equations . We refer the reader to for details about the HSS matrix structure and its numerical construction, but emphasize that the key and most time-consuming step for computing HSS preconditioners is to approximate various off-diagonal blocks of the matrix by matrices of rank or less. We choose convergence tolerance . The conjugate gradient method (CG) without any preconditioning takes iterations to reduce the residual below this tolerance.
Table 2 summarizes our results. We can see that all choices of drastically decrease the number of CG iterations. Howver, the additional reduction in the number of CG iterations is typically small for higher values of . Considering the extra cost involved in higher values in the construction of HSS preconditioners, it seems that higher values are ineffective for this application. This example suggests that for the purpose of constructing preconditioners in structured matrix computations, a small value is typically sufficient to develop highly effective preconditioners. This is consistent with the rule of thumb that typically randomized algorithms require very little oversampling and a value of in between to suffices . In fact, the SVD truncation in Algorithm 2.2 and Algorithm 2.1 is unnecessary for this example.
4 Eigenfaces
Eigenfaces is a well studied method of face recognition based on principal component analysis (PCA), popularised by the seminal work of Turk and Pentland . For more recent work and survey, see and the references therein. In this experiment we demonstrate the effects of randomized algorithms on face recognition.
Typical face recognition starts with a data base of training images, which are then processed as follows:
Calculate the mean of the training images.
Subtract the mean from the training images, obtaining the mean-shifted images.
Calculate a truncated SVD of the mean-shifted images.
Project the mean-shifted images into the singular vector space using the retained singular vectors, obtaining feature vectors.
To classify a new face, one does the following calculations:
Subtract the mean from the new image, obtaining the mean-shifted image.
Project the mean-shifted image into the singular vector space, obtaining a new feature vector.
Find the feature vector in the data base that best matches the new feature vector.
Our face data are obtained from the Database of Faces maintained at the AT&T Laboratories Cambridge . All faces are greyscale images with a consistent resolution. There are ten different images of each of 40 distinct subjects. The size of each image is pixels, with grey levels per pixel. We use 200 of these images, 5 from each individual, as training images, and the remaining ones for classification.
In Figure 4, the first row are the original face images; the second row are eigenfaces with a rank- truncated SVD, and the third row eigenfaces with a rank-.
In addition to the exact truncated SVD, we also perform image training and classification using Algorithm 1.1 with different values. The results are summarized in Table 3. It is clear that smaller values give worse results than truncated SVD, but gives results that are very similar to truncated SVD, even though some of the singular values are accurate to only within to digits. This example demonstrates that limited accuracy that goes beyond being correct to within a constant factor is sufficient for some applications.
Conclusions and Future Work
We have presented some interesting results on randomized algorithms within the framework of the subspace iteration method for singular value and low-rank matrix approximations. While randomized algorithms have been primarily considered as an efficient tool to compute low-rank approximations, our results further suggest that they actually compute the much stronger rank-revealing factorizations, and can be used to reliably estimate condition numbers. We have also presented numerical experimental results that support our analysis.
Acknowledgments. The author would like to thank Shengguo Li, Michael Mahoney, Vladimir Rokhlin, Mark Tygert, Jianlin Xia and Chao Yang for many helpful discussions on this subject. He would especially like to thank Joel Tropp, whose interesting talk at UC Berkeley in the Spring of 2010 sparked the author’s interest on the subject that eventually led to this work, and Chris Melgaard, with whom he had extensive discussions about the material presented in this work. Finally, the author would like to thank the anonymous referees who go out of their ways to provide numerous helpful suggestions that greatly improved the presentation of this paper, including a shorter proof for Theorem 8.
Appendix. For numerical stability, Algorithm A.1 below is often performed once every few iterations in subspace iteration methods, to balance efficiency and numerical stability (see Saad .)
Compute , and QR factorize .
Below is the classical power method for computing the -norm of a given matrix.
Compute .
Compute an orthogonal column basis for .
In situations where no useful information about the leading right singular vector is available, the vector in Algorithm A.2 can also be chosen to be random, to enhance convergence, leading to
Draw a random vector .
Compute .
Compute an orthogonal column basis for .
Appendix S1 Introduction
In the interest of reducing the length of the original paper, we have put some of the non-essential material here. This Supplemental Material is organized as follows: In Section S2 we discuss how the decaying rates of the singular values can affect parameter choices in the randomized algorithms; in Section 8 we present additional supporting numerical experimental results; in Section S4 we provide proofs for the two propositions in the original paper; and in Section S5 we list the facts we have used from calculus.
Appendix S2 Further Convergence Considerations
as the key factor that controls singular value convergence.
First we consider the model where the singular values (except for the first few) decay and satisfy the following equation
for some constant and any . This model is satisfied when the singular values of decay exponentially or faster. We wish to show that Algorithm 1.1 performs better than Algorithm 2.2 with .
according to the singular value decay model (S2.61). On the other hand, for Algorithm 1.1, the ratio is
which is a tighter upper bound. This comparison suggests that in general there is little convergence advantage of Algorithm 2.2 over Algorithm 1.1 when the singular values decay exponentially or faster.
S2.2 Slowly decaying singular value distributions
Below we consider the model where the singular values (except for the first few) decay and satisfy the following equation
S2.3 Adaptive Randomized Algorithms
From the two different singular value distributions discussed above, it is clear that much research is needed to design an efficient algorithm that can automatically choose the right set of parameters for different singular value distributions within the framework of Algorithm 2.2.
In this section, we will limit our scope and present an adaptive version of Algorithm 2.2, with the assumption that the singular values decay slowly. Our goal is to quickly compute rank- approximations up to the tolerance provided. This algorithm is motivated by similar work in and will be used later on in our numerical experiments in Section S3.
: Adaptive Randomized Subspace Iteration Method
Compute .
Compute an orthogonal column basis for .
Compute the SVD of and the rank- truncated SVD .
Quit. Sampling size exceeding limit for the given tolerance
Update .
Update the orthogonal column basis for .
Update the SVD of and the rank- truncated SVD .
Appendix S3 Numerical Experiments
. In this section we report more numerical experimental results to shed more light on randomized algorithms.
Latent Semantic Indexing (LSI) is a massive data processing application based on low-rank approximations . A data base of terms and documents is processed to generate a term-document matrix, where each column is a document with each non-zero in the column represents the weighted number of matches to a particular term.
Given a set of terms (a query), LSI attempts to find the document that best matches it in some semantical sense. To do so, LSI computes a rank- truncated SVD of the term-document matrix so that .
For any query vector , compute the feature vector . The document that most matches is the row of that is the most parallel to .
We use the TDT2 text data . The TDT2 corpus consists of data collected during the first half of 1998 and taken from 6 sources, including 2 newswires (APW, NYT), 2 radio programs (VOA, PRI) and 2 television programs (CNN, ABC). It consists of 11201 on-topic documents which are classified into 96 semantic categories. What is available at is a subset of this corpus, with a total of 9,394 documents and over terms.
We performed random queries with the truncated SVD for different values of . Then we repeat the same queries with the low-rank approximation computed by Algorithm S2.1 for and a decreasing set of values. For each and , Algorithm S2.1 automatically stops once column samples have been reached in computing the low-rank approximation.
Table 4 clearly indicates that better accuracy in randomized algorithms leads to more agreement with the truncated SVD in terms of query matches. Due to the nature of this experiment, an agreement does not always mean a better match. However, Table 4 does give some indication that better accuracy in the low-rank approximation is probably better for LSI. Since looks significantly better than , this example indicates that for LSI, it may be necessary to use Algorithm S2.1 with a small but positive value for best performance.
Appendix S4 Proofs of Propositions 17 and 18
We begin with the following probability tool.
(Chen and Dongarra ) Let be an standard Gaussian random matrix with , and let denote the probability density function of , then satisfies:
The following classical result, the law of the unconscious statistician, will be very helpful to our analysis.
Let be a non-negative continuously differentiable function with , and let be a random matrix, we have
We also need to define the following functions
where and are constants to be specified later on. It is easy to see tht and , and
Proof of Proposition 17: Define a function . Then by Proposition 14, we have
is a Lipschitz function on matrices with Lipschitz constant (see Theorem 16):
For equation (35), we can rewrite, by way of function in (S4.63) and Proposition S4.26,
where in the last equation we have used the fact that and that .
Comparing equations (35) and (S4.65), it is clear that we need to seek a so that
for all values of . This is equivalent to
For , the right hand side reaches its maximum as approaches . Hence it suffices to choose such that
For and , we have . The last equation for is easily satisfied when we choose .
We will now take a similar approach to prove equation (36). We rewrite, by way of function in (S4.63),
Comparing equations (36) and (S4.68), we now must seek a so that
for all values of . Equivalently,
The right hand side approaches the maximum value as approaches . Hence must satisfy
Again the choice satisfies this equation. Q.E.D.
The Proof for Proposition 18 will follow a similar track. However, due to the complications with , we will seek help from Lemma 15 instead of Theorem 16 to shorten the estimation process.
Proof of Proposition 18: As in the proof of Proposition 17, we can write
Following arguments similar to those in the proof of Proposition 17, we have for a constant to be later determined,
Below we will derive lower bounds on (S4.70) for the three difference cases of in Proposition 18. For , equation (S4.70) can be simplified as
for all values of . This condition is very similar to equation (S4.66). Arguments similar to those used to solve (S4.66) lead to
Now we consider the case . We rewrite equation (S4.70) in light of equation (S5.75) in S5:
To prove Proposition 18, we just need to find a constant so that
where the asymptotic term behaves like when is tiny and like when is very large. Equation (S4.71) is equivalent to
All the extra terms involving the function have added much complexity to the above expression. We cut it down with equations (S5.79) and (S5.80) in Appendix S5 by replacing all relevant expressions involving by their corresponding calculus upper bounds. This gives
It is now time to prove equation (48). Our approach for is similar. We rewrite, by way of function in (S4.63),
Similarly, we seek a so that
This last equation is very similar to equation (S4.69), with the only difference being the coefficients in the second term on the left hand side. Thus its solution similarly satisfies
The special cases and lead to some involved calculations with Lemma 15. Instead, we will appeal to Lemma S4.25, an upper bound on the probability density function of smallest eigenvalue of the Wishart matrix . It is a happy coincidence that this upper bound is reasonably tight for . By Lemma S4.25,
The integral in equation (S4.73) can be bounded as
Below we further simplify equation (S4.74). For , the integral in (S4.74) becomes, according to equation (S5.77) in S5:
Replacing the integral in equation (S4.74), and plugging the resulting upper bound into equation (S4.73), we obtain the desired equation (48) for .
Finally we consider the case . The integral in equation (S4.74) can be rewritten as
where we have used the substitution . Applying the inequality
to both factors in the denominator above, and utilizing the identity (S5.78) from S5, we bound the integral from above as
which leads to the desired equation (48) for . Q.E.D.
Appendix S5 Facts from Calculus
Here we list the facts we have used from calculus. Their proofs have been left out, since they do not provide any additional insight into our analysis. We start with definite integrals:
where , are all positive constants. We will also list the following inequalities for any :