Principal Component Analysis.

Agustin Lobo lobo at Jasper.Stanford.EDU
Mon May 10 09:34:10 EDT 1993


> From grass-lists-owner at max.cecer.army.mil Mon May 10 05:03:35 1993
> Sender: lists-owner at max.cecer.army.mil
> Reply-To: grassu-list at max.cecer.army.mil
> To: grassu-list at max.cecer.army.mil
> Cc: cis at lua.fct.unl.pt
> Subject: Principal Component Analysis.
> Date: Mon, 10 May 93 12:49:41 +0100
> From: cis at lua.fct.unl.pt (Cristina Isabel Seabra [Ambiente])
> Content-Length: 920
> 
> 
> 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 know which
> command I should use.
> 
> Thanks for any help.
> 
> Cristina Seabra
> 
> cis at fct.unl.pt
> 

You have to use m.eigensystem, r.mapcalc and (eventually, if you need to get your values between 0 - 255) r.rescale. Check with r.covar -r that the correlations are 0 (or close to, because integer representations). Also, contrary to the manual, I think is more common  to use the eigenvectors normalized to norm 1. Refer to the discussion in the list last month.
Agus.



More information about the grass-user mailing list