Skip to content

svd and eigen

4 messages · Stéphane Dray, Simon Wood, Peter Dalgaard

#
Hello List,
i need help for eigen and svd functions. I have a non-symmetric 
square matrix. These matrix is not positive (some eigenvalues are 
negative). I want to diagonalise these matrix. So, I use svd and 
eigen and i compare the results. eigen give me the "good" eigenvalues 
(positive and negative). I compare with another software and the 
results are the same. BUT, when i use svd, the results are completely 
different (no sign and not the same value). I thought that svd is a 
generalisation of eigen for non-square matrices but apparently, there 
are more differences ?
I 've R1.2.3 on W2000.

Thanks in advance.
#
The singular values of a matrix A are the +ve square roots of
the eigenvalues of A'A, or AA' (depending on the shape of A), where A' is
transpose of A. e.g....
[1] 1.6157235 0.9652578
[1] 1.6157235 0.9652578

Simon
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-help-request at stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
#
Yes, of course ... but :
[1] 1.17069725 1.01156192 0.90637068 0.81183730 0.75508662 
0.57540484 0.53941772 0.51359072 0.49338327 0.45236340
[11] 0.42074523 0.40355803 0.37502763 0.36161939 0.31022290 
0.30024633 0.27126673 0.25990555 0.19974930 0.18071039
[21] 0.14214615 0.13599764 0.09270370 0.06966780 0.04571913
[1]  1.00000000  0.89480696  0.79123824  0.69792179 -0.63442305 
-0.55072855 -0.52263267  0.50820449 -0.50552311
[10] -0.45431956 -0.40717371  0.37976933 -0.36275320  0.34892256 
-0.34126875 -0.31841576 -0.30411335  0.27663288
[19] -0.22103895 -0.19623454 -0.14990290  0.14228531 -0.10127212 
0.08101399 -0.05099532
#
Stephane Dray <dray at biomserv.univ-lyon1.fr> writes:
You're under the mistaken impression that the eigenvalues of A'A have
anything to do with those of A:

A <- matrix(rnorm(9),3)
eigen(t(A)%*%A)$values
abs(eigen(A)$values)^2

# it only works when A is symmetric:
A <- A+t(A)
eigen(t(A)%*%A)$values
eigen(A)$values
eigen(A)$values^2