[GRASS-user] Calculating eigen values and % varianceexplainedafter PCA analysis

Hamish hamish_b at yahoo.com
Sun Mar 1 07:49:19 EST 2009

>    * Present first the variance (=eigenvalues) because it's the first
> thing you will look at to know "how much variance of
> the original data is _expressed_ in each new component.
>    * The importance, since it refers to the eigenvalue,
> it's better to come right after it.

to me it picks your eye more quickly if it is not buried in the middle.
shrug. the important thing is that the numbers are correct & not confusing.

>    * Present the loadings (eigenvectors) for each new
> component.

we are doing that already, right?

>    * Column-wise or row-wise? The results can be either
> presented column-wise, that is one column for each new component 
> _or_  row-wise, as they are currently printed. I think row-wise just
> looks better :-)

maybe, but row-wise is slightly easier to code.

> "Some" examples... (only 2 for column-wise and
> all the rest row-wise... playing around).

fancy tables are hard for the module output because it uses G_message()
and G_message() condenses any whitespace (multiple spaces, tabs,..) to a
single space. thus formatting is lost.

and i.pca's main output is maps, not eigen data so I guess it makes sense
to keep that text optional instead of sending to stdout. Perhaps a New flag to print summary report to stdout? (mmph, just cut&paste from history)

for map history it's a bit better, but I can't end with a %.

now 'r.info -h' output looks like:

   Eigen values, (vectors), and [percent importance]:
   PC1   1170.12 ( -0.63 -0.65 -0.43 ) [ 88.07% ]
   PC2    152.49 (  0.23  0.37 -0.90 ) [ 11.48% ]
   PC3      6.01 (  0.75 -0.66 -0.08 ) [  0.45% ]

module output is same but not as pretty due to G_message() issue.



More information about the grass-user mailing list