[R] buggy eigen function
Thomas Lumley
thomas at biostat.washington.edu
Tue Mar 21 21:43:21 CET 2000
On Tue, 21 Mar 2000, Chong Gu wrote:
>
> It was a real surprise, but a student in my class found that the
> function eigen is buggy. He traced to the problem from his inability
> of getting principal component analysis to work on his data.
I can't reproduce this problem. I've tried on Linux and on AIX (which I
believe is your system) and I get
> jj
[,1] [,2] [,3]
[1,] 0.8288469 -1.269783 -0.7533517
[2,] -1.2697830 2.162132 2.0262920
[3,] -0.7533517 2.026292 4.1927134
> eigen(jj)
$values
[1] 5.795187e+00 1.388505e+00 -2.006855e-07
$vectors
[,1] [,2] [,3]
[1,] -0.3417893 0.4739218 -0.7067794
[2,] 0.7093264 -0.4978512 -0.5411749
[3,] 1.0576086 0.4870615 0.1345488
which looks right to me.
There may be a problem with your BLAS system or something. What OS and
compilers are you using?
-thomas
Thomas Lumley
Assistant Professor, Biostatistics
University of Washington, Seattle
>
> Chong Gu
>
>
> Here is a matrix I generated through X'X, where X is 2x3.
>
> > jj
> [,1] [,2] [,3]
> [1,] 0.8288469 -1.269783 -0.7533517
> [2,] -1.2697829 2.162132 2.0262917
> [3,] -0.7533517 2.026292 4.1927134
>
>
> Here are the 0.90.1 eigen results.
>
> > eigen(jj)
> $values
> [1] 3.06206547 0.20492432 -0.04955518
>
> $vectors
> [,1] [,2] [,3]
> [1,] -0.2316032 0.05778620 0.06998513
> [2,] 0.4932735 -0.04951172 0.06919350
> [3,] 0.8489300 0.06527175 -0.01966568
>
>
> Here are the 1.0.0 eigen results.
>
> > eigen(jj)
> $values
> [1] 2.765885782 0.008839573 -0.122630879
>
> $vectors
> [,1] [,2] [,3]
> [1,] -0.2236327 0.6670340 0.7106715
> [2,] 0.4693452 -0.5653355 0.6783147
> [3,] 0.8542268 0.4852437 -0.1866417
> -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
> r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
> Send "info", "help", or "[un]subscribe"
> (in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch
> _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
>
Thomas Lumley
Assistant Professor, Biostatistics
University of Washington, Seattle
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
More information about the R-help
mailing list