# Low-Rank Approximation Toolbox: Analysis of the Randomized SVD

In the previous post, we looked at the randomized SVD. In this post, we continue this discussion by looking at the analysis of the randomized SVD. Our approach is adapted from a new analysis of the randomized SVD by Joel A. Tropp and Robert J. Webber.

There are many types of analysis one can do for the randomized SVD. For instance, letting be a matrix and the rank- output of the randomized SVD, natural questions include:

• What is the expected error measured in some norm ? What about expected squared error ? How do these answers change with different norms?
• How large can the randomized SVD error get except for some small failure probability ?
• How close is the randomized SVD truncated to rank compared to the best rank- approximation to ?
• How close are the singular values and vectors of the randomized SVD approximation compared to those of ?

Implicitly and explicitly, the analysis of Tropp and Webber provides satisfactory answers to a number of these questions. In the interest of simplifying the presentation, we shall focus our presentation on just one of these questions, proving following result:

Here, is the Frobenius norm. We encourage the interested reader to check out Tropp and Webber’s paper to see the methodology we summarize here used to prove numerous facts about the randomized SVD and its extensions using subspace iteration and block Krylov iteration.

## Projection Formula

Let us recall the randomized SVD as we presented it in last post:

1. Collect information. Form where is an appropriately chosen random matrix.
2. Orthogonalize. Compute an orthonormal basis for the column space of by, e.g., thin QR factorization.
3. Project. Form , where denotes the conjugate transpose.

The randomized SVD is the approximation

It is easy to upgrade into a compact SVD form , as we did as steps 4 and 5 in the previous post.

For the analysis of the randomized SVD, it is helpful to notice that the approximation takes the form

Here, denotes the orthogonal projection onto the column space of the matrix . We call the projection formula for the randomized SVD.1This formula bares a good deal of similarity to the projection formula for the Nyström approximation. This is not a coincidence.

## Aside: Quadratic Unitarily Invariant Norms

To state our error bounds in the most general language, we can adopt the language of quadratic unitarily invariant norms. Recall that a square matrix is unitary if

You may recall from my post on Nyström approximation that a norm on matrices is unitarily invariant if

A unitarily invariant norm is said to be quadratic if there exists another unitarily invariant norm such that

(1)

Many examples of quadratic unitarily invariant norms are found among the Schatten -norms, defined as

Here, denote the decreasingly order singular values of . The Schatten -norm is the Frobenius norm of a matrix. The spectral norm (i.e., operator 2-norm) is the Schatten -norm, defined to be

The Schatten -norms are unitarily invariant norms for every . However, the Schatten -norms are quadratic unitarily invariant norms only for since

For the remainder of this post, we let and be a quadratic unitarily invariant norm pair satisfying (1).

## Error Decomposition

The starting point of our analysis is the following decomposition of the error of the randomized SVD:

(2)

Recall that we have defined to be an optimal rank- approximation to :

Thus, the error decomposition says that the excess error is bounded by

Using the projection formula, we can prove the error decomposition (2) directly:

The first line is the projection formula, the second is relation between and , and the third is the triangle inequality. For the fifth line, we use the fact that is an orthoprojector and thus has unit spectral norm together with the fact that

For the final inequality, we used commutation rule

## Bounding the Error

In this section, we shall continue to refine the error decomposition (2). Consider a thin SVD of , partitioned as

where

• and both have orthonormal columns,
• and are square diagonal matrices with nonnegative entries,
• and have columns, and
• is an matrix.

Under this notation, the best rank- approximation is . Define

We assume throughout that is full-rank (i.e., ).

Applying the error decomposition (2), we get

(3)

For the second line, we used the unitary invariance of . Observe that the column space of is a subset of the column space of so

(4)

Let’s work on simplifying the expression

First, observe that

Thus, the projector takes the form

Here, denotes the Moore–Penrose pseudoinverse, which reduces to the ordinary matrix inverse for a square nonsingular matrix. Thus,

(5)

Remarkably, this seemingly convoluted combination of matrices actually is a well-studied operation in matrix theory, the parallel sum. The parallel sum of positive semidefinite matrices and is defined as

(6)

We will have much more to say about the parallel sum soon. For now, we use this notation to rewrite (5) as

Plugging this back into (4) and then (3), we obtain the error bound

(7)

Simplifying this expression further will require more knowledge about parallel sums, which we shall discuss now.

## Aside: Parallel Sums

Let us put aside the randomized SVD for a moment and digress to the seemingly unrelated topic of electrical circuits. Suppose we have a battery of voltage and we connect the ends using a wire of resistance . The current is given by Ohm’s law

Similarly, if the wire is replaced by a different wire with resistance , the current is then

Now comes the interesting question. What if we connect the battery by both wires (resistances and ) simultaneously in parallel, so that current can flow through either wire? Since wires of resistances and still have voltage , Ohm’s law still applies and thus the total current is

The net effect of connecting resisting wires of resistances and is the same as a single resisting wire of resistance

(8)

We call the the operation the parallel sum of and because it describes how resistances combine when connected in parallel.

The parallel sum operation can be extended to all nonnegative numbers and by continuity:

Electrically, this definition states that one obtains a short circuit (resistance ) if either of the wires carries zero resistance.

Parallel sums of matrices were introduced by William N. Anderson, Jr. and Richard J. Duffin as a generalization of the parallel sum operation from electrical circuits. There are several equivalent definitions. The natural definition (8) applies for positive definite matrices

This definition can be extended to positive semidefinite matrices by continuity. It can be useful to have an explicit definition which applies even to positive semidefinite matrices. To do so, observe that the (scalar) parallel sum satisfies the identity

To extend to matrices, we capitalize the letters and use the Moore–Penrose pseudoinverse in place of the inverse:

This was the definition (6) of the parallel sum we gave above which we found naturally in our randomized SVD error bounds.

The parallel sum enjoys a number of beautiful properties, some of which we list here:

1. Symmetry. ,
2. Simplified formula. for positive definite matrices,
3. Bounds. and .
4. Monotone. is monotone in the Loewner order.
5. Concavity. The map is (jointly) concave (with respect to the Loewner order).
6. Conjugation. For any square , .
7. Trace. .2In fact, this property holds with the trace replaced by any positive linear map. That is, if is a linear map from square matrices to square matrices satisfying if , then .
8. Unitarily invariant norms. .

For completionists, we include a proof of the last property for reference.

Proof of Property 8
Let be the unitarily invariant norm dual to .3Dual with respect to the Frobenius inner product, that is. By duality, we have

The first line is duality, the second holds because , the third line is property 6, the fourth line is property 7, the fifth line is property 4, and the sixth line is duality.

## Nearing the Finish: Enter the Randomness

Equipped with knowledge about parallel sums, we are now prepared to return to bounding the error of the randomized SVD. Apply property 8 of the parallel sum to the randomized SVD bound (7) to obtain

This bound is totally deterministic: It holds for any choice of test matrix , random or otherwise. We can use this bound to analyze the randomized SVD in many different ways for different kinds of random (or non-random) matrices . Tropp and Webber provide a number of examples instantiating this general bound in different ways.

We shall present only the simplest error bound for randomized SVD. We make the following assumptions:

• The test matrix is standard Gaussian.4By which, we mean the entries of are independent and standard normal.
• The norm is the Frobenius norm .
• The randomized SVD rank is .

Under these assumptions and using the property , we obtain the following expression for the expected error of the randomized SVD

(9)

All that is left to is compute the expectation of . Remarkably, this can be done in closed form.

## Aside: Expectation of Gaussian–Inverse Gaussian Matrix Product

The final ingredient in our randomized SVD analysis is the following computation involving Gaussian random matrices. Let and be independent standard Gaussian random matrices with of size , . Then

For the probability lovers, we will now go on to prove this. For those who are less probabilistically inclined, this result can be treated as a black box.

Proof of Random Matrix Formula
To prove this, first consider a simpler case where does not appear:

Here, we used the fact that the entries are independent, mean-zero, and variance-one. Thus, applying this result conditionally on with , we get

(10)

To compute , we rewrite using the trace

The matrix is known as an inverse-Wishart matrix and is a well-studied random matrix model. In particular, its expectation is known to be . Thus, we obtain

Plugging into (10), we obtain the desired conclusion

This completes the proof.

## Wrapping it All Up

We’re now within striking distance. All that is left is to assemble the pieces we have been working with to obtain a final bound for the randomized SVD.

Recall we have chosen the random matrix to be standard Gaussian. By the rotational invariance of the Gaussian distribution, and are independent and standard Gaussian as well. Plugging the matrix expectation bound to (9) then completes the analysis

# Low-Rank Approximation Toolbox: Randomized SVD

The randomized SVD and its relatives are workhorse algorithms for low-rank approximation. In this post, I hope to provide a fairly brief introduction to this useful method. In the following post, we’ll look into its analysis.

The randomized SVD is dead-simple to state: To approximate an matrix by a rank- matrix, perform the following steps:

1. Collect information. Form where is an appropriately chosen random matrix.
2. Orthogonalize. Compute an orthonormal basis for the column space of by, e.g., thin QR factorization.
3. Project. Form . (Here, denotes the conjugate transpose of a complex matrix, which reduces to the ordinary transpose if the matrix is real.)

If all one cares about is a low-rank approximation to the matrix , one can stop the randomized SVD here, having obtained the approximation

As the name “randomized SVD” suggests, one can easily “upgrade” the approximation to a compact SVD format:

1. SVD. Compute a compact SVD of the matrix : where and and and is .
2. Clean up. Set .

We now have approximated by a rank- matrix in compact SVD form:

One can use the factors , , and of the approximation as estimates of the singular vectors and values of the matrix .

## What Can You Do with the Randomized SVD?

The randomized SVD has many uses. Pretty much anywhere you would ordinarily use an SVD is a candidate for the randomized SVD. Applications include model reduction, fast direct solvers, computational biology, uncertainty quantification, among numerous others.

To speak in broad generalities, there are two ways to use the randomized SVD:

• As an approximation. First, we could use as a compressed approximation to . Using the format , requires just numbers of storage, whereas requires a much larger numbers of storage. As I detailed at length in my blog post on low-rank matrices, many operations are cheap for the low-rank matrix . For instance, we can compute a matrix–vector product in roughly operations rather than the operations to compute . For these use cases, we don’t need the “SVD” part of the randomized SVD.
• As an approximate SVD. Second, we can actually use the , , and produced by the randomized SVD as approximations to the singular vectors and values of . In these applications, we should be careful. Just because is a good approximation to , it is not necessarily the case that , , and are close to the singular vectors and values of . To use the randomized SVD in this context, it is safest to use posterior diagnostics (such as the ones developed in this paper of mine) to ensure that the singular values/vectors of interest are computed to a high enough accuracy. A useful rule of thumb is the smallest two to five singular values and vectors computed by the randomized SVD are suspect and should be used in applications only with extreme caution. When the appropriate care is taken and for certain problems, the randomized SVD can provide accurate singular vectors far faster than direct methods.

## Accuracy of the Randomized SVD

How accurate is the approximation produced by the randomized SVD? No rank- approximation can be more accurate than the best rank- approximation to the matrix , furnished by an exact SVD of truncated to rank . Thus, we’re interested in how much larger is than .

### Frobenius Norm Error

A representative result describing the error of the randomized SVD is the following:

(1)

This result states that the average squared Frobenius-norm error of the randomized SVD is comparable with the best rank- approximation error for any . In particular, choosing , we see that the randomized SVD error is at most times the best rank- approximation

(2)

Choosing , we see that the randomized SVD has at most twice the error of the best rank- approximation

(3)

In effect, these results tell us that if we want an approximation that is nearly as good as the best rank- approximation, using an approximation rank of, say, or for the randomized SVD suffices. These results hold even for worst-case matrices. For nice matrices with steadily decaying singular values, the randomized SVD can perform even better than equations (2)–(3) would suggest.

### Spectral Norm Error

The spectral norm is often a better error metric for matrix computations than the Frobenius norm. Is the randomized SVD also comparable with the best rank- approximation when we use the spectral norm? In this setting, a representative error bound is

(4)

The spectral norm error of the randomized SVD depends on the Frobenius norm error of the best rank- approximation for .

Recall that the spectral and Frobenius norm can be defined in terms of the singular values of the matrix :

Rewriting (4) using these formulas, we get

Despite being interested in the largest singular value of the error matrix , this bound demonstrates that the randomized SVD incurs errors based on the entire tail of ‘s singular values . The randomized SVD is much worse than the best rank- approximation for a matrix with a long detail of slowly declining singular values.

## Improving the Approximation: Subspace Iteration and Block Krylov Iteration

We saw that the randomized SVD produces nearly optimal low-rank approximations when we measure using the Frobenius norm. When we measure using the spectral norm, we have a split decision: If the singular values decay rapidly, the randomized SVD is near-optimal; if the singular values decay more slowly, the randomized SVD can suffer from large errors.

Fortunately, there are two fixes to improve the randomized SVD in the presence of slowly decaying singular values:

• Subspace iteration: To improve the quality of the randomized SVD, we can combine it with the famous power method for eigenvalue computations. Instead of , we use the powered expression . Powering has the effect of amplifying the large singular values of and dimishing the influence of the tail.
• Block Krylov iteration: Subspace iteration is effective, but fairly wasteful. To compute we compute the block Krylov sequence

and throw away all but the last term. To make more economical use of resources, we can use the entire sequence as our information matrix :

Storing the entire block Krylov sequence is more memory-intensive but makes more efficient use of matrix products than subspace iteration.

Both subspace iteration and block Krylov iteration should be carefully implemented to produce accurate results.

Both subspace iteration and block Krylov iteration diminish the effect of a slowly decaying tail of singular values on the accuracy of the randomized SVD. The more slowly the tail decays, the larger one must take the number of iterations to obtain accurate results.

# Low-Rank Approximation Toolbox: Nyström, Cholesky, and Schur

In the last post, we looked at the Nyström approximation to an positive semidefinite (psd) matrix . A special case was the column Nyström approximation, defined to be1We use Matlab index notation to indicate submatrices of .

(Nys)

where identifies a subset of columns of . Provided , this allowed us to approximate all entries of the matrix using only the entries in columns of , a huge savings of computational effort!

With the column Nyström approximation presented just as such, many questions remain:

• Why this formula?
• Where did it come from?
• How do we pick the columns ?
• What is the residual of the approximation?

In this post, we will answer all of these questions by drawing a connection between low-rank approximation by Nyström approximation and solving linear systems of equations by Gaussian elimination. The connection between these two seemingly unrelated areas of matrix computations will pay dividends, leading to effective algorithms to compute Nyström approximations by the (partial) Cholesky factorization of a positive (semi)definite matrix and an elegant description of the residual of the Nyström approximation as the Schur complement.

## Cholesky: Solving Linear Systems

Suppose we want solve the system of linear equations , where is a real invertible matrix and is a vector of length . The standard way of doing this in modern practice (at least for non-huge matrices ) is by means of Gaussian elimination/LU factorization. We factor the matrix as a product of a lower triangular matrix and an upper triangular matrix .2To make this accurate, we usually have to reorder the rows of the matrix as well. Thus, we actually compute a factorization where is a permutation matrix and and are triangular. The system is solved by first solving for and then for ; the triangularity of and make solving the associated systems of linear equations easy.

For real symmetric positive definite matrix , a simplification is possible. In this case, one can compute an LU factorization where the matrices and are transposes of each other, . This factorization is known as a Cholesky factorization of the matrix .

The Cholesky factorization can be easily generalized to allow the matrix to be complex-valued. For a complex-valued positive definite matrix , its Cholesky decomposition takes the form , where is again a lower triangular matrix. All that has changed is that the transpose has been replaced by the conjugate transpose . We shall work with the more general complex case going forward, though the reader is free to imagine all matrices as real and interpret the operation as ordinary transposition if they so choose.

## Schur: Computing the Cholesky Factorization

Here’s one way of computing the Cholesky factorization using recursion. Write the matrix in block form as

Our first step will be “block Cholesky factorize” the matrix , factoring as a product of matrices which are only block triangular. Then, we’ll “upgrade” this block factorization into a full Cholesky factorization.

The core idea of Gaussian elimination is to combine rows of a matrix to introduce zero entries. For our case, observe that multiplying the first block row of by and subtracting this from the second block row introduces a matrix of zeros into the bottom left block of . (The matrix is a principal submatrix of and is therefore guaranteed to be positive definite and thus invertible.3To directly see is positive definite, for instance, observe that since is positive definite, for every nonzero vector .) In matrix language,

Isolating on the left-hand side of this equation by multiplying by

yields the block triangular factorization

We’ve factored into block triangular pieces, but these pieces are not (conjugate) transposes of each other. Thus, to make this equation more symmetrical, we can further decompose

(1)

This is a block version of the Cholesky decomposition of the matrix taking the form , where is a block lower triangular matrix and is a block diagonal matrix.

We’ve met the second of our main characters, the Schur complement

(Sch)

This seemingly innocuous combination of matrices has a tendency to show up in surprising places when one works with matrices.4See my post on the Schur complement for more examples. It’s appearance in any one place is unremarkable, but the shear ubiquity of in matrix theory makes it deserving of its special name, the Schur complement. To us for now, the Schur complement is just the matrix appearing in the bottom right corner of our block Cholesky factorization.

The Schur complement enjoys the following property:5This property is a consequence of equation (1) together with the conjugation rule for positive (semi)definiteness, which I discussed in this previous post.

Positivity of the Schur complement: If is positive (semi)definite, then the Schur complement is positive (semi)definite.

As a consequence of this property, we conclude that both and are positive definite.

With the positive definiteness of the Schur complement in hand, we now return to our Cholesky factorization algorithm. Continue by recursively6As always with recursion, one needs to specify the base case. For us, the base case is just that Cholesky decomposition of a matrix is . computing Cholesky factorizations of the diagonal blocks

Inserting these into the block factorization (1) and simplifying gives a Cholesky factorization, as desired:

Voilà, we have obtained a Cholesky factorization of a positive definite matrix !

By unwinding the recursions (and always choosing the top left block to be of size ), our recursive Cholesky algorithm becomes the following iterative algorithm: Initialize to be the zero matrix. For , perform the following steps:

1. Update . Set the th column of :

2. Update . Update the bottom right portion of to be the Schur complement:

This iterative algorithm is how Cholesky factorization is typically presented in textbooks.

## Nyström: Using Cholesky Factorization for Low-Rank Approximation

Our motivating interest in studying the Cholesky factorization was the solution of linear systems of equations for a positive definite matrix . We can also use the Cholesky factorization for a very different task, low-rank approximation.

Let’s first look at things through the lense of the recursive form of the Cholesky factorization. The first step of the factorization was to form the block Cholesky factorization

Suppose that we choose the top left block to be of size , where is much smaller than . The most expensive part of the Cholesky factorization will be the recursive factorization of the Schur complement , which is a large matrix of size .

To reduce computational cost, we ask the provocative question: What if we simply didn’t factorize the Schur complement? Observe that we can write the block Cholesky factorization as a sum of two terms

(2)

We can use the first term of this sum as a rank- approximation to the matrix . The low-rank approximation, which we can write out more conveniently as

is the column Nyström approximation (Nys) to associated with the index set and is the final of our three titular characters. The residual of the Nyström approximation is the second term in (2), which is none other than the Schur complement (Sch), padded by rows and columns of zeros:

Observe that the approximation is obtained from the process of terminating a Cholesky factorization midway through algorithm execution, so we say that the Nyström approximation results from a partial Cholesky factorization of the matrix .

Summing things up:

If we perform a partial Cholesky factorization on a positive (semi)definite matrix, we obtain a low-rank approximation known as the column Nyström approximation. The residual of this approximation is the Schur complement, padded by rows and columns of zeros.

The idea of obtaining a low-rank approximation from a partial matrix factorization is very common in matrix computations. Indeed, the optimal low-rank approximation to a real symmetric matrix is obtained by truncating its eigenvalue decomposition and the optimal low-rank approximation to a general matrix is obtained by truncating its singular value decomposition. While the column Nyström approximation is not the optimal rank- approximation to (though it does satisfy a weaker notion of optimality, as discussed in this previous post), it has a killer feature not possessed by the optimal approximation:

The column Nyström approximation is formed from only columns from the matrix . A column Nyström approximation approximates an matrix by only reading a fraction of its entries!

Unfortunately there’s not a free lunch here. The column Nyström is only a good low-rank approximation if the Schur complement has small entries. In general, this need not be the case. Fortunately, we can improve our situation by means of pivoting.

Our iterative Cholesky algorithm first performs elimination using the entry in position followed by position and so on. There’s no need to insist on this exact ordering of elimination steps. Indeed, at each step of the Cholesky algorithm, we can choose whichever diagonal position that we want to perform elimination. The entry we choose to perform elimination with is called a pivot.

Obtaining good column Nyström approximations requires identifying the a good choice for the pivots to reduce the size of the entries of the Schur complement at each step of the algorithm. With general pivot selection, an iterative algorithm for computing a column Nyström approximation by partial Cholesky factorization proceeds as follows: Initialize an matrix to store the column Nyström approximation , in factored form. For , perform the following steps:

1. Select pivot. Choose a pivot .
2. Update the approximation. .
3. Update the residual. .

This procedure results in the Nyström approximation (Nys) with column set :

The pivoted Cholesky steps 1–3 requires updating the entire matrix at every step. With a little more cleverness, we can optimize this procedure to only update the entries of the matrix we need to form the approximation . See Algorithm 2 in this preprint of my coauthors and I for details.

How should we choose the pivots? Two simple strategies immediately suggest themselves:

• Uniformly random. At each step , select uniformly at random from among the un-selected pivot indices.
• Greedy.7The greedy pivoting selection is sometimes known as diagonal pivoting or complete pivoting in the numerical analysis literature. At each step , select according to the largest diagonal entry of the current residual :

The greedy strategy often (but not always) works well, and the uniformly random approach can work surprisingly well if the matrix is “incoherent”, with all rows and columns of the matrix possessing “similar importance”.

Despite often working fairly well, both the uniform and greedy schemes can fail significantly, producing very low-quality approximations. My research (joint with Yifan Chen, Joel A. Tropp, and Robert J. Webber) has investigated a third strategy striking a balance between these two approaches:

• Diagonally weighted random. At each step , select at random according to the probability weights based on the current diagonal of the matrix

Our paper provides theoretical analysis and empirical evidence showing that this diagonally-weighted random pivot selection (which we call randomly pivoted Cholesky aka RPCholesky) performs well at approximating all positive semidefinite matrices , even those for which uniform random and greedy pivot selection fail. The success of this approach can be seen in the following examples (from Figure 1 in the paper), which shows RPCholesky can produce much smaller errors than the greedy and uniform methods.

## Conclusions

In this post, we’ve seen that a column Nyström approximation can be obtained from a partial Cholesky decomposition. The residual of the approximation is the Schur complement. I hope you agree that this is a very nice connection between these three ideas. But beyond its mathematical beauty, why do we care about this connection? Here are my reasons for caring:

• Analysis. Cholesky factorization and the Schur complement are very well-studied in matrix theory. We can use known facts about Cholesky factorization and Schur complements to prove things about the Nyström approximation, as we did when we invoked the positivity of the Schur complement.
• Algorithms. Cholesky factorization-based algorithms like randomly pivoted Cholesky are effective in practice at producing high-quality column Nyström approximations.

On a broader level, our tale of Nyström, Cholesky, and Schur demonstrates that there are rich connections between low-rank approximation and (partial versions of) classical matrix factorizations like LU (with partial pivoting), Cholesky, QR, eigendecomposition, and SVD for to full-rank matrices. These connections can be vital to analyzing low-rank approximation algorithms and developing improvements.

# Low-Rank Approximation Toolbox: Nyström Approximation

Welcome to a new series for this blog, Low-Rank Approximation Toolbox. As I discussed in a previous post, many matrices we encounter in applications are well-approximated by a matrix with a small rank. Efficiently computing low-rank approximations has been a major area of research, with applications in everything from classical problems in computational physics and signal processing to trendy topics like data science. In this series, I want to explore some broadly useful algorithms and theoretical techniques in the field of low-rank approximation.

I want to begin this series by talking about one of the fundamental types of low-rank approximation, the Nyström approximation of a (real symmetric or complex Hermitian) positive semidefinite (psd) matrix . Given an arbitrary “test matrix” , the Nyström approximation is defined to be

(1)

This formula is sensible whenever is invertible; if is not invertible, then the inverse should be replaced by the Moore–Penrose pseudoinverse . For simplicity, I will assume that is invertible in this post, though everything we discuss will continue to work if this assumption is dropped. I use to denote the conjugate transpose of a matrix, which agrees with the ordinary transpose for real matrices. I will use the word self-adjoint to refer to a matrix which satisfies .

The Nyström approximation (1) answers the question

What is the “best” rank- approximation to the psd matrx provided only with the matrix–matrix product , where is a known matrix ()?

Indeed, if we let , we observe that the Nyström approximation can be written entirely using and :

This is central advantage of the Nyström approximation: to compute it, the only access to the matrix I need is the ability to multiply the matrices and . In particular, I only need a single pass over the entries of to compute the Nyström approximation. This allows the Nyström approximation to be used in settings when other low-rank approximations wouldn’t work, such as when is streamed to me as a sum of matrices that must be processed as they arrive and then discarded.

## Choosing the Test Matrix

Every choice of test matrix defines a rank- Nyström approximation1Actually, is only rank at most . For this post, we will use rank- to mean “rank at most “. by (1). Unfortunately, the Nyström approximation won’t be a good low-rank approximation for every choice of . For an example of what can go wrong, if we pick to have columns selected from the eigenvectors of with small eigenvalues, the approximation will be quite poor.

The very best choice of would be the eigenvectors associated with the largest eigenvalues. Unfortunately, computing the eigenvectors to high accuracy is computationally costly. Fortunately, we can get decent low-rank approximations out of much simpler ‘s:

1. Random: Perhaps surprisingly, we get a fairly low-rank approximation out of just choosing to be a random matrix, say, populated with statistically independent standard normal random entries. Intuitively, a random matrix is likely to have columns with meaningful overlap with the large-eigenvalue eigenvectors of (and indeed with any fixed orthonormal vectors). One can also pick more exotic kinds of random matrices, which can have computational benefits.
2. Random then improve: The more similar the test matrix is to the large-eigenvalue eigenvectors of , the better the low-rank approximation will be. Therefore, it makes sense to use the power method (usually called subspace iteration in this context) to improve a random initial test matrix to be closer to the eigenvectors of .2Even better than subspace iteration is block Krylov iteration. See section 11.6 of the following survey for details.
3. Column selection: If consists of columns of the identity matrix, then just consists of columns of : In MATLAB notation,

This is highly appealing as it allows us to approximate the matrix by only reading a small fraction of its entries (provided )! Producing a good low-rank approximation requires selecting the right column indices (usually under the constraint of reading a small number of entries from ). In my research with Yifan Chen, Joel A. Tropp, and Robert J. Webber, I’ve argued that the most well-rounded algorithm for this task is a randomly pivoted partial Cholesky decomposition.

## The Projection Formula

Now that we’ve discussed the choice of test matrix, we shall explore the quality of the Nyström approximation as measured by the size of the residual . As a first step, we shall show that the residual is psd. This means that is an underapproximation to .

The positive semidefiniteness of the residual follows from the following projection formula for the Nyström approximation:

Here, denotes the the orthogonal projection onto the column space of the matrix . To deduce the projection formula, we break down as in (1):

The fact that the paranthesized quantity is can be verified in a variety of ways, such as by QR factorization.3Let , where has orthonormal columns and is square and upper triangular. The orthogonal projection is . The parenthesized expression is .

With the projection formula in hand, we easily obtain the following expression for the residual:

To show that this residual is psd, we make use of the conjugation rule.

Conjugation rule: For a matrix and a self-adjoint matrix , if is psd then is psd. If is invertible, then the converse holds: if is psd, then is psd.

The matrix is an orthogonal projection and therefore psd. Thus, by the conjugation rule, the residual of the is Nyström approximation is psd:

## Optimality of the Nyström Approximation

There’s a question we’ve been putting off that can’t be deferred any longer:

Is the Nyström approximation actually a good low-rank approximation?

As we discussed earlier, the answer to this question depends on the test matrix . Different choices for give different approximation errors. See the following papers for Nyström approximation error bounds with different choices of . While the Nyström approximation can be better or worse depending on the choice of , what is true about Nyström approximation for every choice of is that:

The Nyström approximation is the best possible rank- approximation to given the information .

In precise terms, I mean the following:

Theorem: Out of all self-adjoint matrices spanned by the columns of with a psd residual , the Nyström approximation has the smallest error as measured by either the spectral or Frobenius norm (or indeed any unitarily invariant norm, see below).

Let’s break this statement down a bit. This result states that the Nyström approximation is the best approximation to under three conditions:

2. is spanned by the columns of .

I find these first two requirements to be natural. Since is self-adjoint, it makes sense to require our approximation to be as well. The stipulation that is spanned by the columns seems like a very natural requirement given we want to think of approximations which only use the information . Additionally, requirement 2 ensures that has rank at most , so we are really only considering low-rank approximations to .

The last requirement is less natural:

1. The residual is psd.

This is not an obvious requirement to impose on our approximation. Indeed, it was a nontrivial calculation using the projection formula to show that the Nyström approximation itself satisfies this requirement! Nevertheless, this third stipulation is required to make the theorem true. The Nyström approximation (1) is the best “underapproximation” to the matrix to in the span of .

## Intermezzo: Unitarily Invariant Norms and the Psd Order

To prove our theorem about the optimality of the Nyström approximation, we shall need two ideas from matrix theory: unitarily invariant norms and the psd order. We shall briefly describe each in turn.

A norm defined on the set of matrices is said to be unitarily invariant if the norm of a matrix does not change upon left- or right-multiplication by a unitary matrix:

Recall that a unitary matrix (called a real orthogonal matrix if is real-valued) is one that obeys . Unitary matrices preserve the Euclidean lengths of vectors, which makes the class of unitarily invariant norms highly natural. Important examples include the spectral, Frobenius, and nuclear matrix norms:

The unitarily invariant norm of a matrix depends entirely on its singular values . For instance, the spectral, Frobenius, and nuclear norms take the forms

In addition to being entirely determined by the singular values, unitarily invariant norms are non-decreasing functions of the singular values: If the th singular value of is larger than the th singular value of for , then for every unitarily invariant norm . For more on unitarily invariant norms, see this short and information-packed blog post from Nick Higham.

Our second ingredient is the psd order (also known as the Loewner order). A self-adjoint matrix is larger than a self-adjoint matrix according to the psd order, written , if the difference is psd. As a consequence, if and only if is psd, where here denotes the zero matrix of the same size as . Using the psd order, the positive semidefiniteness of the Nyström residual can be written as .

If and are both psd matrices and is larger than in the psd order, , it seems natural to expect that is larger than in norm. Indeed, this intuitive statement is true, at least when one restricts oneself to unitarily invariant norms.

Psd order and norms. If , then for every unitarily invariant norm .

This fact is a consequence of the following observations:

• If , then the eigenvalues of are larger than in the sense that the th largest eigenvalue of is larger than the th largest eigenvalue of .
• The singular values of a psd matrix are its eigenvalues.
• Unitarily invariant norms are non-decreasing functions of the singular values.

## Optimality of the Nyström Approximation: Proof

In this section, we’ll prove our theorem showing the Nyström approximation is the best low-rank approximation satisfying properties 1, 2, and 3. To this end, let be any matrix satisfying properties 1, 2, and 3. Because of properties 1 (self-adjointness) and 2 (spanned by columns of ), can be written in the form

where is a self-adjoint matrix. To make this more similar to the projection formula, we can factor on both sides to obtain

To make this more comparable to the projection formula, we can reparametrize by introducing a matrix with orthonormal columns with the same column space as . Under this parametrization, takes the form

The residual of this approximation is

(2)

We now make use of the of conjugation rule again. To simplify things, we make the assumption that is invertible. (As an exercise, see if you can adapt this argument to the case when this assumption doesn’t hold!) Since is psd (property 3), the conjugation rule tells us that

What does this observation tell us about ? We can apply the conjugation rule again to conclude

(Notice that since has orthonormal columns.)

We are now in a place to show that . Indeed,

The second line is the projection formula together with the observation that and the last line is the conjugation rule combined with the fact that is psd. Thus, having shown

we conclude