[R] eigenvalue ordering

Alberto Monteiro albmont at centroin.com.br
Mon Feb 26 20:33:31 CET 2007


Peter Dalgaard wrote:
>
>>>  Is it possible to get unordered eigenvalues and eigenvectors of a 
>>> symmetric matrix in R?
>>
>> Yes, see help("eigen").
>   
> Er, where do you see anything about (un)order? As far as I know, 
> there's no "natural" ordering of eigenvalues and eigenvalue 
> algorithms generally find them  in  either increasing or decreasing 
> order (or closest to specified value).
>
"eigen" orders the values. From help("eigen"):

  values: a vector containing the p eigenvalues of 'x', sorted in
          _decreasing_ order, according to 'Mod(values)' in the
          asymmetric case when they might be complex (even for real
          matrices).  For real asymmetric matrices the vector will be
          complex only if complex conjugate pairs of eigenvalues are
          detected. 

So, if you are strict about getting unordered eigenvalues,
you must shuffle them :-)

Alberto Monteiro



More information about the R-help mailing list