Principal Components

Anantha Prasad prasad at landcover.inhs.uiuc.edu
Mon May 10 11:36:50 EDT 1993


Hi. > Hello GRASS users:
> 
> I've seen a couple of messages about the principal components analysis commands
> i.pca and r.covar.
> 
> I used i.pca to create principal components of a LANDSAT image. The results I
> got using i.pca and m.eigensystem are different.
> 
> The eigenvalues are the same but the eigenvectors are different. Consequently
> when I use r.mapcalc to create the principal components I get different results.
> 
> The formula I used to create the PC after I ran m.eigensystem was:
> 
> 'pc1 = eigenvector*layer1 + (or -)eigenvector*layer2 ....'
> 
> For the eigenvalues there seems to be no problem but the calculation of the
> eigenvectors is different in i.pca and m.eigensystem.
> 
> Does someone know which of the commands is right? One of them must have a bug,> but which one?
> 
> I really need to make this principal components analysis and I don't h
> command I should use.
> 
> Thanks for any help.
> 
> Cristina Seabra
> 
> cis at fct.unl.pt

After you calculate the covariance matrix from r.covar and use m.eigensystem to get the eigenvectors and eigenvalues, the next step is to formulate the equation to get the actual maps using r.mapcalc. I have a feeling that the difference in i.pca and the above process may be due to the eigenvector you are using. In the GRass Reference manual they recommend that you use the N vector (eigenvectors normalized to 1) multiplied by the square root of the magnitude of the eigen value (E) - ie., the W lines. Are you using that? The other difference could be due to rescaling. So, first of all make sure that you are using the proper eigenvectors. Pl. let me know what you find...Good luck.

Prasad (prasad at landcover.igis.uiuc.edu)



More information about the grass-user mailing list