compositions (version 1.40-2)

clr2ilr: Convert between clr and ilr, and between cpt and ipt.

Description

Compute the centered log ratio transform of a (dataset of) isometric log-ratio transform(s) and its inverse. Equivalently, compute centered and isometric planar transforms from each other. Acts in vectors and in bilinear forms.

Usage

clr2ilr( x , V=ilrBase(x) )
ilr2clr( z , V=ilrBase(z=z),x=NULL )
clrvar2ilr( varx , V=ilrBase(D=ncol(varx)) )
ilrvar2clr( varz , V=ilrBase(D=ncol(varz)+1) ,x=NULL)

Arguments

x

the clr/cpt-transform of composition(s) (in the ilr2-routines provided only to give column names.)

z

the ilr/ipt-transform of composition(s)

varx

variance or covariance matrix of clr/cpt-transformed compositions

varz

variance or covariance matrix of ilr/ipt-transformed compositions

V

a matrix with columns giving the chosen basis of the clr-plane

Value

clr2ilr gives the ilr/ipt transform of the same composition(s), ilr2clr gives the clr/cpt transform of the same composition(s), clrvar2ilr gives the variance-/covariance-matrix of the ilr/ipt transform of the same compositional data set, ilrvar2clr gives the variance-/covariance-matrix of the clr/cpt transform of the same compositional data set.

Details

These functions perform a matrix multiplication with V in an appropriate way.

References

Egozcue J.J., V. Pawlowsky-Glahn, G. Mateu-Figueras and C. Barcel'o-Vidal (2003) Isometric logratio transformations for compositional data analysis. Mathematical Geology, 35(3) 279-300 Aitchison, J, C. Barcel'o-Vidal, J.J. Egozcue, V. Pawlowsky-Glahn (2002) A consise guide to the algebraic geometric structure of the simplex, the sample space for compositional data analysis, Terra Nostra, Schriften der Alfred Wegener-Stiftung, 03/2003

See Also

ilr, ipt

Examples

Run this code
# NOT RUN {
data(SimulatedAmounts)
ilrInv(clr2ilr(clr(sa.lognormals)))-clo(sa.lognormals)
clrInv(ilr2clr(ilr(sa.lognormals)))-clo(sa.lognormals)
ilrvar2clr(var(ilr(sa.lognormals)))-var(clr(sa.lognormals))
clrvar2ilr(var(cpt(sa.lognormals)))-var(ipt(sa.lognormals))

# }

Run the code above in your browser using DataLab