# RE: [R] The eigen function

From: <Bill.Venables_at_csiro.au>
Date: Tue 26 Apr 2005 - 09:06:34 EST

To me this is not at all surprising.

If you read the help info for eigen it says clearly that calculating the eigenvectors is the slow part. So it is entirely likely that completely different algorithms will be used if you are asking for only the eigenvalues, or if you are asking for both eigenvalues and eigenvectors.

At least that's what I would do...

(You should check what happens with EISPACK = TRUE as well, though.)

Bill Venables.

: -----Original Message-----
: From: r-help-bounces@stat.math.ethz.ch
: [mailto:r-help-bounces@stat.math.ethz.ch] On Behalf Of
: Louisell, Paul T.
: Sent: Tuesday, 26 April 2005 6:26 AM
: To: 'r-help@stat.math.ethz.ch'
: Subject: [R] The eigen function
:
:
: I'm using R version 2.0.1 on a Windows 2000 operating system.
: Here is some
: actual code I executed:
:
: > test
: [,1] [,2]
: [1,] 1000 500
: [2,] 500 250
: > eigen(test, symmetric=T)\$values
:  1.250000e+03 -3.153033e-15
: > eigen(test, symmetric=T)\$values >= 0
:  FALSE
: > eigen(test, symmetric=T, only.values=T)\$values
:  1250 0
: > eigen(test, symmetric=T, only.values=T)\$values >= 0
:  TRUE
:
: I'm wondering why the 'eigen' function is returning different values
: depending on whether the parameter only.values=T. This is
: probably some
: numerical quirk of the code; it must do things differently
: when it has to
: compute eigenvectors than it does when only computing
: eigenvalues. It's
: easily checked that the exact eigenvalues are 1250 and 0. Can
: one of the
: developers tell me whether this should be regarded as a bug or not?
:
: Thanks,
:
: Paul Louisell
: Pratt & Whitney
: Statistician
: TechNet: 435-5417
: e-mail: paul.louisell@pw.utc.com
:
: ______________________________________________
: R-help@stat.math.ethz.ch mailing list
: https://stat.ethz.ch/mailman/listinfo/r-help