Re: [R] positive semi-definite matrix

From: Ravi Varadhan <rvaradhan_at_jhmi.edu>
Date: Sat 22 Jul 2006 - 01:33:23 EST


There is a paper by N.J. Higham (SIAM J Matrix Anal, 1998) on a modified cholesky decomposition of symmetric and not necessarily positive definite matrix (say, A), with an important goal of producing a "small-normed" perturbation of A (say, delA), that makes (A + delA) positive definite. http://epubs.siam.org/sam-bin/dbq/article/30289

There is also an algorithm in Gill, Murray and Wright's text - Practical Optimization (section 4.4.2).

These may be relevant to your problem. I am not sure if these algorithms have been implemented in R, for example, in the "matrix" library.

Ravi.



Ravi Varadhan, Ph.D.
Assistant Professor, The Center on Aging and Health Division of Geriatric Medicine and Gerontology Johns Hopkins University
Ph: (410) 502-2619
Fax: (410) 614-9625
Email: rvaradhan@jhmi.edu
Webpage: http://www.jhsph.edu/agingandhealth/People/Faculty/Varadhan.html

> -----Original Message-----
> From: r-help-bounces@stat.math.ethz.ch [mailto:r-help-
> bounces@stat.math.ethz.ch] On Behalf Of Duncan Murdoch
> Sent: Friday, July 21, 2006 9:45 AM
> To: roger bos
> Cc: RHelp
> Subject: Re: [R] positive semi-definite matrix
>
> On 7/21/2006 8:59 AM, roger bos wrote:
> > I have a covariance matrix that is not positive semi-definite matrix and
> I
> > need it to be via some sort of adjustment. Is there any R routine or

> > package to help me do this?
>
> I think you need to be more specific about what have and what you want,
> but if the matrix is symmetric and nearly positive semi-definite (but
> not exactly because of rounding error), you might try something like
>
> fixit <- function(A) {
> eig <- eigen(A, symmetric = TRUE)
> eig$values <- pmax(0, eig$values)
> return(eig$vectors %*% diag(eig$values) %*% t(eig$vectors))
> }
>
> Rounding error means this is not guaranteed to be positive
> semi-definite, but it will be very close.
>
> Duncan Murdoch
>
> ______________________________________________
> R-help@stat.math.ethz.ch 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.



R-help@stat.math.ethz.ch 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. Received on Sat Jul 22 01:44:11 2006

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.1.8, at Sat 22 Jul 2006 - 04:15:58 EST.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.