[GRASS-user] Inverse PCA in GRASS

Hamish hamish_nospam at yahoo.com
Tue Dec 11 05:05:16 EST 2007


Michael Perdue wrote:
> I think what your asking is if anyone knows how to apply the  
> transformation matrix that was used to derive you pca components in  
> reverse to get back to the original coordinate system. Something like  
> what is done in a decorrelation stretch?
> Hopefully someone more knowledgeable than I can elaborate, but the  
> general idea is as follows;
> 
> if the i.pca is capable of divulging the eigenvectors, you can use  
> r.mapcalc to apply them in reverse. else;
> 
> r.covar -> m.eigensystem -> mapcalc -> "do something with your  
> principal components" -> mapcalc (inverse rotation) -> "original  
> coordinate system"
> 
> You can take a look at the bottom of the r.covar page for more info.  
> The big "if" is on the status of m.eigensystem. I tried the link to  
> the manual page and it is broken so I'm unsure of it's status.


m.eigensystem has not been ported from GRASS 5 to GRASS 6.

It is available from the GRASS 5 source code:
  grass-5.4.0/src.contrib/CERL/misc/m.eigensystem/

online:
  http://freegis.org/cgi-bin/viewcvs.cgi/grass/src.contrib/CERL/misc/m.eigensystem/


While it is written in Fortan77 I see no reason why it couldn't be
compiled with g77 or gfortran and run with modern versions of GRASS.
The GRASS raster/imagery engines and file formats have not changed since
GRASS 5 so there shouldn't be many problems.

FWIW ./configure still checks for f2c.h


Hamish


More information about the grass-user mailing list