[R] buggy eigen function
Chong Gu
chong at stat.purdue.edu
Tue Mar 21 20:42:57 CET 2000
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.
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
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
More information about the R-help
mailing list