Re: [R] eigenvalue ordering

2007-02-26 Thread Alberto Monteiro
Kaustubh Patil wrote:
 
  Is it possible to get unordered eigenvalues and eigenvectors of a 
 symmetric matrix in R?
 
Yes, see help(eigen).

If you are strict about the unordered part, do a sample(set, size)
to randomize the eigenvalues.

Alberto Monteiro

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] eigenvalue ordering

2007-02-26 Thread Peter Dalgaard
Alberto Monteiro wrote:
 Kaustubh Patil 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).
 If you are strict about the unordered part, do a sample(set, size)
 to randomize the eigenvalues.


__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] eigenvalue ordering

2007-02-26 Thread Alberto Monteiro

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

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.