endpointCoordinates {compositions} | R Documentation |
Computes the convex combination of amounts given by endpoints
to explain X
as good as possible.
endpointCoordinates(X,...) endpointCoordinatesInv(K,endpoints,...) ## Default S3 method: endpointCoordinates(X,endpoints=diag(gsi.getD(X)), ...) ## S3 method for class 'acomp': endpointCoordinates(X,endpoints=clr.inv(diag(gsi.getD(X))),...) ## S3 method for class 'aplus': endpointCoordinates(X,endpoints,...) ## S3 method for class 'rplus': endpointCoordinates(X,endpoints,...) ## S3 method for class 'rmult': endpointCoordinatesInv(K,endpoints,...) ## S3 method for class 'acomp': endpointCoordinatesInv(K,endpoints,...) ## S3 method for class 'rcomp': endpointCoordinatesInv(K,endpoints,...) ## S3 method for class 'aplus': endpointCoordinatesInv(K,endpoints,...) ## S3 method for class 'rplus': endpointCoordinatesInv(K,endpoints,...)
X |
a dataset of amounts or compositions, to be represented in as convex combination of the endpoints in the given geometry |
K |
Konvex combination weights to the endpoints |
endpoints |
a dataset of extremal compositions from the same space as X. The number of endpoints given must not exceed the dimension of the space plus one. |
... |
currently unused |
The convex combination is performed in the respective geometry. This
means that for rcomp positivity of the result is only guaranteed with
extermal endmembers and that in acomp-geometry it is not possible to
give extremal endmembers.
The main idea behind this functions is that the actually observed
composition came from a convex combination of some extremal
compositions specified by endpoints. Strictly speaking this is
meaningfull in strictly this sense only in rplus-geometry and under
some special circumstances in rcomp geometry. It is not
meaningfull in terms of mass conservation in acomp- and aplus-geometry
due to the non mass-balancing
character of the geometry. In rcomp-geometry it dependent on unit of
measurements and different for volume and mass % and only valid if
the whole composition is observed.
The endpointCoordinates
functions give a "rmult"
-dataset
giving the convex weights, which allow to combine X
from
endpoints
as good as possible. The result is an "rmult"
since there is guarantee that the resulting weights are positive.
The endpointCoordinates
functions reconstruct the convex
combination from coordinates K
and the given
endpoints
. The class of endpoints
determines the
geometry chosen and the class of the result.
Shurtz, Robert F., 2003. Compositional geometry and mass conservation. Mathematical Geology 35~(8), 972–937.
data(SimulatedAmounts) ep <- aplus(rbind(c(2,1,2),c(2,2,1),c(1,2,2))) dat <- endpointCoordinatesInv(acomp(sa.lognormals),acomp(ep)) plot(dat) plot( acomp(endpointCoordinates(dat,acomp(ep)))) dat <- endpointCoordinatesInv(rcomp(sa.lognormals),rcomp(ep)) plot(dat) plot( rcomp(endpointCoordinates(dat,rcomp(ep)))) dat <- endpointCoordinatesInv(aplus(sa.lognormals),aplus(ep)) plot(dat) plot( endpointCoordinates(dat,aplus(ep))) dat <- endpointCoordinatesInv(rplus(sa.lognormals),rplus(ep)) plot(dat) plot(endpointCoordinates(rplus(dat),rplus(ep)))