Dear Splus-users,
I tried to use eigen() to calculate eigen values for a symetric matrix,
and came across the following:
is.matrix(mat)
[1] T
dim(mat)
[1] 252 252
summary(mat)
Min. 1st Qu. Median Mean 3rd Qu. Max.
-0.25 -0.25 -0.25 0.00154 0.75 0.75
eigen(mat)$value
[1] NA NA NA NA 6.795e+001
1.612e-014 2.572e-016 ... ...
These NA's are wrong. But eigen.Matrix gives the
correct answer:
Re(eigen.Matrix(mat)$value) # imaginary part is very small
[1] 6.300e+001 6.795e+001 5.805e+001 2.654e-016 2.654e-016
1.900e-015 ...
I am using Splus 2000 on NT. I tried on unix (Splus 3.4) and it has no
problem, either.
Can someone please tell me what happened to these NAs? Is there any
way to go around(in this example, those NAs are 0's indeed)?
Great thanks,
Chunlei Ke
_________________________________________________________________
Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp.
|