[Rd] eigen anomaly

Patrick Burns pburns at pburns.seanet.com
Mon Dec 1 15:33:56 MET 2003


This is undoubtedly a bug, but I doubt that it is really down to R.

Synopsis: a certain matrix causes eigen(symmetric=TRUE)
to produce NaN's in some of the returned eigenvectors.
This happens using SuSe 8.2 Professional and the precompiled
R rpm (happens in both 1.8.1 and 1.7.1).  I don't see it under
Windows.

To reproduce the bug:
The matrix (75 by 75, about 45K) is in
http://www.burns-stat.com/pages/Flotsam/eigenbugmatrix.RData

Load that into R.

sum(is.na(eigen(eigenbugmatrix, symmetric=TRUE)$vectors))

is non-zero (600 in my experience) when the bug is exhibited and
is zero when the bug is not.

It is quite sensitive to the numbers.  The bug is still there with some
scaling of the matrix (from about divide by 2 to multiply by 8).  The
bug disappears if the matrix is dumped and sourced back in again.

The only clue that I can offer is that it is vectors 43:50 (I think) that
are NaN's and the matrix is logically of rank 50.  That is, it is a
covariance matrix on 75 variables using 50 observations.

Hopefully, someone has the experience and tenacity to figure out
what is going on here.


Patrick Burns

Burns Statistics
patrick at burns-stat.com
+44 (0)20 8525 0696
http://www.burns-stat.com
(home of S Poetry and "A Guide for the Unwilling S User")



More information about the R-devel mailing list