[R] weird behaviour of eigen()

Thomas Lumley tlumley at u.washington.edu
Sun Nov 9 17:13:37 CET 2003


On Sun, 9 Nov 2003, Karim Elsawy wrote:

> I'm using R 1.7.1 under linux redhat
> it seems that the eigen values produced by eigen() do not follow
> a consistant order; I mean either ascending or discending

This is strange, since the source code explicitly sorts them. Can you send
an actual example?

	-thomas

> e.g
>
> for one system:
> eigenV<-eigen(V)
> >                   print(eigenV$values)
>  [1] -7.706828e+13 -4.702980e+13 -3.267579e+13 -1.701297e+13
> -8.041677e+12
>  [6] -5.707311e+12 -5.053941e+12 -4.774652e+12 -4.280423e+12
> -3.798905e+12
> [11] -3.422172e+12 -3.148595e+12 -2.974540e+12 -2.881025e+12
> -2.730044e+12
> [16] -2.476652e+12 -2.216184e+12 -1.996965e+12 -1.852241e+12
> -1.419131e+12
> [21] -1.307872e+12 -1.248930e+12 -1.244060e+12 -1.092555e+12
> -1.069742e+12
> [26] -1.064907e+12 -1.007863e+12 -9.894342e+11 -9.459110e+11
> -8.017146e+11
> [31] -5.619008e+11 -5.443052e+11 -3.834215e+11 -7.530864e+10
> -2.820257e+10
> [36] -1.757125e+10 -5.503488e+09 -2.225226e+09 -1.106936e+09
> -1.035204e-05
>
> > -7.706828e+13 > -1.035204e-05
> [1] FALSE
>
> for anther system:
> eigenV<-eigen(V)
> > print(eigenV$values)
>  [1] -8.564110e-03 -1.486071e+08 -8.200752e+08 -2.033989e+09
> -3.166960e+09
>  [6] -9.511769e+09 -1.067173e+10 -1.207226e+10 -3.779904e+10
> -6.752452e+10
> [11] -1.717127e+11 -1.781890e+11 -1.887900e+11 -2.566200e+11
> -2.908604e+11
> [16] -4.027630e+11 -4.813731e+11 -5.072795e+11 -7.635460e+11
> -8.442470e+11
> [21] -8.938820e+11 -9.533737e+11 -1.038059e+12 -1.155368e+12
> -1.297694e+12
> [26] -1.502400e+12 -1.577757e+12 -1.748035e+12 -1.948777e+12
> -2.234958e+12
> [31] -2.586261e+12 -2.635164e+12 -2.705431e+12 -2.714573e+12
> -3.189646e+12
> [36] -3.313364e+12 -3.405791e+12 -4.951881e+12 -5.396912e+12
> -5.681758e+12
> [41] -5.964839e+12 -6.782151e+12 -7.234084e+12 -7.328940e+12
> -7.421814e+12
> [46] -8.129555e+12 -8.226702e+12 -9.268597e+12 -1.003589e+13
> -1.076822e+13
> [51] -1.136816e+13 -1.456318e+13 -1.903689e+13 -3.804764e+13
> -6.641937e+13
> [56] -1.547690e+14
>
> > -8.564110e-03 > -1.547690e+14
> [1] TRUE
>
> what worries me now is that whether the order of the eigen vectors
> follow the
> corresponding eigen values or not?????
> THIS IS OF PRIME IMPORTANCE.
>
> any help is very much appreciated
> best regards
> Karim
>
> ______________________________________________
> R-help at stat.math.ethz.ch mailing list
> https://www.stat.math.ethz.ch/mailman/listinfo/r-help
>

Thomas Lumley			Assoc. Professor, Biostatistics
tlumley at u.washington.edu	University of Washington, Seattle




More information about the R-help mailing list