[GRASS-stats] Re: [GRASS-user] Testing i.pca ~ prcomp(), m.eigensystem ~ princomp()

Nikos Alexandris nikos.alexandris at felis.uni-freiburg.de
Tue Mar 3 10:16:39 EST 2009


Nikos:
> Eigenvalue provided by i.pca. I can't nail this one:
> > *** how is it calculated? *** Looks like it is some _weighted_
> > variance... !??
> ....
> > Hamish, if you have the time (or anyone , could you please "translate"
> > the code in "grass6_dev/imagery/i.pca/main.c", concerning the "eigval"
> > variable, in some pseudocode. It is really the last thing to clarify ( I
> > think ).

Hamish:
> for i.pca they are calculated by the eigen() function in lib/gmath/eigen.c
> see also lib/gmath/eigen_tools.c  


I am trying to get a grip on eigen.c. The variables that refer to the
eigenvalues are symbolised as:

   double *lambda  OR  lambda

which is the

   double d[]  as defined  IN  G_tqli()  IN  eigen_tools.c

And then there is this "fabs" in the way :-) I suppose it returns the
absolute value of a signed number... It took me so long to figure this
simple thing out. Well, there are so many variables... it's
hard(=time-consuming) for the unexperienced eye to trace down the real
math.

As suggested by Markus, I will try to move this in the Wiki.
Apologies for the long posts again, Nikos



More information about the grass-stats mailing list