[R] Non-positive definite cross-covariance matrices

Jeff Bassett jbassett at cs.gmu.edu
Mon Nov 15 18:58:24 CET 2010


I am creating covariance matrices from sets of points, and I am having
frequent problems where I create matrices that are non-positive
definite.  I've started using the corpcor package, which was
specifically designed to address these types of problems.  It has
solved many of my problems, but I still have one left.

One of the matrices I need to calculate is a cross-covariance matrix.
In other words, I need to calculate cov(A, B), where A and B are each
a matrix defining a set of points.  The corpcor package does not seem
to be able to perform this operation.

Can anyone suggest a way to create cross-covariance matrices that are
guaranteed (or at least likely) to be positive definite, either using
corpcor or another package?

I'm using R 2.8.1 and corpcor 1.5.2 on Mac OS X 10.5.8.

- Jeff



More information about the R-help mailing list