Christoph Lehmann
2003-Jun-09 21:30 UTC
[R] understanding eigen(): getting non-normalized eigenvectors
Hi, dear R pros I try to understand eigen(). I have seen, that eigen() gives the eigenvectors normalized to unit length. What shall I do to get the eigenvectors not normalized to unit length? E.g. take the example: A [,1] [,2] V1 0.7714286 -0.2571429 V2 -0.4224490 0.1408163 Calculating eigen(A) "by hand" gives the eigenvectors (example from Backhaus, multivariate analysis): 0.77143 and 0.25714 -0.42245 0.14082 but even eigen(solve(Derror)%*%Dtreat, symmetric = FALSE, EISPACK =TRUE) which according to ?eigen should not necessarily give the normalized eigenvectors give the vectors (such as eigen()): $vectors [,1] [,2] [1,] 0.8770963 0.3162278 [2,] -0.4803146 0.9486833 -> how can I replicate the result we get "by hand" (I ask because for students it is "nice" to see the same results with R as the results written in textbooks, derived "manually"? Thanks a lot Christoph -- Christoph Lehmann <lehmann at puk.unibe.ch> University Hospital of Clinical Psychiatry
Prof Brian Ripley
2003-Jun-10 07:19 UTC
[R] understanding eigen(): getting non-normalized eigenvectors
Eigenvectors are defined only up to a scalar constant (assuming distinct eigenvalues). However, your `by hand' answer does not pass the simple test Av = lambda v for some lambda. So you cannot reproduce incorrect answers in R! Your example is unusual: A is of rank 1. On 9 Jun 2003, Christoph Lehmann wrote:> Hi, dear R pros > > I try to understand eigen(). I have seen, that eigen() gives the > eigenvectors normalized to unit length. > > What shall I do to get the eigenvectors not normalized to unit length?Multiply them by any randomly chosen non-zero scalar!> E.g. take the example: > > A > > [,1] [,2] > V1 0.7714286 -0.2571429 > V2 -0.4224490 0.1408163 > > Calculating eigen(A) "by hand" gives the eigenvectors (example from > Backhaus, multivariate analysis): > > 0.77143 and 0.25714 > -0.42245 0.14082The second is not an eigenvector of A: try it! They look like rounded versions of A with a sign error. -- Brian D. Ripley, ripley at stats.ox.ac.uk Professor of Applied Statistics, http://www.stats.ox.ac.uk/~ripley/ University of Oxford, Tel: +44 1865 272861 (self) 1 South Parks Road, +44 1865 272866 (PA) Oxford OX1 3TG, UK Fax: +44 1865 272595