[GRASS-user] Calculating eigen values and % variance explained after PCA analysis
Dear Colleagues, I have run a PCA on a five band data set consisting of three optical bands, a canopy height model and lidar intensity measures. Output from the i.pca module only provides the eigen vectors. I would like to calculate the eigen values and % variance explained by each component in my PCA analysis. Is it possible to calculate the eigen values and % variance explained using GRASS or should I use something like R? I am using version 6.3 on ubuntu hardy heron. Many thanks for your help. Wesley Wesley Roberts MSc. Researcher: Earth Observation (Ecosystems) Natural Resources and the Environment CSIR Tel: +27 (21) 888-2490 Fax: +27 (21) 888-2693 To know the road ahead, ask those coming back. - Chinese proverb -- This message is subject to the CSIR's copyright terms and conditions, e-mail legal notice, and implemented Open Document Format (ODF) standard. The full disclaimer details can be found at http://www.csir.co.za/disclaimer.html. This message has been scanned for viruses and dangerous content by MailScanner, and is believed to be clean. MailScanner thanks Transtec Computers for their support. ___ grass-user mailing list grass-user@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/grass-user
Re: [GRASS-user] Calculating eigen values and % variance explained after PCA analysis
Wesley: Dear Colleagues, I have run a PCA on a five band data set consisting of three optical bands, a canopy height model and lidar intensity measures. Output from the i.pca module only provides the eigen vectors. I would like to calculate the eigen values and % variance explained by each component in my PCA analysis. Is it possible to calculate the eigen values and % variance explained using GRASS or should I use something like R? I am using version 6.3 on ubuntu hardy heron. Many thanks for your help. Wesley Wesley, some relevant posts of mine (...although you have probably seen them): ( in grass-user mailing list ) [1] # In these posts I didn't know much about PCA # http://n2.nabble.com/i.pca--vs.--r.covar-m.eigensystem-r.mapcalc-td1885820.html#a1885821 [2] http://n2.nabble.com/Comparison-between-i.pca-and-R's-prcomp()% 3A-explanations-and-questions-td2283997.html#a2284070 ( in grass-trac ) [3] http://trac.osgeo.org/grass/ticket/341 [4] http://trac.osgeo.org/grass/ticket/430 There is still m.eigensystem with which one can manually build Principal Components and get all values. But I am not sure how to compile it (anymore) and its more time-expensive than just load the data in R and within a second perform PCA. Kind regards, Nikos ___ grass-user mailing list grass-user@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/grass-user
Re: [GRASS-user] Calculating eigen values and % variance explained after PCA analysis
Nikos wrote: There is still m.eigensystem with which one can manually build Principal Components and get all values. But I am not sure how to compile it (anymore) works for me. cd grass-addons/misc/m.eigensystem make MODULE_TOPDIR=/usr/local/src/grass-svn/releasebranch_6_4 is f77 installed? Hamish ___ grass-user mailing list grass-user@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/grass-user
Re: [GRASS-user] Calculating eigen values and % variance explained after PCA analysis
Nikos: There is still m.eigensystem with which one can manually build Principal Components and get all values. But I am not sure how to compile it (anymore) Hamish: works for me. cd grass-addons/misc/m.eigensystem make MODULE_TOPDIR=/usr/local/src/grass-svn/releasebranch_6_4 is f77 installed? No! So... sudo apt-get install f2c fort77 and then make did the trick :-) Thanks Hamish ___ grass-user mailing list grass-user@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/grass-user
Re: [GRASS-user] Calculating eigen values and % variance explained after PCA analysis
Thanks Hamish, I see that I would need to upgrade to 6.4 using svn. I currently install using synaptic, does this mean I need to compile from source and then add the m.eigensystem addon? Not sure about f77, is this a fortran compiler? I have gfortran compiler version 4.2.3, will this do? Thanks Wesley Hamish hamis...@yahoo.com 02/25/09 2:07 PM Nikos wrote: There is still m.eigensystem with which one can manually build Principal Components and get all values. But I am not sure how to compile it (anymore) works for me. cd grass-addons/misc/m.eigensystem make MODULE_TOPDIR=/usr/local/src/grass-svn/releasebranch_6_4 is f77 installed? Hamish Hamish hamis...@yahoo.com 02/25/09 2:07 PM Nikos wrote: There is still m.eigensystem with which one can manually build Principal Components and get all values. But I am not sure how to compile it (anymore) works for me. cd grass-addons/misc/m.eigensystem make MODULE_TOPDIR=/usr/local/src/grass-svn/releasebranch_6_4 is f77 installed? Hamish -- This message is subject to the CSIR's copyright terms and conditions, e-mail legal notice, and implemented Open Document Format (ODF) standard. The full disclaimer details can be found at http://www.csir.co.za/disclaimer.html. This message has been scanned for viruses and dangerous content by MailScanner, and is believed to be clean. MailScanner thanks Transtec Computers for their support. ___ grass-user mailing list grass-user@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/grass-user
Re: [GRASS-user] Calculating eigen values and % variance explained after PCA analysis
Wesley: I see that I would need to upgrade to 6.4 using svn. I currently install using synaptic, does this mean I need to compile from source and then add the m.eigensystem addon? Not sure about f77, is this a fortran compiler? I have gfortran compiler version 4.2.3, will this do? (@Hamish: apologies for the interference :-p) Wesley, perhaps it's better to upgrade to 6.4 (or why not to grass6_devel = grass65 ?). grass needs to be compiled first (don't install), then compile m.eigensystem and install in the end grass. I don't know if gfortran will help you. But you can install fort77 and f2c under ubuntu: # from apt-cache search fort77 f2c - A FORTRAN 77 to C/C++ translator fort77 - Invoke f2c like a real compiler If you have success running m.eigensystem, can I please ask you to let the list (and me :-p) know about it? I compiled m.eigensystem without errors but it doesn't seem to work within from grass65. I am currently re-compiling grass6_devel to see whether it will work or not. Or do I need to work with grass6.4? Kind regards, Nikos ___ grass-user mailing list grass-user@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/grass-user
Re: [GRASS-user] Calculating eigen values and % variance explained after PCA analysis
On 25/02/09 14:33, Nikos Alexandris wrote: Wesley: I see that I would need to upgrade to 6.4 using svn. I currently install using synaptic, does this mean I need to compile from source and then add the m.eigensystem addon? Not sure about f77, is this a fortran compiler? I have gfortran compiler version 4.2.3, will this do? (@Hamish: apologies for the interference :-p) Wesley, perhaps it's better to upgrade to 6.4 (or why not to grass6_devel = grass65 ?). grass needs to be compiled first (don't install), then compile m.eigensystem and install in the end grass. I don't know whether this was already implemented in 6.3, but nowadays one does not need to the source code, nor compiling GRASS by oneself to be able to add add-ons. On Debian, you can just install the grass-dev package and then use something like: make MODULE_TOPDIR=/usr/lib/grass Moritz ___ grass-user mailing list grass-user@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/grass-user