Dimitri Liakhovitski
2011-Jan-29 04:32 UTC
[R] Regularization of a matrix that has some tiny negative eigenvalues
Dear all: In what I am doing I sometimes get a (Hessian) matrix that has a couple of tiny negative eigenvalues (e.g. -6 * 10^-17). So, I can't run a Cholesky decomp on it - but I need to. Is there an established way to regularize my (Hessian) matrix (e.g., via some transformation) that would allow me to get a semi-positive definite matrix to be used in Cholesky decomp? Or should I try some other decomp method on the back end that is less sensitive than Cholesky? Dimitri
Kjetil Halvorsen
2011-Jan-31 18:15 UTC
[R] Regularization of a matrix that has some tiny negative eigenvalues
The Matrix package (which should already be insatlled on your computer, since it is "Recommended") have the function nearPD, which should do the job. Kjetil On Sat, Jan 29, 2011 at 1:32 AM, Dimitri Liakhovitski <dimitri.liakhovitski at gmail.com> wrote:> Dear all: > > In what I am doing I sometimes get a (Hessian) matrix that has a > couple of tiny negative eigenvalues (e.g. -6 * 10^-17). So, I can't > run a Cholesky decomp on it - but I need to. > Is there an established way to regularize my (Hessian) matrix (e.g., > via some transformation) that would allow me to get a semi-positive > definite matrix to be used in Cholesky decomp? > > Or should I try some other decomp method on the back end that is less > sensitive than Cholesky? > Dimitri > > ______________________________________________ > R-help at r-project.org mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide http://www.R-project.org/posting-guide.html > and provide commented, minimal, self-contained, reproducible code. >
Maybe Matching Threads
- Unexplained difference between results of dppsv and dpotri LAPACK routines
- Need Advice on Matrix Not Positive Semi-Definite with cholesky decomposition
- simulate data based on partial correlation matrix
- package check fail on Windows-release only?
- predicting with stl() decomposition