endmemberCoordinates      package:compositions      R Documentation

_R_e_c_a_s_t _a_m_o_u_n_t_s _a_s _m_i_x_t_u_r_e_s _o_f _e_n_d-_m_e_m_b_e_r_s

_D_e_s_c_r_i_p_t_i_o_n:

     Computes the convex combination of amounts as mixtures of
     'endmembers' to explain 'X' as good as possible.

_U_s_a_g_e:

               endmemberCoordinates(X,...)
               endmemberCoordinatesInv(K,endmembers,...)
               ## Default S3 method:
               endmemberCoordinates(X,endmembers=diag(gsi.getD(X)), ...)
               ## S3 method for class 'acomp':
               endmemberCoordinates(X,endmembers=clr.inv(diag(gsi.getD(X))),...)
               ## S3 method for class 'aplus':
               endmemberCoordinates(X,endmembers,...)
               ## S3 method for class 'rplus':
               endmemberCoordinates(X,endmembers,...)
               ## S3 method for class 'rmult':
               endmemberCoordinatesInv(K,endmembers,...)
               ## S3 method for class 'acomp':
               endmemberCoordinatesInv(K,endmembers,...)
               ## S3 method for class 'rcomp':
               endmemberCoordinatesInv(K,endmembers,...)
               ## S3 method for class 'aplus':
               endmemberCoordinatesInv(K,endmembers,...)
               ## S3 method for class 'rplus':
               endmemberCoordinatesInv(K,endmembers,...)
               

_A_r_g_u_m_e_n_t_s:

       X: a data set of amounts or compositions, to be represented in
          as convex combination of the 'endmembers' in the given
          geometry

       K: weights of the 'endmembers' in the convex combination

endmembers: a dataset of compositions of the same class as X.  The
          number of endmembers given must not exceed the dimension of 
          the space plus one.

     ...: currently unused

_D_e_t_a_i_l_s:

     The convex combination is performed in the respective geometry.
     This means that, for rcomp objects, positivity of the result is
     only guaranteed  with endmembers corresponding to extremal
     individuals of the sample, or  completely outside its hull. Note
     also that, in acomp geometry, the  endmembers must necessarily be
     outside the hull.  
      The main idea behind this functions is that the composition
     actually  observed came from a convex combination of some extremal
     compositions, specified by 'endmembers'. Up to now, this is
     considered as meaningful only in rplus geometry, and under some
     special circumstances,  in rcomp geometry. It is not meaningful in
     terms of mass conservation  in acomp and aplus geometries, because
     these geometries do not preserve mass: whether such an operation
     has an interpretation is still a matter of  debate. In rcomp
     geometry, the convex combination is dependent on the units of
     measurements, and will be completely different for volume and mass
     %.  Even more, it is valid only if the whole composition is
     observed (!).

_V_a_l_u_e:

     The 'endmemberCoordinates' functions give a 'rmult' data set with
     the weights (a.k.a. barycentric coordinates) allowing  to build
     'X' as good as possible as a convex combination  (a mixture) from
     'endmembers'. The result is of class rmult because there is no
     guarantee that the resulting weights are positive (although they
     sum up to one). 
      The 'endmemberCoordinatesInv' functions reconstruct the convex
     combination from the weights 'K' and the given 'endmembers'. The
     class of 'endmembers' determines the geometry chosen and the class
     of the result.

_A_u_t_h_o_r(_s):

     K.Gerald v.d. Boogaart <URL: http://www.stat.boogaart.de>, Raimon
     Tolosana-Delgado

_R_e_f_e_r_e_n_c_e_s:

     Shurtz, Robert F., 2003. Compositional geometry and mass
     conservation. Mathematical Geology 35 (8), 972-937.

_E_x_a_m_p_l_e_s:

     data(SimulatedAmounts)
     ep <- aplus(rbind(c(2,1,2),c(2,2,1),c(1,2,2)))
     # mix the endmembers in "ep" with weights given by "sa.lognormals"
     dat <- endmemberCoordinatesInv(acomp(sa.lognormals),acomp(ep))
     par(mfrow=c(1,2))
     plot(dat)
       plot(acomp(ep),add=TRUE,col="red",pch=19)
     # compute the barycentric coordinates of the mixture in the "end-member simplex"
     plot( acomp(endmemberCoordinates(dat,acomp(ep))))

     dat <- endmemberCoordinatesInv(rcomp(sa.lognormals),rcomp(ep))
     plot(dat)
     plot( rcomp(endmemberCoordinates(dat,rcomp(ep))))

     dat <- endmemberCoordinatesInv(aplus(sa.lognormals),aplus(ep))
     plot(dat)
     plot( endmemberCoordinates(dat,aplus(ep)))

     dat <- endmemberCoordinatesInv(rplus(sa.lognormals),rplus(ep))
     plot(dat)
     plot(endmemberCoordinates(rplus(dat),rplus(ep)))

