Quantcast

find the eigenvector corresponding to the largest eigenvalue

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

find the eigenvector corresponding to the largest eigenvalue

Rebecca
Hi,
If I use the eigen() function to find the eigenvalues of a matrix, how can I find the eigenvector corresponding to the largest eigen value?
Thanks!
        [[alternative HTML version deleted]]

______________________________________________
[hidden email] 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.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: find the eigenvector corresponding to the largest eigenvalue

Berend Hasselman

On 27-04-2012, at 17:41, Rebecca wrote:

> Hi,
> If I use the eigen() function to find the eigenvalues of a matrix, how can I find the eigenvector corresponding to the largest eigen value?


What does the documentation of eigen() say in the Value section for values?

Sorted in decreasing order.
So the first item of ..$values is the largest eigenvalue and thus the first column of ..$vectors is the corresponding eigenvector.

Example

n <- 3
A  <- matrix(round(runif(n*n),2),nrow=n)
A
evv.A <- eigen(A)
evv.A

k <- which(abs(evv.A$values)==max(abs(evv.A$values)))
evv.A$vectors[,k]
k

Berend

______________________________________________
[hidden email] 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.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: find the eigenvector corresponding to the largest eigenvalue

David Winsemius
In reply to this post by Rebecca

On Apr 27, 2012, at 11:41 AM, Rebecca wrote:

> Hi,
> If I use the eigen() function to find the eigenvalues of a matrix,  
> how can I find the eigenvector corresponding to the largest eigen  
> value?

After reading the help page, I would have assumed that since the  
eigenvalues are sorted, that the eigenvectors would be sorted in the  
same order. Do you have reasons to doubt that they are not?

--

David Winsemius, MD
West Hartford, CT

______________________________________________
[hidden email] 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.
Loading...