# Note to Self: Norm of a Gaussian Random Vector

Let be a standard Gaussian vector—that is, a vector populated by independent standard normal random variables. What is the expected length of ? (Here, and throughout, denotes the Euclidean norm of a vector.) The length of is the square root of the sum of independent standard normal random variables

which is known as a random variable with degrees of freedom. (Not to be confused with a random variable!) Its mean value is given by the rather unpleasant formula

where is the gamma function. If you are familiar with the definition of the gamma function, the derivation of this formula is not too hard—it follows from a change of variables to -dimensional spherical coordinates.

This formula can be difficult to interpret and use. Fortunately, we have the rather nice bounds

(1)

This result appears, for example, page 11 of this paper. These bounds show that, for large , is quite close to . The authors of the paper remark that this inequality can be probed by induction. I had difficulty reproducing the inductive argument for myself. Fortunately, I found a different proof which I thought was very nice, so I thought I would share it here.

Our core tool will be Wendel’s inequality (see (7) in Wendel’s original paper): For and , we have

(2)

Let us first use Wendel’s inequality to prove (1). Indeed, invoke Wendel’s inequality with and and multiply by to obtain

which simplifies directly to (1).

Now, let’s prove Wendel’s inequality (2). The key property for us will be the strict log-convexity of the gamma function: For real numbers and ,

(3)

We take this property as established and use it to prove Wendel’s inequality. First, use the log-convexity property (3) with to obtain

Divide by and use the property that to conclude

(4)

This proves the upper bound in Wendel’s inequality (2). To prove the lower bound, invoke the upper bound (4) with in place of and in place of to obtain

Multiplying by , dividing by , and using again yields

finishing the proof of Wendel’s inequality.

Notes. The upper bound in (1) can be proven directly by Lyapunov’s inequality: , where we use the fact that is the sum of random variables with mean one. The weaker lower bound follows from a weaker version of Wendel’s inequality, Gautschi’s inequality.

After the initial publication of this post, Sam Buchanan mentioned another proof of the lower bound using the Gaussian Poincaré inequality. This inequality states that, for a function ,

To prove the lower bound, set which has gradient . Thus,

Rearrange to obtain .

# Stochastic Trace Estimation

I am delighted to share that me, Joel A. Tropp, and Robert J. Webber‘s paper XTrace: Making the Most of Every Sample in Stochastic Trace Estimation has recently been released as a preprint on arXiv. In it, we consider the implicit trace estimation problem:

Implicit trace estimation problem: Given access to a square matrix via the matrix–vector product operation , estimate its trace .

Algorithms for this task have many uses such as log-determinant computations in machine learning, partition function calculations in statistical physics, and generalized cross validation for smoothing splines. I described another application to counting triangles in a large network in a previous blog post.

Our paper presents new trace estimators XTrace and XNysTrace which are highly efficient, producing accurate trace approximations using a small budget of matrix–vector products. In addition, these algorithms are fast to run and are supported by theoretical results which explain their excellent performance. I really hope that you will check out the paper to learn more about these estimators!

For the rest of this post, I’m going to talk about the most basic stochastic trace estimation algorithm, the GirardHutchinson estimator. This seemingly simple algorithm exhibits a number of nuances and forms the backbone for more sophisticated trace estimates such as Hutch++, Nyström++, XTrace, and XNysTrace. Toward the end, this blog post will be fairly mathematical, but I hope that the beginning will be fairly accessible to all.

## Girard–Hutchinson Estimator: The Basics

The GirardHutchinson estimator for the trace of a square matrix is

(1)

Here, are random vectors, usually chosen to be statistically independent, and denotes the conjugate transpose of a vector or matrix. The Girard–Hutchinson estimator only depends on the matrix through the matrix–vector products .

### Unbiasedness

Provided the random vectors are isotropic

(2)

the Girard–Hutchinson estimator is unbiased:

(3)

Let us confirm this claim in some detail. First, we use linearity of expectation to evaluate

(4)

Therefore, to prove that , it is sufficient to prove that for each .

When working with traces, there are two tricks that solve 90% of derivations. The first trick is that, if we view a number as a matrix, then a number equals its trace, . The second trick is the cyclic property: For a matrix and a matrix , we have . The cyclic property should be handled with care when one works with a product of three or more matrices. For instance, we have

However,

One should think of the matrix product as beads on a closed loop of string. One can move the last bead to the front of the other two, , but not interchange two beads, .

With this trick in hand, let’s return to proving that for every . Apply our two tricks:

The expectation is a linear operation and the matrix is non-random, so we can bring the expectation into the trace as

Invoke the isotropy condition (2) and conclude:

Plugging this into (4) confirms the unbiasedness claim (3).

### Variance

Continue to assume that the ‘s are isotropic (3) and now assume that are independent. By independence, the variance can be written as

Assuming that are identically distributed , we then get

The variance decreases like , which is characteristic of Monte Carlo-type algorithms. Since is unbiased (i.e, (3)), this means that the mean square error decays like so the average error (more precisely root-mean-square error) decays like

This type of convergence is very slow. If I want to decrease the error by a factor of , I must do the work!

Variance-reduced trace estimators like Hutch++ and our new trace estimator XTrace improve the rate of convergence substantially. Even in the worst case, Hutch++ and XTrace reduce the variance at a rate and (root-mean-square) error at rates :

For matrices with rapidly decreasing singular values, the variance and error can decrease much faster than this.

## Variance Formulas

As the rate of convergence for the Girard–Hutchinson estimator is so slow, it is imperative to pick a distribution on test vectors that makes the variance of the single–sample estimate as low as possible. In this section, we will provide several explicit formulas for the variance of the Girard–Hutchinson estimator. Derivations of these formulas will appear at the end of this post. These variance formulas help illuminate the benefits and drawbacks of different test vector distributions.

To express the formulas, we will need some notation. For a complex number we use and to denote the real and imaginary parts. The variance of a random complex number is

The Frobenius norm of a matrix is

If is real symmetric or complex Hermitian with (real) eigenvalues , we have

(5)

denotes the ordinary transpose of and denotes the conjugate transpose of .

### Real-Valued Test Vectors

We first focus on real-valued test vectors . Since is real, we can use the ordinary transpose rather than the conjugate transpose . Since is a number, it is equal to its own transpose:

Therefore,

The Girard–Hutchinson trace estimator applied to is the same as the Girard–Hutchinson estimator applied to the symmetric part of , .

For the following results, assume is symmetric, .

1. Real Gaussian: are independent standard normal random vectors.

2. Uniform signs (Rademachers): are independent random vectors with uniform coordinates.

3. Real sphere: Assume are uniformly distributed on the real sphere of radius : .

These formulas continue to hold for nonsymmetric by replacing by its symmetric part on the right-hand sides of these variance formulas.

### Complex-Valued Test Vectors

We now move our focus to complex-valued test vectors . As a rule of thumb, one should typically expect that the variance for complex-valued test vectors applied to a real symmetric matrix is about half the natural real counterpart—e.g., for complex Gaussians, you get about half the variance than with real Gaussians.

A square complex matrix has a Cartesian decomposition

where

denote the Hermitian and skew-Hermitian parts of . Similar to how the imaginary part of a complex number is real, the skew-Hermitian part of a complex matrix is Hermitian (and is skew-Hermitian). Since and are both Hermitian, we have

Consequently, the variance of can be broken into Hermitian and skew-Hermitian parts:

For this reason, we will state the variance formulas only for Hermitian , with the formula for general following from the Cartesian decomposition.

For the following results, assume is Hermitian, .

1. Complex Gaussian: are independent standard complex random vectors, i.e., each has iid entries distributed as for standard normal random variables.

2. Uniform phases (Steinhauses): are independent random vectors whose entries are uniform on the complex unit circle .

3. Complex sphere: Assume are uniformly distributed on the complex sphere of radius : .

## Optimality Properties

Let us finally address the question of what the best choice of test vectors is for the Girard–Hutchinson estimator. We will state two results with different restrictions on .

Our first result, due to Hutchinson, is valid for real symmetric matrices with real test vectors.

Optimality (independent test vectors with independent coordinates). If the test vectors are isotropic (2), independent from each other, and have independent entries, then for any fixed real symmetric matrix , the minimum variance for is obtained when are populated with random signs .

The next optimality results will have real and complex versions. To present the results for -valued and an -valued test vectors on unified footing, let denote either or . We let a -Hermitian matrix be either a real symmetric matrix (if ) or a complex Hermitian matrix (if ). Let a -unitary matrix be either a real orthogonal matrix (if ) or a complex unitary matrix (if ).

The condition that the vectors have independent entries is often too restrictive in practice. It rules out, for instance, the case of uniform vectors on the sphere. If we relax this condition, we get a different optimal distribution:

Optimality (independent test vectors). Consider any set of -Hermitian matrices which is invariant under -unitary similary transformations:

Assume that the test vectors are independent and isotropic (2). The worst-case variance is minimized by choosing uniformly on the -sphere: .

More simply, if you wants your stochastic trace estimator to be effective for a class of inputs (closed under -unitary similarity transformations) rather than a single input matrix , then the best distribution are test vectors drawn uniformly from the sphere. Examples of classes of matrices include:

• Fixed eigenvalues. For fixed real eigenvalues , the set of all -Hermitian matrices with these eigenvalues.
• Density matrices. The class of all trace-one psd matrices.
• Frobenius norm ball. The class of all -Hermitian matrices of Frobenius norm at most 1.

## Derivation of Formulas

In this section, we provide derivations of the variance formulas. I have chosen to focus on derivations which are shorter but use more advanced techniques rather than derivations which are longer but use fewer tricks.

### Real Gaussians

First assume is real. Since is real symmetric, has an eigenvalue decomposition , where is orthogonal and is a diagonal matrix reporting ‘s eigenvalues. Since the real Gaussian distribution is invariant under orthogonal transformations, has the same distribution as . Therefore,

Here, we used that the variance of a squared standard normal random variable is two.

For non-real matrix, we can break the matrix into its entrywise real and imaginary parts . Thus,

### Uniform Signs

First, compute

For a vector of uniform random signs, we have for every , so the second sum vanishes. Note that we have assumed symmetric, so the sum over can be replaced by two times the sum over :

Note that are pairwise independent. As a simple exercise, one can verify that the identity

holds for any pairwise independent family of random variances and numbers . Ergo,

In the second-to-last line, we use the fact that is a uniform random sign, which has variance . The final line is a consequence of the symmetry of .

### Uniform on the Real Sphere

The simplest proof is I know is by the “camel principle”. Here’s the story (a lightly edited quotation from MathOverflow):

A father left 17 camels to his three sons and, according to the will, the eldest son was to be given a half of the camels, the middle son one-third, and the youngest son the one-ninth. The sons did not know what to do since 17 is not evenly divisible into either two, three, or nine parts, but a wise man helped the sons: he added his own camel, the oldest son took camels, the second son took camels, the third son camels and the wise man took his own camel and went away.

We are interested in a vector which is uniform on the sphere of radius . Performing averages on the sphere is hard, so we add a camel to the problem by “upgrading” to a spherically symmetric vector which has a random length. We want to pick a distribution for which the computation is easy. Fortunately, we already know such a distribution, the Gaussian distribution, for which we already calculated .

The Gaussian vector and the uniform vector on the sphere are related by

where is the squared length of the Gaussian vector . In particular, has the distribution of the sum of squared Gaussian random variables, which is known as a random variable with degrees of freedom.

Now, we take the camel back. Compute the variance of using the chain rule for variance:

Here, and denote the conditional variance and conditional expectation with respect to the random variable . The quick and dirty ways of working with these are to treat the random variable “like a constant” with respect to the conditional variance and expectation.

Plugging in the formula and treating “like a constant”, we obtain

As we mentioned, is a random variable with degrees of freedom and and are known quantities that can be looked up:

We know and . Plugging these all in, we get

Rearranging, we obtain

### Complex Gaussians

The trick is the same as for real Gaussians. By invariance of complex Gaussian random vectors under unitary transformations, we can reduce to the case where is a diagonal matrix populated with eigenvalues . Then

Here, we use the fact that is a random variable with two degrees of freedom, which has variance four.

### Random Phases

The trick is the same as for uniform signs. A short calculation (remembering that is Hermitian and thus ) reveals that

The random variables are pairwise independent so we have

Since is uniformly distributed on the complex unit circle, we can assume without loss of generality that . Thus, letting be uniform on the complex unit circle,

The real and imaginary parts of have the same distribution so

so . Thus

### Uniform on the Complex Sphere: Derivation 1 by Reduction to Real Case

There are at least three simple ways of deriving this result: the camel trick, reduction to the real case, and Haar integration. Each of these techniques illustrates a trick that is useful in its own right beyond the context of trace estimation. Since we have already seen an example of the camel trick for the real sphere, I will present the other two derivations.

Let us begin with the reduction to the real case. Let and denote the real and imaginary parts of a vector or matrix, taken entrywise. The key insight is that if is a uniform random vector on the complex sphere of radius , then

We’ve converted the complex vector into a real vector .

Now, we need to convert the complex matrix into a real matrix . To do this, recall that one way of representing complex numbers is by matrices:

Using this correspondence addition and multiplication of complex numbers can be carried by addition and multiplication of the corresponding matrices.

To convert complex matrices to real matrices, we use a matrix-version of the same representation:

One can check that addition and multiplication of complex matrices can be carried out by addition and multiplication of the corresponding “realified” matrices, i.e.,

holds for all complex matrices and .

We’ve now converted complex matrix and vector into real matrix and vector . Let’s compare to . A short calculation reveals

Since is a uniform random vector on the sphere of radius , is a uniform random vector on the sphere of radius . Thus, by the variance formula for the real sphere, we get

A short calculation verifies that and . Plugging this in, we obtain

### Uniform on the Complex Sphere: Derivation 2 by Haar Integration

The proof by reduction to the real case requires some cumbersome calculations and requires that we have already computed the variance in the real case by some other means. The method of Haar integration is more slick, but it requires some pretty high-power machinery. Haar integration may be a little bit overkill for this problem, but this technique is worth learning as it can handle some truly nasty expected value computations that appear, for example, in quantum information.

We seek to compute

The first trick will be to write this expession using a single matrix trace using the tensor (Kronecker) product . For those unfamiliar with the tensor product, the main properties we will be using are

(6)

We saw in the proof of unbiasedness that

Therefore, by (6),

Thus, to evaluate , it will be sufficient to evaluate . Forunately, there is a useful formula for these expectation provided by a field of mathematics known as representation theory (see Lemma 1 in this paper):

Here, is the orthogonal projection onto the space of symmetric two-tensors . Therefore, we have that

To evalute the trace on the right-hand side of this equation, there is another formula (see Lemma 6 in this paper):

Therefore, we conclude

## Proof of Optimality Properties

In this section, we provide proofs of the two optimality properties.

### Optimality: Independent Vectors with Independent Coordinates

Assume is real and symmetric and suppose that is isotropic (2) with independent coordinates. The isotropy condition

implies that , where is the Kronecker symbol. Using this fact, we compute the second moment:

Thus

The variance is minimized by choosing with as small as possible. Since , the smallest possible value for is , which is obtained by populating with random signs.

### Optimality: Independent Vectors

This result appears to have first been proven by Richard Kueng in unpublished work. We use an argument suggested to me by Robert J. Webber.

Assume is a class of -Hermitian matrices closed under -unitary similarity transformations and that is an isotropic random vector (2). Decompose the test vector as

First, we shall show that the variance is reduced by replacing with a vector drawn uniformly from the sphere

(7)

where

(8)

Note that such a can be generated as for a uniformly random -unitary matrix . Therefore, we have

Now apply Jensen’s inequality only over the randomness in to obtain

Finally, note that since is closed under -unitary similarity transformations, the supremum over for is the same as the supremum of , so we obtain

We have successfully proven (7). This argument is a specialized version of a far more general result which appears as Proposition 4.1 in this paper.

Next, we shall prove

(9)

where is still defined as in (8). Indeed, using the chain rule for variance, we obtain

Here, we have used that is uniform on the sphere and thus . By definition, is the length of divided by . Therefore,

Therefore, by Jensen’s inequality,

Thus

which proves (9).

# 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

# Note to Self: Hanson–Wright Inequality

This post is part of a new series for this blog, Note to Self, where I collect together some notes about an idea related to my research. This content may be much more technical than most of the content of this blog and of much less wide interest. My hope in sharing this is that someone will find this interesting and useful for their own work.

This post is about a fundamental tool of high-dimensional probability, the Hanson–Wright inequality. The Hanson–Wright inequality is a concentration inequality for quadratic forms of random vectors—that is, expressions of the form where is a random vector. Many statements of this inequality in the literature have an unspecified constant ; our goal in this post will be to derive a fairly general version of the inequality with only explicit constants.

The core object of the Hanson–Wright inequality is a subgaussian random variable. A random variable is subgaussian if the probability it exceeds a threshold in magnitude decays as

(1)

The name subgaussian is appropriate as the tail probabilities of Gaussian random variables exhibit the same square-exponential decrease .

A (non-obvious) fact is that if is subgaussian in the sense (1) and centered (), then ‘s cumulant generating function (cgf)

is subquadratic: There is a constant (independent of and ), for which

(2)

Moreover,1See Proposition 2.5.2 of Vershynin’s High-Dimensional Probability. a subquadratic cgf (2) also implies the subgaussian tail property (1), with a different parameter .

Since properties (1) and (2) are equivalent (up to a change in the parameter ), we are free to fix a version of property (2) as our definition for a (centered) subgaussian random variable.

Definition (subgaussian random variable): A centered random variable is said to be -subgaussian or subgaussian with variance proxy if its cgf is subquadratic:

(3)

For instance, a mean-zero Gaussian random variable with variance has cgf

(4)

and is thus subgaussian with variance proxy equal to its variance.

Here is a statement of the Hanson–Wright inequality as it typically appears with unspecified constants (see Theorem 6.2.1 of Vershynin’s High-Dimensional Probability):

Theorem (Hanson–Wright): Let be a random vector with independent centered -subgaussian entries and let be a square matrix. Then

where is a constant (not depending on , , , or ).2Here, and denote the Frobenius and spectral norms.

This type of concentration is exactly the same type as provided by Bernstein’s inequality (which I discussed in my post on concentration inequalities). In particular, for small deviations , the tail probabilities decay are subgaussian with variance proxy :

For large deviations , this switches to subexponential tail probabilities with decay rate :

Mediating these two parameter regimes are the size of the matrix , as measured by its Frobenius and spectral norms, and the degree of subgaussianity of , measured by the variance proxy .

## Diagonal-Free Hanson–Wright

Now we come to a first version of the Hanson–Wright inequality with explicit constants, first for a matrix which is diagonal-free—that is, having all zeros on the diagonal. I obtained this version of the inequality myself, though I am very sure that this version of the inequality or an improvement thereof appears somewhere in the literature.

Theorem (Hanson–Wright, explicit constants, diagonal-free): Let random vector with independent centered -subguassian entries and let be a diagonal-free square matrix. Then we have the cgf bound

As a consequence, we have the concentration bound

Let us begin proving this result. Our proof will follow the same steps as Vershynin’s proof in High-Dimensional Probability (which in turn is adapted from an article by Rudelson and Vershynin), but taking care to get explicit constants. Unfortunately, proving all of the relevant tools from first principles would easily triple the length of this post, so I make frequent use of results from the literature.

We begin by the decoupling bound (Theorem 6.1.1 in Vershynin’s High-Dimensional Probability), which allows us to replace one with an independent copy at the cost of a factor of four:

(5)

We seek to compare the bilinear form to the Gaussian bilinear form where and are independent standard Gaussian vectors. We begin with the following cgf bound for the Gaussian quadratic form :

This equation is the result of Example 2.12 in Boucheron, Lugosi, and Massart’s Concentration Inequalities. By applying this result to the Hermitian dilation of in ‘s place, one obtains a similar result for the decoupled bilinear form :

(6)

We now seek to compare to . To do this, we first evaluate the cgf of only over the randomness in . Since we’re only taking an expectation over the random variable , we can apply the subquadratic tail condition (3) to obtain

(7)

Now we perform a similar computation for the quantity in which has been replaced by the Gaussian vector :

We stress that this is an equality since the cgf of a Gaussian random variable is given by (4). Thus we can substitute the left-hand side of the above display into the right-hand side of (7), yielding

(8)

We now perform this same trick again using the randomness in :

(9)

Packaging up (8) and (9) gives

(10)

Combining all these results (5), (6), and (10), we obtain

This cgf implies the desired probability bound as a consequence of the following fact (see Boucheron, Lugosi, and Massart’s Concentration Inequalities page 29 and Exercise 2.8):

Fact (Bernstein concentration from Bernstein cgf bound): Suppose that a random variable satisfies the cgf bound for . Then

## General Hanson–Wright

Now, here’s a more general result (with worse constants) which permits the matrix to possess a diagonal.

Theorem (Hanson–Wright, explicit constants): Let random vector with independent centered -subguassian entries and let be an arbitrary square matrix. Then we have the cgf bound

As a consequence, we have the concentration bound

Decompose the matrix into its diagonal and off-diagonal portions. For any two random variables and (possibly highly dependent), we can bound the cgf of their sum using the following “union bound”:

(11)

The two equality statements are the definition of the cumulant generating function and the inequality is Cauchy–Schwarz.

Using the “union bound”, it is sufficient to obtain bounds for the cgfs of the diagonal and off-diagonal parts and . We begin with the diagonal part. We compute

(12)

For the cgf of , we use the following bound, taken from Appendix B of the following paper:

Substituting this result into (12) gives

(13)

For the second inequality, we used the facts that and .

We now look at the off-diagonal part . We use a version of the decoupling bound (5) where we compare to , where we’ve both replaced one copy of with an independent copy and reinstated the diagonal of (see Remark 6.1.3 in Vershynin’s High-Dimensional Probability):

We can now just repeat the rest of the argument for the diagonal-free Hanson–Wright inequality, yielding the same conclusion

(14)

Combining (11), (13), and (14), we obtain

As with above, this cgf bound implies the desired probability bound.

# Chebyshev Polynomials

This post is co-written by my brother, Aidan Epperly, for the second Summer of Math Exposition (SoME2).

Let’s start with a classical problem: connect-the-dots. As we know from geometry, any two points in the plane are connected by one and only one straight line:

But what if we have more than two points? How should we connect them? One natural way is by parabola. Any three points (with distinct coordinates) are connected by one and only one parabola :

And we can keep extending this. Any points1The degree of the polynomial is one less than the number of points because a degree- polynomial is described by coefficients. For instance, a degree-two parabola has three coefficients , , and . (with distinct coordinates) are connected by a unique degree- polynomial :

This game of connect-the-dots with polynomials is known more formally as polynomial interpolation. We can use polynomial interpolation to approximate functions. For instance, we can approximate the function on the interval to visually near-perfect accuracy by connecting the dots between seven points :

But something very peculiar happens when we try and apply this trick to the specially chosen function on the interval :

Unlike , the polynomial interpolant for is terrible! What’s going on? Why doesn’t polynomial interpolation work here? Can we fix it? The answer to the last question is yes and the solution is Chebyshev polynomials.

## Reverse-Engineering Chebyshev

The failure of polynomial interpolation for is known as Runge’s phenomenon after Carl Runge who discovered this curious behavior in 1901. The function is called the Runge function. Our goal is to find a fix for polynomial interpolation which crushes the Runge phenomenon, allowing us to reliably approximate every sensible2A famous theorem of Faber states that there does not exist any set of points through which the polynomial interpolants converge for every continuous function. This is not as much of a problem as it may seem. As the famous Weierstrass function shows, arbitrary continuous functions can be very weird. If we restrict ourselves to nicer functions, such as Lipschitz continuous functions, there does exist a set of points through which the polynomial interpolant always converges to the underlying function. Thus, in this senses, it is possible to crush the Runge phenomenon. function with polynomial interpolation.

Carl Runge

Let’s put on our thinking caps and see if we can discover the fix for ourselves. In order to discover a fix, we must first identify the problem. Observe that the polynomial interpolant is fine near the center of the interval; it only fails near the boundary.

This leads us to a guess for what the problem might be; maybe we need more interpolation points near the boundaries of the interval. Indeed, tipping our hand a little bit, this turns out to be the case. For instance, connecting the dots for the following set of “mystery points” clustered at the endpoints works just fine:

Let’s experiment a little and see if we can discover a nice set of interpolation points, which we will call , like this for ourselves. We’ll assume the interpolation points are given by a function so we can form the polynomial interpolant for any desired polynomial degree .3Technically, we should insist on the function being \textit{injective} so that the points are guaranteed to be distinct. For instance, if we pick , the points look like this:

Equally spaced points (shown on vertical axis) give rise to
non-equally spaced points (shown on horizontal axis)

How should we pick the function ? First observe that, even for the Runge function, equally spaced interpolation points are fine near the center of the interval. We thus have at least two conditions for our desired interpolation points:

1. The interior points should maintain their spacing of roughly .
2. The points must cluster near both boundaries.

As a first attempt let’s divide the interval into thirds and halve the spacing of points except in the middle third. This leads to the function

These interpolation points initially seem promising, even successfully approximating the Runge function itself.

Unfortunately, this set of points fails when we consider other functions. For instance, if we use the Runge-like function , we see that these interpolation points now lead to a failure to approximate the function at the middle of the interval, even if we use a lot of interpolation points!

Maybe the reason this set of interpolation points didn’t work is that the points are too close at the endpoints. Or maybe we should have divided the interval as quarter–half–quarter rather than thirds. There are lots of variations of this strategy for choosing points to explore and all of them eventually lead to failure on some Runge-flavored example. We need a fundamentally different strategy then making the points times closer within distance of the endpoints.

Let’s try a different approach. The closeness of the points at the endpoints is determined by the slope of the function at and . The smaller that and are, the more clustered the points will be. For instance,

So if we want the points to be much more clustered together, it is natural to require

It also makes sense for the function to cluster points equally near both endpoints, since we see no reason to preference one end over the other. Collecting together all the properties we want the function to have, we get the following list:

1. spans the whole range ,
2. , and
3. is symmetric about , .

Mentally scrolling through our Rolodex of friendly functions, a natural one that might come to mind meeting these three criteria is the cosine function, specifically . This function yields points which are more clustered at the endpoints:

The points

we guessed our way into are known as the Chebyshev points.4Some authors refer to these as the “Chebyshev points of the second kind” or use other names. We follow the convention in Approximation Theory and Approximation Practice (Chapter 1) and simply refer to these points simply as the Chebyshev points. The Chebyshev points prove themselves perfectly fine for the Runge function:

As we saw earlier, success on the Runge function alone is not enough to declare victory for the polynomial interpolation problem. However, in this case, there are no other bad examples left to find. For any nice function with no jumps, polynomial interpolation through the Chebyshev points works excellently.5Specifically, for a function which not too rough (i.e., Lipschitz continuous), the degree- polynomial interpolant of through the Chevyshev points converges uniformly to as .

## Why the Chebyshev Points?

We’ve guessed our way into a solution to the polynomial interpolation problem, but we still really don’t know what’s going on here. Why are the Chebyshev points much better at polynomial interpolation than equally spaced ones?

Now that we know that the Chebyshev points are a right answer to the interpolation problem,6Indeed, there are other sets of interpolation points through which polynomial interpolation also works well, such as the Legendre points. let’s try and reverse engineer a principled reason for why we would expect them to be effective for this problem. To do this, we ask:

What is special about the cosine function?

From high school trigonometry, we know that gives the coordinate of a point radians along the unit circle. This means that the Chebyshev points are the coordinates of equally spaced points on the unit circle (specifically the top half of the unit circle ).

Chebyshev points are the coordinates of equally spaced points on the unit circle.

This raises the question:

What does the interpolating polynomial look like as a function of the angle ?

To convert between and we simply plug in to :

This new function depending on , which we can call , is a polynomial in the variable . Powers of cosines are not something we encounter every day, so it makes sense to try and simplify things using some trig identities. Here are the first couple powers of cosines:

A pattern has appeared! The powers always take the form7As a fun exercise, you might want to try and prove this using mathematical induction.

The significance of this finding is that, by plugging in each of these formulas for , we see that our polynomial in the variable has morphed into a Fourier cosine series in the variable :

For anyone unfamiliar with Fourier series, we highly encourage the 3Blue1Brown video on the subject, which explains why Fourier series are both mathematically beautiful and practically useful. The basic idea is that almost any function can be expressed as a combination of waves (that is, sines and cosines) with different frequencies.8More precisely, we might call these angular frequencies. In our case, this formula tells us that is equal to units of frequency , plus units of frequency , all the way up to units of frequency . Different types of Fourier series are appropriate in different contexts. Since our Fourier series only possesses cosines, we call it a Fourier cosine series.

We’ve discovered something incredibly cool:

Polynomial interpolation through the Chebyshev points is equivalent to finding a Fourier cosine series for equally spaced angles .

We’ve arrived at an answer to why the Chebyshev points work well for polynomial interpolation.

Polynomial interpolation through the Chebyshev points is effective because Fourier cosine series through equally spaced angles is effective.

Of course, this explanation just raises the further question: Why do Fourier cosine series give effective interpolants through equally spaced angles ? This question has a natural answer as well, involving the convergence theory and aliasing formula (see Section 3 of this paper) for Fourier series. We’ll leave the details to the interested reader for investigation. The success of Fourier cosines series in interpolating equally spaced data is a fundamental observation that underlies the field of digital signal processing. Interpolation through the Chebyshev points effectively hijacks this useful fact and applies it to the seemingly unrelated problem of polynomial interpolation.

Another question this explanation raises is the precise meaning of “effective”. Just how good are polynomial interpolants through the Chebyshev points at approximating functions? As is discussed at length in another post on this blog, the degree to which a function can be effectively approximated is tied to how smooth or rough it is. Chebyshev interpolants approximate nice analytic functions like or with exponentially small errors in the number of interpolation points used. By contrast, functions with kinks like are approximated with errors which decay much more slowly. See theorems 2 and 3 on this webpage for more details.

## Chebyshev Polynomials

We’ve now discovered a set of points, the Chebyshev points, through which polynomial interpolation works well. But how should we actually compute the interpolating polynomial

Again, it will be helpful to draw on the connection to Fourier series. Computations with Fourier series are highly accurate and can be made lightning fast using the fast Fourier transform algorithm. By comparison, directly computing with a polynomial through its coefficients is a computational nightmare.

In the variable , the interpolant takes the form

To convert back to , we use the inverse function9One always has to be careful when going from to since multiple values get mapped to a single value by the cosine function. Fortunately, we’re working with variables and , between which the cosine function is one-to-one with the inverse function being given by the arccosine. to obtain:

This is a striking formula. Given all of the trigonometric functions, it’s not even obvious that is a polynomial (it is)!

Despite its seeming peculiarity, this is a very powerful way of representing the polynomial . Rather than expressing using monomials , we’ve instead written as a combination of more exotic polynomials

The polynomials are known as the Chebyshev polynomials,10More precisely, the polynomials are known as the Chebyshev polynomials of the first kind. named after Pafnuty Chebyshev who studied the polynomials intensely.11The letter “T” is used for Chebyshev polynomials since the Russian name “Chebyshev” is often alternately transliterated to English as “Tchebychev”.

Pafnuty Chebyshev

Writing out the first few Chebyshev polynomials shows they are indeed polynomials:

The first four Chebyshev polynomials

To confirm that this pattern does continue, we can use trig identities to derive12Specifically, the recurrence is a consequence of applying the sum-to-product identity to for . the following recurrence relation for the Chebyshev polynomials:

Since and are both polynomials, every Chebyshev polynomial is as well.

We’ve arrived at the following amazing conclusion:

Under the change of variables , the Fourier cosine series

becomes the combination of Chebyshev polynomials

This simple and powerful observations allows us to apply the incredible speed and accuracy of Fourier series to polynomial interpolation.

Beyond being a neat idea with some nice mathematics, this connection between Fourier series and Chebyshev polynomials is a powerful tool for solving computational problems. Once we’ve accurately approximated a function by a polynomial interpolant, many quantities of interest (derivatives, integrals, zeros) become easy to compute—after all, we just have to compute them for a polynomial! We can also use Chebyshev polynomials to solve differential equations with much faster rates of convergence than other methods. Because of the connection to Fourier series, all of these computations can be done to high accuracy and blazingly fast via the fast Fourier transform, as is done in the software package Chebfun.

The Chebyshev polynomials have an array of amazing properties and they appear all over mathematics and its applications in other fields. Indeed, we have only scratched the surface of the surface. Many questions remain:

• What is the connection between the Chebyshev points and the Chebyshev polynomials?
• The cosine functions are orthogonal to each other; are the Chebyshev polynomials?
• Are the Chebyshev points the best points for polynomial interpolation? What does “best” even mean in this context?
• Every “nice” even periodic function has an infinite Fourier cosine series which converges to it. Is there a Chebyshev analog? Is there a relation between the infinite Chebyshev series and the (finite) interpolating polynomial through the Chebyshev points?

All of these questions have beautiful and fairly simple answers. The book Approximation Theory and Approximation Practice is a wonderfully written book that answers all of these questions in its first six chapters, which are freely available on the author’s website. We recommend the book highly to the curious reader.

TL;DR: To get an accurate polynomial approximation, interpolate through the Chebyshev points.
To compute the resulting polynomial, change variables to , compute the Fourier cosine series interpolant, and obtain your polynomial interpolant as a combination of Chebyshev polynomials.

# Big Ideas in Applied Math: Concentration Inequalities

This post is about randomized algorithms for problems in computational science and a powerful set of tools, known as concentration inequalities, which can be used to analyze why they work. I’ve discussed why randomization can help in solving computational problems in a previous post; this post continues this discussion by presenting an example of a computational problem where, somewhat surprisingly, a randomized algorithm proves effective. We shall then use concentration inequalities to analyze why this method works.

## Triangle Counting

Let’s begin our discussion of concentration inequalities by means of an extended example. Consider the following question: How many triangles are there in the Facebook network? That is, how many trios of people are there who are all mutual friends? While seemingly silly at first sight, this is actually a natural and meaningful question about the structure of the Facebook social network and is related to similar questions such as “How likely are two friends of a person to also be friends with each other?”

If there are people on the Facebook graph, then the natural algorithm of iterating over all triplets and checking whether they form a triangle is far too computationally costly for the billions of Facebook accounts. Somehow, we want to do much faster than this, and to achieve this speed we would be willing to settle for an estimate of the triangle count up to some error.

There are many approaches to this problem, but let’s describe a particularly surprising algorithm. Let be an matrix where the th entry of is if users and are friends and otherwise1All of the diagonal entries of are set to zero.; this matrix is called the adjacency matrix of the Facebook graph. A fact from graph theory is that the th entry of the cube of the matrix counts the number of paths from user to user of length three.2By a path of length three, we mean a sequence of users where and , and , and and are all friends. In particular, the th entry of denotes the number of paths from to itself of length , which is twice the number of triangles incident on . (The paths and are both counted as paths of length 3 for a triangle consisting of , , and .) Therefore, the trace of , equal to the sum of its diagonal entries, is six times the number of triangles: The th entry of is twice the number of triangles incident on and each triangle is counted thrice in the th, th, and th entries of . In summary, we have

Therefore, the triangle counting problem is equivalent to computing the trace of . Unfortunately, the problem of computing is, in general, very computationally costly. Therefore, we seek ways of estimating the trace of a matrix without forming it.

## Randomized Trace Estimation

Motivated by the triangle counting problem from the previous section, we consider the problem of estimating the trace of a matrix . We assume that we only have access to the matrix through matrix–vector products; that is, we can efficiently compute for a vector . For instance, in the previous example, the Facebook graph has many fewer friend relations (edges) than the maximum possible amount of . Therefore, the matrix is sparse; in particular, matrix–vector multiplications with can be computed in around operations. To compute matrix–vector products with , we simply compute matrix–vector products with three times, .

Here’s a very nifty idea to estimate the trace of using only matrix–vector products, originally due to Didier A. Girard and Michael F. Hutchinson. Choose to be a random vector whose entries are independent -values, where each value and occurs with equal probability. Then if one forms the expression . Since the entries of and are independent, the expectation of is for and for . Consequently, by linearity of expectation, the expected value of is

The average value of is equal to the trace of ! In the language of statistics, we might say that is an unbiased estimator for . Thus, the efficiently computable quantity can serve as a (crude) estimate for .

While the expectation of equals , any random realization of can deviate from by a non-neligible amount. Thus, to reduce the variability of the estimator , it is appropriate to take an average of multiple copies of this random estimate. Specifically, we draw random vectors with independent random entries and compute the averaged trace estimator

(1)

The -sample trace estimator remains an unbiased estimator for , , but with reduced variability. Quantitatively, the variance of is times smaller than the single-sample estimator :

(2)

The Girard–Hutchinson trace estimator gives a natural way of estimating the trace of the matrix , a task which might otherwise be hard without randomness.3To illustrate what randomness is buying us here, it might be instructive to think about how one might try to estimate the trace of via matrix–vector products without the help of randomness. For the trace estimator to be a useful tool, an important question remains: How many samples are needed to compute to a given accuracy? Concentration inequalities answer questions of this nature.

## Concentration Inequalities

A concentration inequality provides a bound on the probability a random quantity is significantly larger or smaller than its typical value. Concentration inequalities are useful because they allow us to prove statements like “With at least 99% probability, the randomized trace estimator with 100 samples produces an approximation of the trace which is accurate up to error no larger than .” In other words, concentration inequalities can provide quantitative estimates of the likely size of the error when a randomized algorithm is executed.

In this section, we shall introduce a handful of useful concentration inequalities, which we will apply to the randomized trace estimator in the next section. We’ll then discuss how these and other concentration inequalities can be derived in the following section.

### Markov’s Inequality

Markov’s inequality is the most fundamental concentration inequality. When used directly, it is a blunt instrument, requiring little insight to use and producing a crude but sometimes useful estimate. However, as we shall see later, all of the sophisticated concentration inequalities that will follow in this post can be derived from a careful use of Markov’s inequality.

The wide utility of Markov’s inequality is a consequence of the minimal assumptions needed for its use. Let be any nonnegative random variable. Markov’s inequality states that the probability that exceeds a level is bounded by the expected value of over . In equations, we have

(3)

We stress the fact that we make no assumptions on how the random quantity is generated other than that is nonnegative.

As a short example of Markov’s inequality, suppose we have a randomized algorithm which takes one second on average to run. Markov’s inequality then shows that the probability the algorithm takes more than 100 seconds to run is at most . This small example shows both the power and the limitation of Markov’s inequality. On the negative side, our analysis suggests that we might have to wait as much as 100 times the average runtime for the algorithm to complete running with 99% probability; this large huge multiple of 100 seems quite pessimistic. On the other hand, we needed no information whatsoever about how the algorithm works to do this analysis. In general, Markov’s inequality cannot be improved without more assumptions on the random variable .4For instance, imagine an algorithm which 99% of the time completes instantly and 1% of the time takes 100 seconds. This algorithm does have an average runtime of 1 second, but the conclusion of Markov’s inequality that the runtime of the algorithm can be as much as 100 times the average runtime with 1% probability is true.

### Chebyshev’s Inequality and Averages

The variance of a random variable describes the expected size of a random variable’s deviation from its expected value. As such, we would expect that the variance should provide a bound on the probability a random variable is far from its expectation. This intuition indeed is correct and is manifested by Chebyshev’s inequality. Let be a random variable (with finite expected value) and . Chebyshev’s inequality states that the probability that deviates from its expected value by more than is at most :

(4)

Chebyshev’s inequality is frequently applied to sums or averages of independent random quantities. Suppose are independent and identically distributed random variables with mean and variance and let denote the average

Since the random variables are independent,5In fact, this calculation works if are only pairwise independent or even pairwise uncorrelated. For algorithmic applications, this means that don’t have to be fully independent of each other; we just need any pair of them to be uncorrelated. This allows many randomized algorithms to be “derandomized“, reducing the amount of “true” randomness needed to execute an algorithm. the properties of variance entail that

where we use the fact that . Therefore, by Chebyshev’s inequality,

(5)

Suppose we want to estimate the mean by up to error and are willing to tolerate a failure probability of . Then setting the right-hand side of (5) to , Chebyshev’s inequality suggests that we need at most

(6)

samples to achieve this goal.

### Exponential Concentration: Hoeffding and Bernstein

How happy should we be with the result (6) of applying Chebyshev’s inequality the average ? The central limit theorem suggests that should be approximately normally distributed with mean and variance . Normal random variables have an exponentially small probability of being more than a few standard deviations above their mean, so it is natural to expect this should be true of as well. Specifically, we expect a bound roughly like

(7)

Unfortunately, we don’t have a general result quite this nice without additional assumptions, but there are a diverse array of exponential concentration inequalities available which are quite useful in analyzing sums (or averages) of independent random variables that appear in applications.

Hoeffding’s inequality is one such bound. Let be independent (but not necessarily identically distributed) random variables and consider the average . Hoeffding’s inequality makes the assumption that the summands are bounded, say within an interval .6There are also more general versions of Hoeffding’s inequality where the bound on each random variable is different. Hoeffding’s inequality then states that

(8)

Hoeffding’s inequality is quite similar to the ideal concentration result (7) except with the variance replaced by the potentially much larger quantity7Note that is always smaller than or equal to . .

Bernstein’s inequality fixes this deficit in Hoeffding’s inequality at a small cost. Now, instead of assuming are bounded within the interval , we make the alternate boundedness assumption for every . We continue to denote so that if are identically distributed, denotes the variance of each of . Bernstein’s inequality states that

(9)

For small values of , Bernstein’s inequality yields exactly the kind of concentration that we would hope for from our central limit theorem heuristic (7). However, for large values of , we have

which is exponentially small in rather than . We conclude that Bernstein’s inequality provides sharper bounds then Hoeffding’s inequality for smaller values of but weaker bounds for larger values of .

### Chebyshev vs. Hoeffding vs. Bernstein

Let’s return to the situation where we seek to estimate the mean of independent and identically distributed random variables each with variance by using the averaged value . Our goal is to bound how many samples we need to estimate up to error , , except with failure probability at most . Using Chebyshev’s inequality, we showed that (see (7))

Now, let’s try using Hoeffding’s inequality. Suppose that are bounded in the interval . Then Hoeffding’s inequality (8) shows that

Bernstein’s inequality states that if lie in the interval for every , then

(10)

Hoeffding’s and Bernstein’s inequality show that we need roughly proportional to samples are needed rather than proportional to . The fact that we need proportional to samples to achieve error is a consequence of the central limit theorem and is something we would not be able to improve with any concentration inequality. What exponential concentration inequalities allow us to do is to improve the dependence on the failure probability from proportional to to , which is a huge improvement.

Hoeffding’s and Bernstein’s inequalities both have a small drawback. For Hoeffding’s inequality, the constant of proportionality is rather than the true variance of the summands. Bernstein’s inequality gives us the “correct” constant of proportionality but adds a second term proportional to ; for small values of , this term is dominated by the term proportional to but the second term can be relevant for larger values of .

There are a panoply of additional concentration inequalities than the few we’ve mentioned. We give a selected overview in the following optional section.

Other Concentration Inequalities
There are a handful more exponential concentration inequalities for sums of independent random variables such as Chernoff’s inequality (very useful for somes of bounded, positive random variables) and Bennett’s inequality. There are also generalizations of Hoeffding’s, Chernoff’s, and Bernstein’s inequalities for unbounded random variables with subgaussian and subexponential tail decay; these results are documented in Chapter 2 of Roman Vershynin’s excellent book High-Dimensional Probability.

One can also generalize concentration inequalities to so-called martingale sequences, which can be very useful for analyzing adaptive algorithms. These inequalities can often have the advantage of bounding the probability that a martingale sequence ever deviates by some amount from its applications; these results are called maximal inequalities. Maximal analogs of Markov’s and Chebyshev’s inequalities are given by Ville’s inequality and Doob’s inequality. Exponential concentration inequalities include the Hoeffding–Azuma inequality and Freedman’s inequality.

Finally, we note that there are many concentration inequalities for functions of independent random variables other than sums, usually under the assumption that the function is Lipschitz continuous. There are exponential concentration inequalities for functions with “bounded differences”, functions of Gaussian random variables, and convex functions of bounded random variables. References for these results include Chapters 3 and 4 of the lecture notes Probability in High Dimension by Ramon van Handel and the comprehensive monograph Concentration Inequalities by Stéphane Boucheron, Gábor Lugosi, and Pascal Massart.

## Analysis of Randomized Trace Estimator

Let us apply some of the concentration inequalities we introduced in last section to analyze the randomized trace estimator. Our goal is not to provide the best possible analysis of the trace estimator,8More precise estimation for trace estimation applied to positive semidefinite matrices was developed by Gratton and Titley-Peloquin; see Theorem 4.5 of the following survey. but to demonstrate how the general concentration inequalities we’ve developed can be useful “out of the box” in analyzing algorithms.

In order to apply Chebyshev’s and Berstein’s inequalities, we shall need to compute or bound the variance of the single-sample trace estimtor , where is a random vector of independent -values. This is a straightforward task using properties of the variance:

Here, is the covariance and is the matrix Frobenius norm. Chebyshev’s inequality (5), then gives

Let’s now try applying an exponential concentration inequality. We shall use Bernstein’s inequality, for which we need to bound . By the Courant–Fischer minimax principle, we know that is between and where and are the smallest and largest eigenvalues of and is the Euclidean norm of the vector . Since all the entries of have absolute value , we have so is between and . Since the trace equals the sum of the eigenvalues of , is also between and . Therefore,

where denotes the matrix spectral norm. Therefore, by Bernstein’s inequality (9), we have

In particular, (10) shows that

samples suffice to estimate to error with failure probability at most . Concentration inequalities easily furnish estimates for the number of samples needed for the randomized trace estimator.

We have now accomplished our main goal of using concentration inequalities to analyze the randomized trace estimator, which in turn can be used to solve the triangle counting problem. We leave some additional comments on trace estimation and triangle counting in the following bonus section.

More on Trace Estimation and Triangle Counting
To really complete the analysis of the trace estimator in an application (e.g., triangle counting), we would need to obtain bounds on and . Since we often don’t know good bounds for and , one should really use the trace estimator together with an a posteriori error estimates for the trace estimator, which provide a confidence interval for the trace rather than a point estimate; see sections 4.5 and 4.6 in this survey for details.

One can improve on the Girard–Hutchinson trace estimator by using a variance reduction technique. One such variance reduction technique was recently proposed under the name Hutch++, extending ideas by Arjun Singh Gambhir, Andreas Stathopoulos, and Kostas Orginos and Lin Lin. In effect, these techniques improve the number of samples needed to estimate the trace of a positive semidefinite matrix to relative error to proportional to down from .

Several algorithms have been proposed for triangle counting, many of them randomized. This survey gives a comparison of different methods for the triangle counting problem, and also describes more motivation and applications for the problem.

## Deriving Concentration Inequalities

Having introduced concentration inequalities and applied them to the randomized trace estimator, we now turn to the question of how to derive concentration inequalities. Learning how to derive concentration inequalities is more than a matter of mathematical completeness since one can often obtain better results by “hand-crafting” a concentration inequality for a particular application rather than applying a known concentration inequality. (Though standard concentration inequalities like Hoeffding’s and Bernstein’s often give perfectly adequate answers with much less work.)

### Markov’s Inequality

At the most fundamental level, concentration inequalities require us to bound a probability by an expectation. In achieving this goal, we shall make a simple observation: The probability that is larger than or equal to is the expectation of a random variable .9More generally, the probability of an event can be written as an expectation of the indicator random variable of that event. Here, is an indicator function which outputs one if its input is larger than or equal to and zero otherwise.

As promised, the probability is larger than is the expectation of :

(11)

We can now obtain bounds on the probability that by bounding its corresponding indicator function. In particular, we have the inequality

(12)

Since is nonnegative, combining equations (11) and (12) gives Markov’s inequality:

### Chebyshev’s Inequality

Before we get to Chebyshev’s inequality proper, let’s think about how we can push Markov’s inequality further. Suppose we find a bound on the indicator function of the form

(13)

A bound of this form immediately to bounds on by (11). To obtain sharp and useful bounds on we seek bounding functions in (13) with three properties:

1. For , should be close to zero,
2. For , should be close to one, and
3. We need to be easily computable or boundable.

These three objectives are in tension with each other. To meet criterion 3, we must restrict our attention to pedestrian functions such as powers or exponentials for which we have hopes of computing or bounding for random variables we encounter in practical applications. But these candidate functions have the undesirable property that making the function smaller on (by increasing ) to meet point 1 makes the function larger on , detracting from our ability to achieve point 2. We shall eventually come up with a best-possible resolution to this dilemma by formulating this as an optimization problem to determine the best choice of the parameter to obtain the best possible candidate function of the given form.

Before we get ahead of ourselves, let us use a specific choice for different than we used to prove Markov’s inequality. We readily verify that satisfies the bound (13), and thus by (12),

(14)

This inequality holds for any nonnegative random variable . In particular, now consider a random variable which we do not assume to be nonnegative. Then ‘s deviation from its expectation, , is a nonnegative random variable. Thus applying (14) gives

We have derived Chebyshev’s inequality! Alternatively, one can derive Chebyshev’s inequality by noting that if, and only if, . Therefore, by Markov’s inequality,

### The Laplace Transform Method

We shall now realize the plan outlined earlier where we shall choose an optimal bounding function from the family of exponential functions , where is a parameter which we shall optimize over. This method shall allow us to derive exponential concentration inequalities like Hoeffding’s and Bernstein’s. Note that the exponential function bounds the indicator function for all real numbers , so we shall no longer require the random variable to be nonnegative. Therefore, by (11),

(15)

The functions

are known as the moment generating function and cumulant generating function of the random variable .10These functions are so-named because they are the (exponential) generating functions of the (polynomial) moments , , and the cumulants of . With these notations, (15) can be written

(16)

The moment generating function coincides with the Laplace transform up to the sign of the parameter , so one name for this approach to deriving concentration inequalities is the Laplace transform method. (This method is also known as the Cramér–Chernoff method.)

The cumulant generating function has an important property for deriving concentration inequalities for sums or averages of independent random variables: If are independent random variables, than the cumulant generating function is additive:11For proof, we compute . Taking logarithms proves the additivity.

(17)

### Proving Hoeffding’s Inequality

For us to use the Laplace transform method, we need to either compute or bound the cumulant generating function. Since we are interested in general concentration inequalities which hold under minimal assumptions such as boundedness, we opt for the latter. Suppose and consider the cumulant generating function of . Then one can show the cumulant generating function bound12The bound (18) is somewhat tricky to establish, but we can establish the same result with a larger constant than . We have . Since the function is convex, we have the bound . Taking expectations, we have . One can show by comparing Taylor series that . Therefore, we have .

(18)

Using the additivity of the cumulant generating function (17), we obtain the bound

Plugging this into the probability bound (16), we obtain the concentration bound

(19)

We want to obtain the smallest possible upper bound on this probability, so it behooves us to pick the value of which makes the right-hand side of this inequality as small as possible. To do this, we differentiate the contents of the exponential and set to zero, obtaining

Plugging this value for into the bound (19) gives A bound for being larger than :

(20)

To get the bound on being smaller than , we can apply a small trick. If we apply (20) to the summands instead of , we obtain the bounds

(21)

We can now combine the upper tail bound (19) with the lower tail bound (21) to obtain a “symmetric” bound on the probability that . The means of doing often this goes by the fancy name union bound, but the idea is very simple:

Thus, applying this union bound idea with the upper and lower tail bounds (20) and (21), we obtain Hoeffding’s inequality, exactly as it appeared above as (8):

Voilà! Hoeffding’s inequality has been proven! Bernstein’s inequality is proven essentially the same way except that, instead of (17), we have the cumulant generating function bound

for a random variable with mean zero and satisfying the bound .

Upshot: Randomness can be a very effective tool for solving computational problems, even those which seemingly no connection to probability like triangle counting. Concentration inequalities are a powerful tool for assessing how many samples are needed for an algorithm based on random sampling to work. Some of the most useful concentration inequalities are exponential concentration inequalities like Hoeffding and Bernstein, which show that an average of bounded random quantities are close to their average except with exponentially small probability.

# Don’t Solve the Normal Equations

The (ordinary) linear least squares problem is as follows: given an matrix and a vector of length , find the vector such that is as close to as possible, when measured using the two-norm . That is, we seek to

(1)

From this equation, the name “least squares” is self-explanatory: we seek which minimizes the sum of the squared discrepancies between the entries of and .

The least squares problem is ubiquitous in science, engineering, mathematics, and statistics. If we think of each row of as an input and its corresponding entry of as an output, then the solution to the least squares model gives the coefficients of a linear model for the input–output relationship. Given a new previously unseen input , our model predicts the output is approximately . The vector consists of coefficients for this linear model. The least squares solution satisfies the property that the average squared difference between the output and the prediction is as small as it could possibly be for all choices of coefficient vectors .

How do we solve the least squares problem? A classical solution approach, ubiquitous in textbooks, is to solve a system of linear equations known as the normal equations. The normal equations associated with the least squares problem (1) are given by

(2)

This system of equations always has a solution. If has full column-rank, then is invertible and the unique least squares solution to (1) is given by . We assume that has full column-rankQ for the rest of this discussion. To solve the normal equations in software, we compute and and solve (2) using a linear solver like MATLAB’s “\”.1Even better, we could us a Cholesky decomposition since the matrix is positive definite. (As is generally true in matrix computations, it is almost never a good idea to explicitly form the inverse of the matrix , or indeed any matrix.) We also can solve the normal equations using an iterative method like (preconditioned) conjugate gradient.

The purpose of the article is to advocate against the use of the normal equations for solving the least squares problems, at least in most cases. So what’s wrong with the normal equations? The problem is not that the normal equations aren’t mathematically correct. Instead, the problem is that the normal equations often lead to poor accuracy for the least squares solution using computer arithmetic.

Most of the time when using computers, we store real numbers as floating point numbers.2One can represent rational numbers on a computer as fractions of integers and operations can be done exactly. However, this is prone to gross inefficiencies as the number of digits in the rational numbers can grow to be very large, making the storage and time to solve linear algebra problems with rationals dramatically more expensive. For these reasons, the vast majority of numerical computations use floating point numbers which store only a finite number of digits for any given real number. In this model, except for extremely rare circumstances, rounding errors during arithmetic operations are a fact of life. At a coarse level, the right model to have in your head is that real numbers on a computer are stored in scientific notation with only 16 decimal digits after the decimal point.3This is a simplification in multiple ways. First, computers store numbers in binary and thus, rather than storing 16 decimal digits after the decimal point, they store 52 binary digits. This amounts to roughly 16 decimal digits. Secondly, there are different formats for storing real numbers as floating point on a computer with different amounts of stored digits. The widely used IEEE double precision format has about 16 decimal digits of accuracy; the IEEE single precision format has roughly 8. When two numbers are added, subtracted, multiplied, and divided, the answer is computed and then rounded to 16 decimal digits; any extra digits of information are thrown away. Thus, the result of our arithmetic on a computer is the true answer to the arithmetic problem plus a small rounding error. These rounding errors are small individually, but solving an even modestly sized linear algebra problem requires thousands of such operations. Making sure many small errors don’t pile up into a big error is part of the subtle art of numerical computation.

To make a gross simplification, if one solves a system of linear equations on a computer using a well-designed piece of software, one obtains an approximate solution which is, after accounting for the accumulation of rounding errors, close to . But just how close the computed solution and the true solution are depends on how “nice” the matrix is. The “niceness” of a matrix is quantified by a quantity known as the condition number of , which we denote .4In fact, there are multiple definitions of the condition number depending on the norm which one uses the measure the sizes of vectors. Since we use the 2-norm, the appropriate 2-norm condition number is the ratio of the largest and smallest singular values of . As a rough rule of thumb, the relative error between and is roughly bounded as

(3)

The “ corresponds to the fact we have roughly 16 decimal digits of accuracy in double precision floating point arithmetic. Thus, if the condition number of is roughly , then we should expect around digits of accuracy in our computed solution.

The accuracy of the least squares problem is governed by its own condition number . We would hope that we can solve the least squares problem with an accuracy like the rule-of-thumb error bound (3) we had for linear systems of equations, namely a bound like . But this is not the kind of accuracy we get for the least squares problem when we solve it using the normal equations. Instead, we get accuracy like

(4)

By solving the normal equations we effectively square the condition number! Perhaps this is not surprising as the normal equations also more-or-less square the matrix by computing . This squared condition number drastically effects the accuracy of the computed solution. If the condition number of is , then the normal equations give us absolute nonsense for ; we expect to get no digits of the answer correct. Contrast this to above, where we were able to get correct digits in the solution to despite the condition number of being times larger than !

All of this would be just a sad fact of life for the least squares problem if the normal equations and their poor accuracy properties were the best we could do for the least squares problem. But we can do better! One can solve linear least squares problems by computing a so-called QR factorization of the matrix .5In MATLAB, the least squares problem can be solved with QR factorization by calling “A\b”. Without going into details, the upshot is that the least squares solution by a well-designed6One way of computing the QR factorization is by Gram–Schmidt orthogonalization, but the accuracy properties of this are poor too. A gold-standard way of computing the QR factorization by means of Householder reflectors, which has excellent accuracy properties. QR factorization requires a similar amount of time to solving the normal equations and has dramatically improved accuracy properties, achieving the desirable rule-of-thumb behavior7More precisely, the rule of thumb is like . So even if we solve the least squares problem with QR factorization, we still get a squared condition number in our error bound, but this condition number squared is multiplied by the residual , which is small if the least squares fit is good. The least squares solution is usually only interesting when the residual is small, thus justifying dropping it in the rule of thumb.

(5)

I have not described how the QR factorization is accurately computed nor how to use the QR factorization to solve least squares problems nor even what the QR factorization is. All of these topics are explained excellently by the standard textbooks in this area, as well as by publicly available resources like Wikipedia. There’s much more that can be said about the many benefits of solving the least squares problem with the QR factorization,8E.g., it can work for sparse matrices while the normal equations often do not, it has superior accuracy to Gaussian elimination with partial pivoting even for solving linear systems, the “” matrix in the QR factorization can be represented implicitly as a product of easy-to-compute-with Householder reflectors which is much more efficient when, etc. but in the interest of brevity let me just say this: TL;DR when presented in the wild with a least squares problem, the solution method one should default to is one based on a well-implemented QR factorization, not solving the normal equations.

Suppose for whatever reason we don’t have a high quality QR factorization algorithm at our disposal. Must we then resort to the normal equations? Even in this case, there is a way we can reduce the problem of solving a least squares problems to a linear system of equations without squaring the condition number! (For those interested, to do this, we recognize the normal equations as a Schur complement of a somewhat larger system of linear equations and then solve that. See Eq. (7) in this post for more discussion of this approach.)

The title of this post Don’t Solve the Normal Equations is deliberately overstated. There are times when solving the normal equations is appropriate. If is well-conditioned with a small condition number, squaring the condition number might not be that bad. If the matrix is too large to store in memory, one might want to solve the least squares problem using the normal equations and the conjugate gradient method.

However, the dramatically reduced accuracy of solving the normal equations should disqualify the approach from being the de-facto way of solving least squares problems. Unless you have good reason to think otherwise, when you see , solve a different way.

# Sherman–Morrison for Integral Equations

In this post, I want to discuss two of my favorite topics in applied mathematics: the Sherman–Morrison formula and integral equations. As a bridge between these ideas, we’ll use an integral equation analog of the Sherman–Morrison formula to derive the solution for the Laplace equation with Dirichlet boundary conditions in the 2D disk.

## Laplace’s Equation

Suppose we have a thin, flat (two-dimensional) plate of homogeneous material and we measure the temperature at the border. What is the temperature inside the material? The solution to this problem is described by Laplace’s equation, one of the most ubiquitous partial differential equations in physics. Let denote the temperature of the material at point . Laplace’s equation states that, at any point on the interior of the material,

(1)

Laplace’s equation (1) and the specification of the temperature on the boundary form a well-posed mathematical problem in the sense that the temperature is uniquely determined at each point .1A well-posed problem is also required to depend continuously on the input data which, in this case, are the boundary temperatures. Indeed, the Laplace problem with boundary data is well-posed in this sense. We call this problem the Laplace Dirichlet problem since the boundary conditions

are known as Dirichlet boundary conditions.

## The Double Layer Potential

Another area of physics where the Laplace equation (1) appears is the study of electrostatics. In this case, represents the electric potential at the point . The Laplace Dirichlet problem is to find the electric potential in the interior of the region with knowledge of the potential on the boundary.

The electrostatic application motivates a different way of thinking about the Laplace equation. Consider the following question:

How would I place electric charges on the boundary to produce the electric potential at each point on the boundary?

This is a deliciously clever question. If I were able to find an arrangement of charges answering the question, then I could calculate the potential at each point in the interior by adding up the contribution to the electric potential of each element of charge on the boundary. Thus, I can reduce the problem of finding the electric potential at each point in the 2D region to finding a charge distribution on the 1D boundary to that region.

We shall actually use a slight variant of this charge distribution idea which differs in two ways:

• Rather than placing simple charges on the boundary of the region, we place charge dipoles.2The reason for why this modification works better is an interesting question, but answering it properly would take us too far afield from the goals of this article.
• Since we are considering a two-dimensional problem, we use a different formula for the electric potential than given by Coulomb’s law for charges in 3D. Also, since we are interested in solving the Laplace Dirichlet problem in general, we can choose a convenient dimensionless system of units. We say that the potential at a point induced by a unit “charge” at the origin is given by .

With these modifications, our new question is as follows:

How would I place a density of “charge” dipoles on the boundary to produce the electric potential at each point on the boundary?

We call this function the double layer potential for the Laplace Dirichlet problem. One can show the double layer potential satisfies a certain integral equation. To write down this integral equation, let’s introduce some more notation. Let be the region of interest and its boundary. Denote points concisely as vectors , with the length of denoted . The double layer potential satisfies

(2)

where the integral is taken over the surface of the region ; denotes the directional derivative taken in the direction normal (perpendicular) to the surface at the point . Note we choose a unit system for which hides physical constants particular to the electrostatic context, since we are interested in applying this methodology to the Laplace Dirichlet problem in general (possibly non-electrostatic) applications.

There’s one last ingredient: How do we compute the electric potential at points in the interior of the region? This is answered by the following formula:

(3)

The integral equation (2) is certainly nothing to sneeze at. Rather than trying to comprehend it in its full glory, we shall focus on a special case for the rest of our discussion. Suppose the region is a circular disk with radius centered at . The the partial derivative in the integrand in (2) then is readily computed for points and both on the boundary of the circle:

Substituting in (2) then gives

(4)

## The Sherman–Morrison Formula

We are interested in solving the integral equation (4) to obtain an expression for the double-layer potential , as this will give us a solution formula for the Laplace Dirichlet problem. Ultimately, we accomplish this by using a clever trick. In an effort to make this trick seem more self-evident and less of a “rabbit out of a hat”, I want to draw an analogy to a seemingly unrelated problem: rank-one updates to linear systems of equations and the Sherman–Morrison formula.3In accordance with Stigler’s law of eponymy, the Sherman–Morrison formula was actually discovered by William J. Duncan five years before Sherman, Morrison, and Woodbury. For a more general perspective on the Sherman–Morrison formula and its generalization to the Sherman–Morrison–Woodbury formula, you may be interested in the following post of mine on Schur complements and block Gaussian elimination.

Suppose we want to solve the system of linear equations

(5)

where is an square matrix and , , and are length- vectors. We are ultimately interested in finding from . To gain insight into this problem, it will be helpful to first carefully considered the problem in reverse: computing from . We could, of course, perform this computation by forming the matrix in memory and multiplying it with , but there is a more economical way:

1. Form .
2. Compute .

Standing back, observe that we now have a system of equations for unknowns and . Specifically, our first equation can be rewritten as

which combined with the second equation

gives the by system4This “state space approach” of systematically writing out a matrix–vector multiply algorithm and then realizing this yields a larger system of linear equations was initially taught to be by my mentor Shiv Chandrasekaran; this approach has much more powerful uses, such as in the theory of rank-structured matrices.

(6)

The original equation for (5) can be derived from the “lifted” equation (6) by applying Gaussian elimination and eliminating the first row of the linear system (6). But now that we have the lifted equation (6), one can naturally wonder what would happen if we instead used Gaussian elimination to eliminate the last rows of (6); this will give us an equation for which we can solved without first computing . Doing this so-called block Gaussian elimination yields

Solving this, we deduce that

From the equation , we have that

Since this formula holds for every vector , we deduce the famous Sherman–Morrison formula

This example shows how it can be conceptually useful to lift a linear system of equations by adding additional variables and equations and then “do Gaussian elimination in a different order”. The same insight shall be useful in solving integral equations like (4).

## Solving for the Double Layer Potential

Let’s try repeating the playbook we executed for the rank-one-updated linear system (5) and apply it to the integral equation (4). We are ultimately interested in computing from but, as we did last section, let’s first consider the reverse. To compute from , we first evaluate the integral

Substituting this into (4) gives the system of equations

(7)

(8)

In order to obtain (4) from (7) and (8), we add times equation (8) to equation (7). Following last section, we now instead eliminate from equation (8) using equation (7). To do this, we need to integrate equation (7) in order to cancel the integral in equation (8):

Adding times this integrated equation to equation (8) yields

Thus plugging this expression for into equation (7) yields

We’ve solved for our double layer potential!

As promised, the double layer potential can be used to give a solution formula (known as the Poisson integral formula) for the Laplace Dirichet problem. The details are a mechanical, but also somewhat technical, exercise in vector calculus identities. We plug through the details in the following extra section.

Poisson Integral Formula
Let’s finish this up by using the double layer to derive a solution formula for the electric potential at a point in the interior of the region. To do this, we use equation (3):

(9)

We now need to do a quick calculation which is somewhat technical and not particularly enlightening. We evaluate using the divergence theorem:

We denote for the gradient, for the normal vector to at the point , for the dot product, for the Laplace operator, and for the Dirac delta “function”. The last equality holds because the function is a so-called fundamental solution for Laplace equation in the sense that . Therefore, (9) simplifies to

Computing the boundary derivative for the spherical region centered at the origin with radius , we obtain the formula

We’ve succeeded at deriving a solution formula for for points in the interior of the disk in terms of for points on the boundary of the disk. This is known as the Poisson integral formula for the disk in two dimensions. This formula can be generalized to balls in higher dimensions, though this proof technique using “Sherman–Morrison” fails to work in more than two dimensions.

## Sherman–Morrison for Integral Equations

Having achieved our main goal of deriving a solution formula for the 2D Laplace Dirichlet problem for a circular domain, I want to take a step back to present the approach from two sections ago in more generality. Consider a more general integral equation of the form

(10)

where is some region in space, , , and are functions of one or two arguments on , and is a nonzero constant. Such an integral equation is said to be of the second kind. The integral equation for the Laplace Dirichlet problem (2) is of this form with , , , and . We say the kernel is separable with rank if can be expressed in the form

With the circular domain, the Laplace Dirichlet integral equation (2) is separable with rank .5E.g., set and . We shall focus on the second kind integral equation (10) assuming the kernel is separable with rank (for simplicity, we set ):

(11)

Let’s try and write this equation in a way that’s more similar to the linear system of equation (5). To do this, we make use of linear operators defined on functions:

• Let denote the identity operator on functions: It takes as inputs function and outputs the function unchanged.
• Let denote the “integration against operator”: It takes as input a function and outputs the number .

With these notations, equation (11) can be written as

Using the same derivation which led to the Sherman–Morrison formula for linear systems of equations, we can apply the Sherman–Morrison formula to this integral equation in operator form, yielding

Therefore, the solution to the integral equation (11) is

This can be interpreted as a kind of Sherman–Morrison formula for the integral equation (11).

One can also generalize to provide a solution formula for the second-kind integral equation (10) for a separable kernel with rank ; in this case, the natural matrix analog is now the Sherman–Morrison–Woodbury identity rather than the Sherman–Morrison formula. Note that this solution formula requires the solution of a system of linear equations. One can use this as a numerical method to solve second-kind integral equations: First, we approximate by a separable kernel of a modest rank and then compute the exact solution of the resulting integral equation with the approximate kernel.6A natural question is why one might want to solve an integral equation formulation of a partial differential equations like the Laplace or Helmholtz equation. An answer is that that formulations based on second-kind integral equations tend to lead to systems of linear equations which much more well-conditioned as compared to other methods like the finite element method. They have a number of computational difficulties as well, as the resulting linear systems of equations are dense and may require elaborate quadrature rules to accurately compute.

My goal in writing this post was to discuss two topics which are both near and dear to my heart, integral equations and the Sherman–Morrison formula. I find the interplay of these two ideas to be highly suggestive. It illustrates the power of the analogy between infinite-dimensional linear equations, like differential and integral equations, and finite-dimensional ones, which are described by matrices. Infinite dimensions certainly do have their peculiarities and technical challenges, but it can be very useful to first pretend infinite-dimensional linear operators (like integral operators) are matrices, do calculations to derive some result, and then justify these computations rigorously post hoc.7The utility of this technique is somewhat of an open secret among some subset of mathematicians and scientists, but such heuristics are usually not communicated to students explicitly, at least in rigorous mathematics classes.

# The Vandermonde Decomposition

In this post, I want to discuss a beautiful and somewhat subtle matrix factorization known as the Vandermonde decomposition that appears frequently in signal processing and control theory. We’ll begin from the very basics, introducing the controls-and-signals context, how the Vandermonde decomposition comes about, and why it’s useful. By the end, I’ll briefly share how we can push the Vandermonde decomposition beyond matrices to the realm of tensors, which will can allow us to separate mixed signals from multiple measurements. This tensorial generalization plays an important role in my paper -decompositions, sparse component analysis, and the blind separation of sums of exponentials, joint work with Nithin Govindajaran and Lieven De Lathauwer, which recently appeared in the SIAM Journal of Matrix Analysis and Applications.

## Finding the Frequencies

Suppose I give you a short recording of a musical chord consisting of three notes. How could you determine which three notes they were? Mathematically, we can represent such a three-note chord as a combination of scaled and shifted cosine functions

(1)

We are interested in obtaining the (angular) frequencies , , and .

In the extreme limit, when we are given the values of the signal for all , both positive and negative, the frequencies are immediately given by taking a Fourier transform of the function . In practice, we only have access to the function at certain times which we assume are equally spaced

Given the samples

we could try to identify , , and using a discrete Fourier transform.1The discrete Fourier transform can be computed very quickly using the fast Fourier transform, as I discussed in a previous post. Unfortunately, this generally requires a large number of samples to identify , , and accurately. (The accuracy scales roughly like , where is the number of samples.) We are interested in finding a better way to identify the frequencies.

Now that we’ve moved from the function , defined for any real input , to a set of samples it will be helpful to rewrite our formula (1) for in a different way. By Euler’s identity, the cosines can be rewritten as

As a consequence, we can rewrite one of the frequency components in (1) as

Here, and are complex coefficients and which contain the same information as the original parameters and . Now notice that we are only interest in values which are multiples of the spacing . Thus, our frequency component can be further rewritten as

where and . Performing these reductions, our samples take the form

(2)

We’ve now reformulated our frequency problems in identifying the parameters and in the relation (2) from a small number of measurements .

## Frequency Finding as a Matrix Factorization

We will return to the algorithmic problem of identifying the parameters in the relation (2) from measurements in a little bit. First, we will see that (2) can actually be written as a matrix factorization. Understanding computations by matrix factorization has been an extremely successful paradigm in applied mathematics, and we will see in this post how viewing (2) as a matrix factorization can be very useful.

While it may seem odd at first,2As pointed out to me on math stack exchange, one reason forming the Hankel matrix is sensible is because it effectively augments the sequence of numbers into a sequence of vectors given by the columns of . This can reveal patterns in the sequence which are less obvious when it is represented as given just as numbers. For instance, any seven columns of are linearly dependent, a surprising fact since the columns of have length which can be much larger than seven. In addition, as we will soon effectively exploit later, vectors in the nullspace of (or related Hankel matrices derived from the sequence) give recurrence relations obeyed by the sequence. This speaks to a general phenomenon where properties of sequence (say, arising from snapshots of a dynamical system) can sometimes become more clear by this procedure of delay embedding. it will be illuminating to repackage the measurements as a matrix:

(3)

Here, we have assumed is odd. The matrix is known as the Hankel matrix associated with the sequence . Observe that the entry in position of depends only on the sum of the indices and , . (We use a zero-indexing system to label the rows and columns of where, for instance, the first row of is row .)

Let’s see how we can interpret the frequency decomposition (2) as a factorization of the Hankel matrix . We first write out using (2):

(4)

The power was just begging to be factorized as , which we did. Equation (4) almost looks like the formula for the product of two matrices with entries , so it makes sense to introduce the matrix with entry . This is a so-called Vandermonde matrix associated with and has the form

If we also introduce the diagonal matrix , the formula (4) for can be written as the matrix factorization3In the Vandermonde decomposition , the factor appears transposed even when is populated with complex numbers! This differs from the usual case in linear algebra where we use the conjugate transpose rather than the ordinary transpose when working with complex matrices. As a related issue, observe that if at least one of the measurements is a (non-real) complex number, the Hankel matrix is symmetric but not Hermitian.

(5)

This is the Vandermonde decomposition of the Hankel matrix , a factorization of as a product of the transpose of a Vandermonde matrix, a diagonal matrix, and that same Vandermonde matrix.

The Vandermonde decomposition immediately tells us all the information and describing our sampled recording via (2). Thus, the problem of determining and is equivalent to finding the Vandermonde decomposition (5) of the Hankel matrix .

## Computing the Vandermonde Decomposition: Prony’s Method

Computing the Vandermonde decomposition accurately can be a surprisingly hard task, particularly if the measurements are corrupted by even a small amount of measurement error. In view of this, I want to present a very classical way of computing this decomposition (dating back to 1795!) known as Prony’s method. This method is conceptually simple and will be a vehicle to continue exploring frequency finding and its connection with Hankel matrices. It remains in use, though it’s accuracy may be significantly worse compared to other methods.

As a first step to deriving Prony’s method, let’s reformulate the frequency finding problem in a different way. Sums of cosines like the ones in our expression (1) for the function often appear as the solution to a (linear) ordinary differential equation (ODE). This means that one way we could find the frequencies comprising would be to find a differential equation which satisfies. Together with the initial condition , determining all the frequencies would be very straightforward.

Since we only have access to samples of at regular time intervals, we will instead look for the “discrete-time” analog of a linear ODE, a linear recurrence relation. This is an expression of the form

(6)

In our case, we’ll have because there are six terms in the formula (2) for . Together with initial conditions , such a recurrence will allow us to determine the parameters and in our formula (2) for our sampled recordings and hence also allow us to compute the Vandermonde decomposition (5).

Observe that the recurrence (6) is a linear equation in the variables . A very good rule of thumb in applied mathematics is to always write down linear equations in matrix–vector notation in see how it looks. Doing this, we obtain

(7)

Observe that the matrix on the right-hand side of this equation is also a Hankel matrix (like in (3)) formed from the samples . Call this Hankel matrix . Unlike in (3), is rectangular. If is much larger than , will be tall, possessing many more rows than columns. We assume going forward.4 would also be fine for our purposes, but we assume to illustrate this highly typical case.

Let’s write (7) a little more compactly as

(8)

where we’ve introduced for the vector on the left-hand side of (7) and collected the recurrence coefficients into a vector . For a typical system of linear equations like (8), we would predict the system to have no solution : Because has more rows than columns (if ), the system equations (8) has more equations than unknowns. Fortunately, we are not in the typical case. Despite the fact that we have more equations than unknowns, the linear equations (8) have a unique solution .5This solution can be computed by solving the system of linear equations In particular, the matrix on the right-hand side of this equation is guaranteed to be nonsingular under our assumptions. Using the Vandermonde decomposition, can you see why? The existence of a unique solution is a consequence of the fact that the samples satisfy the formula (2). As a fun exercise, you might want to verify the existence of a unique satisfying (8)!

As a quick aside, if the measurements are corrupted by small measurement errors, then the equations (8) will usually not possess a solution. In this case, it would be appropriate to find the least squares solution to equation (8) as a way of mitigating these errors.

Hurrah! We’ve found the coefficients providing a recurrence relation (6) for our measurements . All that is left is to find the parameters and in our signal formula (2) and the Vandermonde decomposition (5). Fortunately, this is just a standard computation for linear recurrence relations, nicely paralleling the solution of (homogenous) linear ODEs by means of the so-called “characteristic equation”. I’ll go through fairly quickly since this material is well-explained elsewhere on the internet (like Wikipedia). Let’s guess that our recurrence (6) has a solution of the form ; we seek to find all complex numbers for which this is a bonafide solution. Plugging this solution into the formula (6) for gives

(9)

This is the so-called characteristic equation for the recurrence (6). As a single-variable polynomial equation of degree six, it has six complex solutions . These numbers are precisely those numbers which appear in the sequence formula (2) and the Vandermonde decomposition (5).

Finally, we need to compute the coefficients . But this is easy. Observe that the formula (2) provides the following system of linear equations for :

(10)

Again, this system of equations will have a unique solution if the measurements are uncorrupted by errors (and can be solved in the least squares sense if corrupted). This gives , completing our goal of computing the parameters in the formula (2) or, equivalently, finding the Vandermonde decomposition (5).

We have accomplished our goal of computing the Vandermonde decomposition. The approach by which we did so is known as Prony’s method, as mentioned in the introduction to this section. As suggested, this method may not always give high-accuracy results. There are two obvious culprits that jump out about why this is the case. Prony’s method requires solving for the roots of the polynomial equation (9) expressed “in the monomial basis” and solving a system of linear equations (10) with a (transposed) Vandermonde matrix. Both of these problems can be notoriously ill-conditioned and thus challenging to solve accurately and may require the measurements to be done to very high accuracy. Notwithstanding this, Prony’s method does useful results in some cases and forms the basis for potentially more accurate methods, such as those involving generalized eigenvalue problems.

## Separating Signals: Extending the Vandermonde Decomposition to Tensors

In our discussion of the frequency identification problem, the Vandermonde decomposition (5) has effectively been an equivalent way of showing the samples are a combination of exponentials . So far, the benefits of the matrix factorization perspective have yet to really reveal themselves.

So what are the benefits of the Vandermonde decompostions? A couple of nice observations related to the Vandermonde decomposition and the “Hankelization” of the signals have already been lurking in the background. For instance, the rank of the Hankel matrix is the number of frequency components needed to describe the samples and the representation of the samples as a mixture of exponentials is uniquely determined only if the matrix does not have full rank; I have a little more to say about this at the very end. There are also benefits to certain computational problems; one can use Vandermonde decompositions to compute super high accuracy singular value decompositions of Hankel matrices.

The power of the Vandermonde decomposition really starts to shine when we go beyond the basic frequency finding problem we discussed by introducing more signals. Suppose now there are three short recordings , , and . (Here, the superscript denotes an index rather than differentiation.) Each signal is a weighted mixture of three sources , , and , each of which plays a musical chord of three notes (thus representable as a sum of cosines as in (1)). One can think of the sources of being produced three different musical instruments at different places in a room and the recordings , , and being taken from different microphones in the room.6This scenario of instruments and microphones ignores the finite propagation speed of sound, which also would introduce time delays in the sources in the recorded signals. We effectively treat the speed of sound as being instantaneous. Our goal is now not just to identify the musical notes in the recordings but also to identify how to assign those notes to reconstruct the source signals , , and .

Taking inspiration from earlier, we record samples for each recording and form each collection of samples into a Hankel matrix

Here comes the crazy part: Stack the Hankelized recordings , , and as slices of a tensor . A tensor, in this context, just means a multidimensional array of numbers. Just as a vector is a one-dimensional array and a matrix is a two-dimensional array, a tensor could have any number of dimensions. In our case, we need just three. If we use a MATLAB-esque indexing notation, is a array given by

The remarkable thing is that the source signals can be determined (under appropriate conditions) by computing a special kind of Vandermonde decomposition of the tensor ! (Specifically, the required decomposition is a Vandermonde-structured -block term decomposition of the tensor .) Even more cool, this decomposition can be computed using general-purpose software like Tensorlab.

If this sounds interesting, I would encourage you to check out my recently published paper -decompositions, sparse component analysis, and the blind separation of sums of exponentials, joint work with Nithin Govindajaran and Lieven De Lathauwer and recently published in the SIAM Journal on Matrix Analysis and Applications. In the paper, we explain what this -decomposition is and how applying it to can be used to separate mixtures of exponentials signals from the resulting Vandermonde structure, an idea originating in the work of De Lathauewer. A very important question for these signal separation problems is that of uniqueness. Given the three sampled recordings (comprising the tensor ), is there just one way of unscrambling the mixtures into different sources or multiple? If there are multiple, then we might have possibly computed the wrong one. If there is just a single unscrambling, though, then we’ve done our job and unmixed the scrambled signals. The uniqueness of these tensor decompositions is fairly complicated math, and we survey existing results and prove new ones in this paper.7One of our main technical contributions is a new notion of uniqueness of -decompositions which we believe is nicely adapted to the signal separation context. Specfically, we prove mathematized versions of the statement “if the source signals are sufficiently different from each others and the measurements of sufficiently high quality, then the signals can uniquely be separated”.

## Conclusions, Loose Ends, and Extensions

The central idea that we’ve been discussing is how it can be useful to convert between a sequence of observations and a special matricization of this sequence into a Hankel matrix (either square, as in (3), or rectangular, as in (7)). By manipulating the Hankel matrix, say, by computing its Vandermonde decomposition (5), we learn something about the original signal, namely a representation of the form (2).

This is a powerful idea which appears implicitly or explicitly throughout various subfields of mathematics, engineering, and computation. As with many other useful ideas, this paradigm admits many natural generalizations and extensions. We saw one already in this post, where we extended the Vandermonde decomposition to the realm of tensors to solve signal separation problems. To end this post, I’ll place a few breadcrumbs at the beginning of a few of the trails of these generalizations for any curious to learn more, wrapping up a few loose ends on the way.

Is the Vandermonde Decomposition Unique?
A natural question is whether the Vandermonde decomposition (5) is unique. That is, is it possible that there exists two Vandermonde decompositions

of the same (square) Hankel matrix ? This is equivalent to whether the frequency components can be uniquely determined from the measurements .

Fortunately, the Vandermonde decomposition is unique if (and only if) the matrix is a rank-deficient matrix. Let’s unpack this a little bit. (For those who could use a refresher on rank, I have a blog post on precisely this topic.) Note that the Vandermonde decomposition is a rank factorization8Rank factorizations are sometimes referred to as “rank-revealing factorizations”. I discuss my dispreference for this term in my blog post on low-rank matrices. since has rows, has full (row) rank, and is invertible. This means that if take enough samples of a function which is a (finite) combinations of exponentials, the matrix will be rank-deficient and the Vandermonde decomposition unique.9The uniqueness of the Vandermonde decomposition can be proven by showing that, in our construction by Prony’s method, the ‘s, ‘s, and ‘s are all uniquely determined. If too few samples are taken, then does not contain enough information to determine the frequency components of the signal and thus the Vandermonde decomposition is non-unique.

Does Every Hankel Matrix Have a Vandermonde Decomposition?
This post has exclusively focused on a situation where we are provided with sequence we know to be represented as a mixture of exponentials (i.e., taking the form (2)) from which the existence of the Vandermonde decomposition (5) follows immediately. What if we didn’t know this were the case, and we were just given a (square) Hankel matrix . Is guaranteed to possess a Vandermonde decomposition of the form (5)?

Unfortunately, the answer is no; there exist Hankel matrices which do not possess a Vandermonde decomposition. The issue is related to the fact that the appropriate characteristic equation (analogous to (9)) might possess repeated roots, making the solutions to the recurrence (6) not just take the form but also and perhaps , , etc.

Are There Cases When the Vandermonde Decomposition is Guaranteed To Exist?
There is one natural case when a (square) Hankel matrix is guaranteed to possess a Vandermonde decomposition, namely when the matrix is nonsingular/invertible/full-rank. Despite this being a widely circulated fact, I am unaware of a simple proof for why this is the case. Unfortunately, there is not just one but infinitely many Vandermonde decompositions for a nonsingular Hankel matrix, suggesting these decompositions are not useful for the frequency finding problem that motivated this post.
What If My Hankel Matrix Does Not Possess a Vandermonde Decomposition?
As discussed above, a Hankel matrix may fail to have a Vandermonde decomposition if the characteristic equation (a la (9)) has repeated roots. This is very much analogous to the case of a non-diagonalizable matrix for which the characteristic polynomial has repeated roots. In this case, while diagonalization is not possible, one can “almost-diagonalize” the matrix by reducing it to its Jordan normal form. In total analogy, every Hankel matrix can be “almost Vandermonde decomposed” into a confluent Vandermonde decomposition (a discovery that appears to have been made independently several times). I will leave these links to discuss the exact nature of this decomposition, though I warn any potential reader that these resources introduce the decomposition first for Hankel matrices with infinitely many rows and columns before considering the finite case as we have. One is warned that while the Vandermonde decomposition is always a rank decomposition, the confluent Vandermonde decomposition is not guaranteed to be one.10Rather, the confluent Vandermonde decomposition is a rank decomposition for an infinite extension of a finite Hankel matrix. Consider the Hankel matrix This matrix has rank-two but no rank-two confluent Vandermonde decomposition. The issue is that when extended to an infinite Hankel matrix this (infinite!) matrix has a rank exceeding the size of the original Hankel matrix .
The Toeplitz Vandermonde Decomposition
Just as it proved useful to arrange samples into a Hankel matrix, it can also be useful to form them into a Toeplitz matrix