Optimal Shrinkage of Eigenvalues in the Spiked Covariance Model
David L. Donoho, Matan Gavish, Iain M. Johnstone
Introduction
Suppose we observe -dimensional Gaussian vectors , , with the underlying -by- population covariance matrix. To estimate , we form the empirical (sample) covariance matrix ; this is the maximum likelihood estimator. Stein observed that the maximum likelihood estimator ought to be improvable by eigenvalue shrinkage.
In high dimensional problems, and are often of comparable magnitude. There, the maximum likelihood estimator is no longer a reasonable choice for covariance estimation and the need to shrink becomes acute.
In this paper, we consider a popular large , large setting with comparable to , and a set of assumptions about known as the Spiked Covariance Model . We study a variety of loss functions derived from or inspired by the literature, and show that to each “reasonable” nonlinearity there corresponds a well-defined asymptotic loss.
In the sibling problem of matrix denoising under a similar setting, it has been shown that there exists a unique asymptotically admissible shrinker . The same phenomenon is shown to exist here: for many different loss functions, we show that there exists a unique optimal nonlinearity , which we explicitly provide. Perhaps surprisingly, is the only asymptotically admissible nonlinearity, namely, it offers equal or better asymptotic loss than that of any other choice of , across all possible Spiked Covariance models.
Consider a sequence of covariance estimation problems, satisfying two basic assumptions.
The number of observations and the number of variables in the -th problem follows the proportional-growth limit , as , for a certain .
The spiked model exhibits three important phenomena, not seen in classical fixed- asymptotics, that play an essential role in the construction of optimal estimators. Drawing on results from , we highlight:
Loss functions and optimal estimation. Now consider a class of estimators for the population covariance , based on individual shrinkage of the sample eigenvalues. Specifically,
assuming such limit exists. If a nonlinearity satisfies
To give the flavor of results to be developed systematically later, we now look at four error measures in common use. The first three, based on the operator, Frobenius and nuclear norms, use the singular values of :
The fourth is Stein’s loss, widely studied in covariance estimation .
Remark. The optimal shrinker also depends on , so we might write . In model [Asy()], one can use the same for each problem size . Alternatively, in the -th problem, one might use . The former choice is simpler, as can be regarded as a univariate function of , and so we make it in Sections 1–6. The latter choice is preferable technically, and perhaps also in practice, when one has and , but not . It does, however, require us to treat as a bivariate function – see Section 7.
2 Some key observations
The sections to follow construct a framework for evaluating and optimizing the asymptotic loss (1.8). We highlight here some observations that will play an important role. Beforehand, let us introduce a useful modification of (1.7) to a rank-aware shrinkage rule:
where the dimension of the spiked model is taken as known. While our main results concern estimators that naturally do not require to be known in advance, it will be easier conceptually and technically to analyze rank-aware shrinkage rules as a preliminary step.
[Obs. 1] Simultaneous block diagonalization. (Lemmas 1 and 5). There exists a (random) basis such that
where and are square blocks of equal size , and . (Here and below, denotes a block-diagonal matrix with blocks and ).
[Obs. 2] Decomposable loss functions. The loss functions (1.11) and many others studied below satisfy
or the corresponding equality with sum replaced by max.
[Obs. 3] Asymptotic deterministic loss. (Lemmas 3 and 7). For rank-aware estimators, when and are suitably continuous, almost surely
[Obs. 4] Asymptotic equivalence of losses. (Proposition 2). Conclusions derived for rank-aware estimators (1.13) carry over to the original estimators (1.7) because, under suitable conditions
3 Organization of the paper
Simultaneous Block-Diagonalization
We first develop [Obs. 1] in the simplest case, , assumping a rank-aware shrinker. In general, the estimator and estimand are not simultaneously diagonalizable. However, in the particular case that both are rank-one perturbations of the identity, we will see that simultaneous block diagonalization is possible.
Some notation is needed. We denote the eigenvalues and eigenvectors of the spectral decompostion by
Whenever possible, we supress the index and write e.g. , and instead. Similarly, we often write or even for .
Let and be (fixed, nonrandom) -by- symmetric positive definite matrices with
where the fundamental matrices and are given by
Let , where denotes the unit vector in the first co-ordinate direction. It is evident that
It is natural, then, to work in the “common” basis of and . We apply one step of Gram-Schmidt if we can, setting
In the second–exceptional–case, , so we pick a convenient vector orthogonal to . In either case, the columns of the matrix are orthonormal and their span contains both and . Now fill out to an orthogonal matrix . Observe now that if lies in the column span of and is a scalar, then necessarily
The expressions (2.3) – (2.5) now follow from the rank one perturbation forms (2.6) along with
Decomposable Loss Functions
Here and below, by loss function we mean a function of two -by- positive semidefinite matrix arguments obeying , with if and only if . A loss family is a sequence , one for each matrix size . We often write loss function and refer to the entire family. [Obs. 2] calls out a large class of loss functions which naturally exploit the simultaneously block-diagonalizability property of Lemma 1; we now develop this observation.
Orthogonal Invariance. We say the loss function is orthogonally invariant if for each orthogonal -by- matrix ,
For given and a given sequence of block sizes such that , consider block-diagonal matrix decompositions of by matrices and into blocks and of size :
Sum-Decomposability and Max-Decomposability. We say the loss function is sum-decomposable if for all decompositions (3.1),
We say that it is max-decomposable if if for all decompositions (3.1),
Clearly, such loss functions can exploit the simultaneous block diagonalization of Lemma 1. Indeed,
Reduction to Two-Dimensional Problem. Consider an orthogonally invariant loss function, , which is sum- or max-decomposable. Suppose that and satisfy (2.1) and (2.2) respectively. Then
Lemma 1 provides a change of basis yielding decompositions (2.3) and (2.4). From the invariance and decomposability hypotheses,
Asymptotic Loss in the Spiked Covariance Model
If is continuous, then the convergence results (1.2) and (1.5) imply that the principal block converges as . Specifically,
say, with the convergence occurring in all norms on matrices.
We say that a scalar function is a bulk shrinker if when , and a neighborhood bulk shrinker if for some , whenever
The neighborhood bulk shrinker condition on is rather strong, but does hold for in (1.12), for example. (Note that our definitions ignore the lower bulk edge , which is of less interest in the spiked model.)
Furthermore, if (b) is a neighborhood bulk shrinker, then also has this limit a.s.
Each of the 26 losses considered in this paper satisfies conditions (a).
In the rank-aware case satisfies
where the limit on the right hand side follows from convergence (4.1) and the assumed continuity of .
Examples of Decomposable Loss Functions
Many of the loss functions that appear in the literature are Pivot-Losses. They can be obtained via the following common recipe:
Pivots. A matrix pivot is a matrix-valued function of two real positive definitee matrices such that: (i) if and only if , (ii) is orthogonally equivariant and (iii) respects block structure in the sense that
for any orthogonal matrix of the appropriate dimension.
Matrix pivots can be symmetric-matrix valued, for example , but need not be, for example .
Pivot-Losses. Let be a non-negative function of a symmetric matrix variable that is definite: if and only if , and orthogonally invariant: for any orthogonal matrix . A symmetric-matrix valued pivot induces an orthgonally-invariant pivot loss
More generally, for any matrix pivot , set and define
An orthogonally invariant function depends on its matrix argument or only through its eigenvalues or singular values . We abuse notation to write . Observe that if has either of the forms
for some univariate , then the pivot loss (symmetric pivot) or (general pivot) is respectively sum- or max-decomposable. In case is symmetric, the two definitions agree so long as is an even function of .
There are different strategies to derive sum-decomposable pivot-losses. First, we can use statistical discrepancies between the Normal distributions and :
This is just twice the Kullback distance . Stein’s loss is a pivot-loss with respect to and , where
Entropy/Divergence Losses: Because the Kullback discrepancy is not symmetric in its arguments, we may consider two other losses: reversing the arguments we get Entropy loss and summing the Stein and Entropy losses gives divergence loss:
see . Each can be shown to be sum-decomposable, following the same argument as above.
This measures the statistical distinguishability of and based on independent observations, since with and the densities of and . Hence convergence of affinity loss to zero is equivalent to convergence of the underlying densities in Hellinger or Variation distance. This is a pivot-loss w.r.t and
as is seen by setting and noting that . Here, .
Fréchet Discrepancy : Let . This measures the minimum possible mean-squared difference between zero-mean random vectors with covariances and respectively. This is a pivot-loss w.r.t , and with .
Second, we may obtain sum-decomposable pivot-losses by simply taking to be one of the standard matrix norms:
Squared Error Loss : Let . This is a pivot-loss w.r.t and with .
Squared Error Loss on Precision : Let . This is a pivot-loss w.r.t and .
Nuclear Norm Loss. Let where denotes the nuclear norm of the matrix , i.e. the sum of its singular values. This is a pivot-loss w.r.t and .
Let . This is a pivot-loss w.r.t . It was studied in and later work.
Let , where denotes the matrix logarithmThe matrix logarithm transfers the matrices from the Riemannian manifold of symmetric positive semidefinite matrices to its tangent space at . It can be shown that is the squared geodesic distance in this manifold. This metric between covariances has attracted attention, for example, in diffusion tensor MRI . . This is a pivot-loss w.r.t
2 Examples of Max-Decomposable Losses
Max-decomposable losses arise by applying the operator norm (the maximal singular value or eigenvalue of a matrix) to a suitable pivot. Here are a few examples:
Operator Norm Loss : Let . This is a pivot-loss w.r.t and .
Operator Norm Loss on Precision: Let . This is a pivot-loss w.r.t. .
Condition Number Loss: Let . This is a pivot-loss w.r.t , related to . In the spiked model discussed below, effectively measures the condition number of .
We adopt the systematic naming scheme where , and . This set of 21 combinations covers the previous matrix norm examples and adds some more. Together with Stein’s loss and the others based on statistical discrepancy mentioned above, we arrive at a set of 26 loss functions, Table 1, to be studied in this paper.
Optimal Shrinkage for Decomposable Losses
Below, we call formally optimal shrinkers simply “optimal”. By definition, the optimal shrinkage rule is the unique admissible rule, in the asymptotic sense, among rules of the form in the single-spike model. In the single spiked model (and as we show later, generally in the spiked model) one never regrets using the optimal shrinker over any other (reasonably regular) univariate shrinker. In light of our results so far, an obvious characterization of an optimal shrinker is as follows.
Characterization of Optimal Shrinker. Let be a loss family. Define
Many of the 26 loss families discussed in Section 3 admit a closed form expression for the optimal shrinker; see Table 2. For others, we computed the optimal shrinker numerically, by implementing in software a solver for the simple scalar optimization problem (6.3). Figure 3 portrays the optimal shrinkers for our 26 loss functions. We refer readers interested in computing specific individual shrinkers to our reproducibility advisory at the bottom of this paper, and invite the reader to explore the code supplement , consisting of online resources and code we offer.
2 Optimal Shrinkers Collapse the Bulk
We first observe that, for any of the 26 losses considered, the optimal shrinker collapses the bulk to . The following lemma is proved in the supplemental article :
3 Optimal Shrinkers by Computer
The scalar optimization problem (6.3) is easy to solve numerically, so that one can always compute the optimal shrinker at any desired value . In the code supplement we provide Matlab code to compute the optimal nonlinearity for each of the 26 loss families discussed. In the sibling problem of singular value shrinkage for matrix denoising, demonstrates numerical evaluation of optimal shrinkers for the Schatten- norm, where analytical derivation of optimal shrinkers appears to be impossible.
4 Optimal Shrinkers in Closed Form
If set . Otherwise:
This asymptotic relationship reflects the classical fact that in finite samples, the top empirical eigenvalue is always biased upwards of the underlying population eigenvalue . Formally defining the (asymptotic) bias as
On the other hand, within the bottom branch, the effect is to shrink the bulk to 1. In terms of Definition 3 we see that is a bulk shrinker, but not a neighborhood bulk shrinker.
One might expect asymptotic debiasing from every loss function, but, perhaps surprisingly, precise asymptotic debiasing is exceptional. In fact, none of the other optimal nonlinearities in Table 2 is precisely debiasing.
In the supplemental article we also provide a detailed investigation of the large- asymptotics of the optimal shrinkers, including their asymptotic slopes, asymptotic shifts and asymptotic percent improvement.
Beyond Formal Optimality
Assume that and are fixed matrices with
Let and denote the -by- matrices consisting of the top eigenvectors of and respectively. Suppose that has full rank , and consider the decomposition
where has orthonormal columns and the matrix is upper triangular. Let denote the submatrix formed by the last columns of . Fill out to an orthogonal matrix . Then in the transformed basis we have the simultaneous block decompositions
We start with observations about the structure of and . Since the first columns of are identically those of , we let be the -by- matrix such that . For the same reason, has the block structure
where the matrices and satisfy so that
Since has orthogonal columns, we have
Let be a matrix whose columns lie in the column span of and let be an diagonal matrix. Observe that
say, since the columns of are orthogonal to those of .
and so both of the form , with and respectively. We find that
We can then compute the value of in the two cases to be given by and respectively, which establishes (7.1) and (7.2), and hence the lemma. ∎
We intend to apply Lemma 5 to and , the “rank-aware” modification (1.13) of the estimator in (1.7). Assume now that and the matrix formed by the top eigenvectors of are random.
The rank of equals almost surely.
Let be the projection that picks out the first columns of an orthogonal matrix . For a fixed -frame , we consider the event
where the matrices satisfy
Suppose also that the family of loss functions is orthogonally invariant and sum- or max- decomposable, and that is continuous. Then
If is a neighborhood bulk shrinker, then also has this limit a.s.
This is the rank analog of Lemma 3. The optimal nonlinearity is continuous on for all losses except the operator norm ones, for which is continuous except at . Our result (7.7) requires only continuity on and so is valid for all 26 loss functions, as is the deterministic limit (7.8) for the rank-aware . However, as we saw earlier, only the nuclear norm based loss functions yield optimal functions that are neighborhood bulk shrinkers. To show that (7.8) holds for for most other important shrinkage functions, some further work is needed – see Section 7.1 below.
We apply Lemma 5 to and on the set of probability 1 provided by Lemma 6. First, we rewrite (7.2) to show the subblocks of :
To rewrite the limit in block diagonal form, let be the permutation matrix corresponding to the permutation defined by
Permuting rows and columns in (7.1) and (7.10) using to obtain
we obtain (7.7). Using (7.6), the orthogonal invariance and sum/max decomposability, along with the continuity of , we have
In this section we prove Proposition 2 below, whereby the asymtotic losses coincide for a given estimator sequence and the rank-aware versions . This result is plausible because of two observations:
Null eigenvalues stick to the bulk, i.e. for , most eigenvalues and the few exceptions are not much larger. Hence, if is a continuous bulk shrinker, we expect to be close to ,
under a suitable continuity assumption on the loss functions , should then be close to .
where the are the eigenvalues of a white Wishart matrix .
The second step is a bound on eigenvalues of a white Wishart that exit the bulk. Before stating it, we return to an important detail introduced in the Remark concluding Section 1.1.
Definition 3 of a bulk shrinker depends on the parameter through . Making that dependence explicit, we obtain a bivariate function . In model [Asy()]and in the -th problem, we might use either with or . For Proposition 1 below, it will be more natural to use the latter choice. We also modify Definition 3 as follows.
We call a jointly continuous bulk shrinker if is jointly continuous in and , satisfies for and is dominated: for some and all .
The following result is proved in [58, Theorem 2(a)].
Let denote the sample eigenvalues of a matrix distributed as , with . Suppose that is a jointly continuous bulk shrinker and that . Then for ,
In the next proposition we adopt the convention that estimators of (1.7) and of (1.13) are constructed with a jointly continuous bulk shrinker, which we denote .
and so converges in probability to the deterministic asymptotic loss (7.8).
In the left side of (7.13), substitute and . By definition, and share the same eigenvectors. The components of then satisfy
We now use (7.11) to compare the eigenvalues of the spiked model to those of a suitable white Wishart matrix to which Proposition 1 applies. The function and is non-decreasing and jointly continuous. Hence , and so
with a corresponding bound for . From continuity condition (7.13),
2 Asymptotic loss for discontinuous optimal shrinkers
where has a two point distribution in which
For the proof, write for . Let be the orthogonal change of basis matrix constructed in Lemma 7, with containing the first columns. We treat the two losses and at once using an exponent , and write for . Thus, let
lies in the column span of . We have , and the main task will be to show that for ,
Assuming the truth of this for now, let us derive the proposition. The quantities of interest in (7.14), (7.15) become
The rescaled noise eigenvalue has a limiting real Tracy-Widom distribution with scale factor [60, Prop. 5.8]. Hence, using the discontinuity of the optimal shrinker , and the square root singularity from above
which leads to (7.15) and hence the main result.
It remains to prove (7.16). For a symmetric block matrix,
Apply this to with
We now show that . Using notation from Lemma 5,
Since for ,
From (7.18) we have . Since each is uniformly distributed on , a simple union bound based on (7.23) below yields
It remains to bound . From the interlacing inequality (7.11),
From (7.21) and the preceding two paragraphs, we conclude that and so .
Returning to (7.20), we deduce now that . From the definition of we have and hence the inequalities
Now observe that . Apply (7.19) to to get
and hence that . Thus . Inserting these results into (7.20), we obtain
which completes the proof of (7.16), and hence of Proposition 3. ∎
Finally, we record a concentration bound for the uniform distribution on spheres. While more sophisticated results are known , an elementary bound suffices for us.
If is uniformly distributed on and is fixed, then for and ,
Since has the distribution,
where by Gautschi’s inequality [62, 63, (5.6.4)]
Since for , and for ,
Optimality Among Equivariant Procedures
The notion of optimality in asymptotic loss, with which we have been concerned so far, is relatively weak. Also, the class of covariance estimators we have considered, namely procedures that apply the same univariate shrinker to all empirical eigenvalues, is fairly restricted.
Consider the much broader class of orthogonally-equivariant procedures for covariance estimation , in which estimates take the form . Here, is any diagonal matrix that depends on the empirical eigenvalues in possibly a more complex way than the simple scalar element-wise shrinkage we have considered so far. One might imagine that the extra freedom available with more general shrinkage rules would lead to improvements in loss, relative to our optimal scalar nonlinearity; certainly the proposals of are of this more general type.
The smallest achievable loss by any orthogonally equivariant procedure is obtained with the “oracle” procedure , where
the minimum being taken over diagonal matrices with diagonal entries . Clearly, this optimal performance is not attainable, since the minimization problem explicitly demands perfect knowledge of , precisely the object that we aim to recover. This knowledge is never available to us in practice – hence the label oracleThe oracle procedure does not attain zero loss since it is “doomed” to use the eigenbasis of the empirical covariance, which is a random basis corrupted by noise, to estimate the population covariance.. Nevertheless, this optimal performance is a legitimate benchmark.
where is the optimal shrinker for the losses or in Table 2.
In short, the shrinker , which has been designed to minimize the limiting loss, asymptotically delivers the same performance as the oracle procedure, which has the lowest possible loss, in finite-, over the entire class of covariance estimators by arbitrary high-dimensional shrinkage rules. On the other hand, by definition, the oracle procedure outperforms every orthogonally-equivariant statistical estimator. We conclude that – as one such orthogonally-invariant estimator – is indeed optimal (in the sense of having the lowest limiting loss) among all orthogonally invariant procedures. While we only discuss the cases and , we suspect that this theorem holds true for many of the 26 loss functions considered.
For both and , we establish a decomposition
Here, is a constant depending only on the loss function,
Together (8.6) and (8.7) establish the Theorem.
Turning to the details, we begin by showing (8.3). For Frobenius loss, we have from our definitions and (8.2) that
It remains to verify (8.6) and (8.7). Theorem 1 says that for ,
which yields (8.6). From (8.5), we observe that in our two cases
From the previous two displays, we conclude
which is (8.7), and so completes the full proof. ∎
Observe that for each of the loss families we consider, , where depends on the family alone. Hence
Again for each of the loss families we consider, almost surely,
We conclude that, using (9.2), any consistent sequence of estimators yields a sequence of shrinkers with the same asymptotic loss as the optimal shrinker for known . In other words, at least inasmuch as the asymptotic loss is concerned, under the spiked model, there is no penalty for not knowing .
Define, for a symmetric -by- positive definite matrix with eigenvalues the quantity
where is a median of and is the median of the Marčenko-Pastur distribution, namely, the unique solution in to the equation
where as before . Note that the median is not available analytically but can easily be obtained numerically, for example using remarks on the Marčenko-Pastur cumulative distribution function included in SI. Now for a sequence of sample covariance matrices, define the sequence of estimators
In summary, using (9.1) (for known) or (9.2) with (9.4) (for unknown) one can use the optimal shrinkers for each of the loss families discussed above, designed for the case , to construct a shrinker that is optimal, for the same loss family, under the spiked model with common variance .
Discussion
In this paper, we considered covariance estimation in high dimensions, where the dimension is comparable to the number of observations . We chose a fixed-rank principal subspace, and let the dimension of the problem grow large. A different asymptotic framework for covariance estimation would choose a principal subspace whose rank is a fixed fraction of the problem dimension; i.e. the rank of the principal subspace is growing rather than fixed. (In the sibling problem of matrix denoising, compare the “spiked” setup with the “fixed fraction” setup of .)
In the fixed fraction framework, some of underlying phenomena remain qualitatively similar to those governing the spiked model, while new effects appear. Importantly, the relationships used in this paper, predicting the location of the top empirical eigenvalues, as well as the displacement of empirical eigenvectors, in terms of the top theoretical eigenvalues, no longer hold. Instead, a complex nonlinear relation exists between the limiting distribution of the empirical eigenvalues and the limiting distribution of the theoretical eigenvalues, as expressed by the Marčenko-Pastur (MP) relation between their Stieltjes transforms .
Covariance shrinkage in the proportional rank model should then, naturally, make use of the so-called MP Equation. Noureddine El Karoui proposed a method for debiasing the empirical eigenvalues, namely, for estimating (in a certain specific sense) their corresponding population eigenvalues; Olivier Ledoit and Sandrine Peché developed analytic tools to also account for the inaccuracy of empirical eigenvectors, and Ledoit and Michael Wolf have implemented such tools and applied them in this setting.
The proportional rank case is indeed subtle and beautiful. Yet, the fixed-rank case deserves to be worked out carefully. In particular, the shrinkers we have obtained here in the fixed-rank case are extremely simple to implement, requiring just a few code lines in any scientific computing language. In comparison, the covariance estimation ideas of , based on powerful and deep insights from MP theory, require a delicate, nontrivial effort to implement in software, and call for expertise in numerical analysis and optimization. As a result, the simple shrinkage rules we propose here may be more likely to be applied correctly in practice, and to work as expected, even in relatively small sample sizes.
An analogy can be made to shrinkage in the normal means problem, for example . In that problem, often a full Bayesian model applies, and in principle a Bayesian shrinkage would provide an optimal result . Yet, in applications one often wants a simple method which is easy to implement correctly, and which is able to deliver much of the benefit of the full Bayesian approach. In literally thousands of cases, simple methods of shrinkage - such as thresholding - have been chosen over the full Bayesian method for precisely that reason.
Reproducible Research
In the code supplement we offer a Matlab software library that includes:
A function to compute the value of each of the 26 optimal shrinkers discussed to high precision.
A function to test the correctness of each of the 18 analytic shrinker fomulas provided.
Scripts that generate each of the figures in this paper, or subsets of them for specified loss functions.
Acknowledgements
We thank Amit Singer, Andrea Montanari, Sourav Chatterjee and Boaz Nadler for helpful discussions. We also thank the anonymous referees for significantly improving the manuscript through their helpful comments. This work was partially supported by NSF DMS-0906812 (ARRA). MG was partially supported by a William R. and Sara Hart Kimball Stanford Graduate Fellowship.
Proofs and Additional Results
In the supplementary material we provide proofs omitted from the main text for space considerations and auxiliary lemmas used in various proofs. Notably, we prove Lemma 4, and provide detailed derivations of the 17 explicit formulas for optimal shrinkers, as summarized in Table 2. In addition, in the supplementary material we offer a detailed study of the large- asymptotics (asymptotic slope and asymptotic shift) of the optimal shrinkers discovered in this paper, and tabulate the asymptotic behavior of each optimal shrinker. We also study the asymptotic percent improvement of the optimal shrinkers over naive hard thresholding of the sample covariance eigenvalues.