m.eigensystem(1)	      Grass User's Manual	      m.eigensystem(1)



NNAAMMEE
       mm..eeiiggeennssyysstteemm   -  Computes  eigen  values and eigen vectors for square
       matricies.
       _(_G_R_A_S_S _D_a_t_a _I_m_p_o_r_t_/_P_r_o_c_e_s_s_i_n_g _P_r_o_g_r_a_m_)

SSYYNNOOPPSSIISS
       mm..eeiiggeennssyysstteemm << _i_n_p_u_t_f_i_l_e

DDEESSCCRRIIPPTTIIOONN
       _m_._e_i_g_e_n_s_y_s_t_e_m determines the eigen values and eigen vectors for	square
       matricies.   The  _i_n_p_u_t_f_i_l_e  must  have the following format: the first
       line contains an integer K which is the number of rows and  columns  in
       the  matrix;  the  remainder  of the file is the matrix, i.e., K lines,
       each containing K real numbers.	For example:



		 3
		 462.876649   480.411218   281.758307
		 480.411218   513.015646   278.914813
		 281.758307   278.914813   336.326645




       The output will be K groups of lines;  each group will have the format:
		 E   real part imaginary part	relative importance
		 V   real part imaginary part
			  ... K lines ...
		 N   real part imaginary part
			  ... K lines ...
		 W   real part imaginary part
			  ... K lines ...

	The _E line is the eigen value.	The _V lines are the eigen vector asso-
       ciated with E.  The _N lines are the V vector normalized to have a  mag-
       nitude  of  1.	The  _W lines are the N vector multiplied by the square
       root of the magnitude of the eigen value (E).


       For the example input matrix, the output would be:
		 E  1159.7452017844    0.0000000000   88.38
		 V     0.6910021591    0.0000000000
		 V     0.7205280412    0.0000000000
		 V     0.4805108400    0.0000000000
		 N     0.6236808478    0.0000000000
		 N     0.6503301526    0.0000000000
		 N     0.4336967751    0.0000000000
		 W    21.2394712045    0.0000000000
		 W    22.1470141296    0.0000000000
		 W    14.7695575384    0.0000000000

		 E     5.9705414972    0.0000000000    0.45
		 V     0.7119385973    0.0000000000
		 V    -0.6358200627    0.0000000000
		 V    -0.0703936743    0.0000000000
		 N     0.7438340890    0.0000000000
		 N    -0.6643053754    0.0000000000
		 N    -0.0735473745    0.0000000000
		 W     1.8175356507    0.0000000000
		 W    -1.6232096923    0.0000000000
		 W    -0.1797107407    0.0000000000

		 E   146.5031967184    0.0000000000   11.16
		 V     0.2265837636    0.0000000000
		 V     0.3474697082    0.0000000000
		 V    -0.8468727535    0.0000000000
		 N     0.2402770238    0.0000000000
		 N     0.3684685345    0.0000000000
		 N    -0.8980522763    0.0000000000
		 W     2.9082771721    0.0000000000
		 W     4.4598880523    0.0000000000
		 W   -10.8698904856    0.0000000000



PPRROOGGRRAAMM NNOOTTEESS
       The relative importance of the eigen value (E) is the  ratio  (percent-
       age)  of the eigen value to the sum of the eigen values.  Note that the
       output is not sorted by relative importance.


       In general, the solution to the eigen system results in complex numbers
       (with  both  real and imaginary parts).	However, in the example above,
       since the input matrix is symmetric (i.e., inverting the rows and  col-
       umns  gives  the  same  matrix)	the  eigen system has only real values
       (i.e., the imaginary part is zero).  This fact makes it possible to use
       eigen  vectors  to  perform  principle component transformation of data
       sets.  The covariance or correlation matrix of any data set is  symmet-
       ric and thus has only real eigen values and vectors.

PPRRIINNCCIIPPLLEE CCOOMMPPOONNEENNTTSS
       To perform principle component transformation on GRASS data layers, one
       would use _r_._c_o_v_a_r to get the covariance (or correlation) matrix	for  a
       set of data layers, _m_._e_i_g_e_n_s_y_s_t_e_m to extract the related eigen vectors,
       and _r_._m_a_p_c_a_l_c to form the desired components.  For example, to get  the
       eigen vectors for 3 layers:
       ((eecchhoo 33;; rr..ccoovvaarr mmaapp..11,,mmaapp..22,,mmaapp..33)) || mm..eeiiggeennssyysstteemm
	 Note  that  since  m.covar  only outputs the matrix, we must manually
       prepend the matrix size (3) using the echo command.


       Then, using the W vector, new maps are created:
       rr..mmaappccaallcc 'pc.1 = 21.2395*map.1 + 22.1470*map.2 + 14.7696*map.3'
       rr..mmaappccaallcc 'pc.2 =  2.9083*map.1 +  4.4599*map.2	- 10.8699*map.3'
       rr..mmaappccaallcc 'pc.3 =  1.8175*map.1	-  1.6232*map.2 -  0.1797*map.3'


NNOOTTEESS
       The   source   code   for   this   program   lives   under    /src.con-
       trib/CERL/misc/m.eigensystem and requires a Fortran compiler.

SSEEEE AALLSSOO
       _r_._c_o_v_a_r

       _r_._m_a_p_c_a_l_c

       _r_._r_e_s_c_a_l_e

AAUUTTHHOORR
       This  code  uses  routines  from the EISPACK system.  The interface was
       coded by Michael Shapiro, U.S.Army  Construction  Engineering  Research
       Laboratory

       _L_a_s_t _c_h_a_n_g_e_d_: _$_D_a_t_e_: _2_0_0_2_/_0_1_/_2_5 _0_5_:_4_5_:_3_3 _$



GRASS 5.0						      m.eigensystem(1)
