[R] How to circumvent negative eigenvalues in the capscale function
Jari Oksanen
jarioksa at sun3.oulu.fi
Fri Dec 10 07:27:37 CET 2004
On Fri, 2004-12-10 at 06:11, Steve.Pawson at forestresearch.co.nz wrote:
>
> I am trying to do a partial canonical analysis of principal coordinates
> using Bray-Curtis distances. The capscale addin to R appears to be the only
> way of doing it, however, when I try and calculate a Bray-Curtis distance
> matrix either using Capscale or Vegedist (capscale I understand uses
> Vegedist anyway to calculate its distance matrix), R uses up all available
> memory on the computer, stops and then comes back with errors regarding
> negative eigenvalues.
>
The way to avoid negative eigenvalues is to use a ``positive
semidefinite'' dissimilarity matrix. This may sound cryptic. In simple
words: the underlying functions in capscale assume that your
dissimilarities are like (Euclidean) distances, meaning that the
shortest route between two points is a straight line, and you cannot
find a shorter route by going via a third point. This is possible with
Bray-Curtis index, and as its symptom, you get negative eigenvalues
(which are ignored in capscale, and only the dimensions with positive
eigenvalues are used). Were negative eigenvalues your problem, you could
avoid them by using another dissimilarity index with better metric
properties. Jaccard dissimilarity is rank-order similar to Bray-Curtis,
but it should be positive semidefinite.
However, I don't think think that negative eigenvalues and memory
problems are coupled. I guess that you simply have memory problems, and
negative eigenvalues are unrelated. So you need more memory or an
operating system with better memory handling. You may try with some
Linux live-cd (such as Quantian) where you can use R in Linux without
installing Linux in your hard drive.
cheers, jari oksanen
--
Jari Oksanen -- Dept Biology, Univ Oulu, 90014 Oulu, Finland
email jari.oksanen at oulu.fi, homepage http://cc.oulu.fi/~jarioksa/
More information about the R-help
mailing list