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

Nikos Alexandris nikos.alexandris at felis.uni-freiburg.de
Tue Mar 31 01:01:49 EDT 2009

> > > Good, thanks. There you say that you are using "some MODIS surface 
> > > reflectance products". I guess it will be easier to check things if the 
> > > data (GRASS location) are available, so that others can try the same 
> > > calculations. Would it be possible to make one or more test sets 
> > > available, and link them from thw Wiki?

> Finally,
> I am, sort of, free again :-).

Sorry for being late. Couldn't make it earlier. I've updated the
wiki-page [1].

> I have prepaired a grass-location
> containing the 3 modis bands I've used for all PCA related examples. I
> will eventually upload them in gregis [check previous post] but if there is another place
> (GRASS-wiki?) to upload them would be also ok.

I have currently some access problem in gregis this why I can't upload
the MODIS bands there. Is there any other place to put them for now?

Now, I am more confused than before. Or maybe not...

There seems to be no problem with the SPOT images, that is, the results
of i.pca are (almost) identical with the results of R's prcomp(x,
center=TRUE) *with* centering. This is completely different than with
the example using MODIS data. 

Perhaps it depends on the range of the input data?! The SPOT bands are
up to max. 255. The MODIS bands are:

# band 2
r.info -r mod_b2


# band 6
r.info -r mod_b6


# band 7
r.info -r mod_b7


I ran the same PCA tests (in R) with the _rescaled_ as like with the
"original" MODIS bands (using r.rescale) but no luck, I get the same
contradictory results: _i.pca_ matches with _prcomp(x, center=FALSE)_.

I suspect that the range of the input data is the reason... but I am not
sure.  This is why I tried to repeat the test with _rescaled_ MODIS
bands. Given that the "r.rescale" products are kind of a "rules" file
under the "cats" directory, is "r.rescale" safe? Should I instead
rescale the data with r.mapcalc or is there no difference between
r.rescale and r.mapcalc? 

All explained in the *under construction* wiki. Kind regards, Nikos

[1] http://grass.osgeo.org/wiki/Principal_Component_Analysis

More information about the grass-user mailing list