[GRASS-stats] Re: [GRASS-user] Testing i.pca (continued...)

Nikos Alexandris nikos.alexandris at felis.uni-freiburg.de
Wed Apr 29 18:23:38 EDT 2009


Nikos:
> >>   I tested... tested... & tested... (almost all tests below) and I just
> >> can't understand WHY i.pca does NOT perform data centering when using
> >> MODIS data (raw, rescaled at 0~255 or 0~254).
> >
> > The attached html file (exported from Tomboy note-taker) is (I suppose)
> > easier to read :-)


Roger:
> Not easier to read, please simply post things on a website!
Hmmm!!? I thought opening this html file in a web-browser will look just
fine. Sorry.


> In your previous mail which you deleted here, you asked whether the code 
> of i.pca shows if the input data is centred. Yes, it is centred, the 
> function calc_mu(), as its name suggests, does this. The mean values are 
> then passed to the function calculating the covariance matrix: 
> calc_covariance(), where the means are subtracted from the input values of 
> bands before accumulating the covariance matrix.

Good. That's data centering.


> Is is possible that where 
> you do not see any effect of center=TRUE in prcomp that the means are all 
> zero? 

Sure, when I _manually_ center the data using r.mapcalc.

But what happens with the untouched modis bands [1] and i.pca delivers
different numbers is what makes no sense to me. BTW, the data are
available (the same as with the previous problem concerning the NULLs).


> You will find reading imagery/i.pca/main.c interesting and not hard.

:-). I tried once but there are many programming variables which do not
make sense on first sight. And this takes time... :-p

Is there any explanation why i.pca on mod_b2, mod_b6 and mod_b7 gives
the same results as prcomp(mod_b267, center=FALSE, scale=FALSE) when
their mean is _!=0_ ?

Thanks, Nikos
---

[1] r.univar of

# mod_b2
n: 88185
minimum: 0
maximum: 5504
range: 5504
mean: 2686.22
mean of absolute values: 2686.22
standard deviation: 535.612
variance: 286880
variation coefficient: 19.9392 %
sum: 236884367

# mod_b6
n: 88202
minimum: 93
maximum: 5488
range: 5395
mean: 2702.4
mean of absolute values: 2702.4
standard deviation: 645.377
variance: 416511
variation coefficient: 23.8816 %
sum: 238356766

# mod_b7
n: 88148
minimum: 0
maximum: 4133
range: 4133
mean: 1740.07
mean of absolute values: 1740.07
standard deviation: 536.718
variance: 288067
variation coefficient: 30.8447 %
sum: 153383351



More information about the grass-user mailing list