[R] Howto get unnormalized eigenvectors?
Lucek, Kay
Kay.Lucek at eawag.ch
Fri Mar 19 11:25:30 CET 2010
Hi,
I try to calculate the angle between two first eigenvectors of different covariance matrices of biological phenotypic traits for different populations. My issue here is, that all possibilities to do so seem to normalize the eigenvectors to length 1. Although the helpfile of eigen() states, that using eigen(, symmetric = FALSE, EISPACK =TRUE) skips normalization this is (I guess) not applicable for me as my matrices are symmetric.
x<-eigen(cov(population1))$vectors[,1]
y<-eigen(cov(population2))$vectors[,1]
angle (in degree):
((acos((x%*%y)/(sqrt(x%*%y)*sqrt(y%*%y))))*180)/pi
Thus by using normalized vectors, the divisor becomes meaningless being 1.
Does anybody have an idea to get raw eigenvectors?
Thanks a lot
Kay Lucek
Aquatic Ecology & Macroevolution
University of Bern
Baltzerstr. 6
3012 Bern
Switzerland
More information about the R-help
mailing list