[Rd] function 'eigen' (PR#8503)

From: <Pierre.Legendre_at_umontreal.ca>
Date: Wed 18 Jan 2006 - 22:25:59 GMT


Full_Name: Pierre Legendre
Version: 2.1.1
OS: Mac OSX 10.4.3
Submission from: (NULL) (132.204.120.81)

I am reporting the mis-behaviour of the function 'eigen' in 'base', for the following input matrix:

A <- matrix(c(2,3,4,-1,3,1,1,-2,0),3,3)
eigen(A)

I obtain the following results, which are incorrect for eigenvalues and eigenvectors 2 and 3 (incorrect imaginary portions): $values
[1] 3+0.000000e+00i 1+1.869518e-08i 1-1.869518e-08i

$vectors

              [,1]                       [,2]                       [,3]

[1,] -0.5345225+0i 4.720910e-17+2.643897e-09i 4.720910e-17-2.643897e-09i
[2,] -0.2672612+0i 7.071068e-01+0.000000e+00i 7.071068e-01+0.000000e+00i
[3,] -0.8017837+0i 7.071068e-01-2.643897e-09i 7.071068e-01+2.643897e-09i

The eigenvalues of matrix A are 3, 1, and 1. The eigenvectors are real (not complex). Eigenvectors 2 and 3 of matrix A are identical.

With R version 2.2.1 on a PC, 'eigen' produces the following (correct) results: Results obtained on a PC (WIndows) using R version 2.2.1:

eigen(A)
$values
[1] 3 1 1

$vectors

           [,1] [,2] [,3]
[1,] -0.5345225 -3.563430e-09 -3.563431e-09
[2,] -0.2672612 -7.071068e-01 7.071068e-01
[3,] -0.8017837 -7.071068e-01 7.071068e-01

I obtained the following results using R version 2.2.1 on a PowerMac G5 under Mac OSX 10.4.4:

eigen(A)
$values
[1] 3+0i 1+0i 1-0i # OK results, although there is no need to show the
imaginary portion which is 0

$vectors

              [,1]                       [,2]                       [,3]

[1,] -0.5345225+0i 4.720910e-17+2.643897e-09i 4.720910e-17-2.643897e-09i
[2,] -0.2672612+0i 7.071068e-01+0.000000e+00i 7.071068e-01+0.000000e+00i
[3,] -0.8017837+0i 7.071068e-01-2.643897e-09i 7.071068e-01+2.643897e-09i

Incorrect imaginary portions, again, in eigenvectors 2 and 3.



R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel Received on Thu Jan 19 09:34:28 2006

This archive was generated by hypermail 2.1.8 : Mon 20 Feb 2006 - 03:21:39 GMT