Repairing Non-Positive-Definite Covariance Matrices for Portfolio Optimization
Summary
The document discusses how to make a sample covariance matrix positive definite when small negative eigenvalues appear, especially before inverting it for portfolio calculations. It compares replacing negative eigenvalues with zero or a small positive value, nearest-correlation-matrix optimization, geometric methods, and rank-correlation approaches. Because covariance matrices can be rescaled to correlation form and back, correlation-matrix repair methods can also be relevant.
The responses emphasize choosing a repair method for the intended use rather than seeking a universally best mathematical adjustment. Suggested alternatives include shrinkage estimators such as Ledoit–Wolf and factor models when the number of assets is large relative to the observations. The discussion also recommends checking candidate methods on historical data and ensuring the repaired matrix gives optimizers strictly positive risk. The source provides methodological references and practitioner guidance, but no head-to-head results or empirical evaluation for the specific S&P 500 sample. The preferred method therefore depends on the data problem and portfolio constraints.
Key ideas
- Small negative covariance eigenvalues can make matrix inversion and portfolio optimization unstable or invalid.
- Eigenvalue clipping is simple, but may alter the matrix trace and discard information about the spectrum.
- Nearest-correlation optimization and geometric repair methods offer alternatives to direct eigenvalue clipping.
- Shrinkage or factor models may be appropriate when there are many assets relative to observations.
- Compare candidate repairs using historical data and the needs of the intended portfolio application.
Tags
Full text
# What is the best way to "fix" a covariance matrix that is not positive semi-definite? # What is the best way to "fix" a covariance matrix that is not positive semi-definite? I have a sample covariance matrix of S&P 500 security returns where the smallest k-th eigenvalues are negative and quite small (reflecting noise and some high correlations in the matrix). I am performing some operations on the covariance matrix and this matrix must be positive definite. What is the best way to "fix" the covariance matrix? (For what it's worth, I intend to take the inverse of the covariance matrix.) One approach proposed by Rebonato (1999) is to decompose the covariance matrix into its eigenvectors and eigenvalues, set the negative eigenvalues to 0 or (0+epsilon), and then rebuild the covariance matrix. The issue I have with this method is that: - the trace of the original matrix is not preserved, and - the method ignores the idea of level repulsion in random matrices (i.e. that eigenvalues are not close to each other). Higham (2001) uses an optimization procedure to find the nearest correlation matrix that is positive semi-definite. Grubisic and Pietersz (2003) have a geometric method they claim outperforms the Higham technique. Incidentally, some more recent twists on Rebonato's paper are Kercheval (2009) and Rapisardo (2006) who build off of Rebonato with a geometric approach. A critical point is that the resulting matrix may not be singular (which can be the case when using optimization methods). What is the best way to transform a covariance matrix into a positive definite covariance matrix? UPDATE: Perhaps another angle of attack is to test whether a security is linearly dependent on a combination of securities and removing the offender. ## Answer by Brian B (score 23, accepted) https://quant.stackexchange.com/a/2077 Nick Higham's specialty is algorithms to find the nearest correlation matrix. His older work involved increased performance (in order-of-convergence terms) of techniques that successively projected a nearly-positive-semi-definite matrix onto the positive semidefinite space. Perhaps even more interesting, from the practitioner point of view, is his extension to the case of correlation matrices with factor model structures. The best place to look for this work is probably the PhD thesis paper by his doctoral student Ruediger Borsdorf. Higham's blog entry covers his work up to 2013 pretty well. ## Answer by Samik R (score 8) https://quant.stackexchange.com/a/2096 In Oracle Crystal Ball, we use an old algorithm, that works pretty well and converges fast. It is from Iman-Conovar. Here is the reference: Iman, R.L., Conover, W.J. 1982. A distribution-free approach to inducing rank correlation among input variables. Commun. Statist.-Simula. Computa. 11, 311-334. That said, Prof. Higham's method based on optimization works pretty good as well. He seems to have updated methods that were originally presented by Lurie and Goldberg, available at this link. ## Answer by Patrick Burns (score 7) https://quant.stackexchange.com/a/2075 The short answer is that I don't know, but your question gives some hints about how to find out. The key thing for me is that you want a minimum variance portfolio. I don't think you should be thinking about some abstract mathematical operation that is "best", but rather look over a few mathematical operations and see which seems to work best for your application. If you can approximate the problem you have now with data in the past, then you can test different methods over time. Some observations: - if you have a long-only portfolio, then that already helps you out a lot. - If you have lots of assets relative to time points, then it is harder: you want to use (if possible) Ledoit-Wolf shrinkage or a factor model to estimate the variance matrix. - You don't want the optimizer to see any portfolios that have zero (or negative) risk. That is the finance version of positive eigenvalues -- you want your epsilon to be non-trivial. - You don't say why you start out with a non-positive definite matrix. If it is because of missing values and you have the original returns, then there is code to do Ledoit-Wolf shrinkage in such a case. ## Answer by user6430 (score 2) https://quant.stackexchange.com/a/10734 Here it is: "Rebonato, R., Jackel, P. The most general methodology to create a valid correlation matrix for risk management and option pricing purposes." Recall: a covariance matrix will be the same as a correlation matrix if scale is removed. I used this method for ensuring positive definite correlations matrices.
Shown in full with attribution under the source's licence. Licence: CC BY-SA 4.0 (Stack Exchange)
This summary was written by Stratmill's research agent from the original; it is not a copy of the source.