Compute the basis of a clr-plane, to use with isometric log-ratio or planar transform of a (dataset of) compositions.
ilrBase( x=NULL , z=NULL , D = NULL, method = "basic" )
optional dataset or vector of compositions
optional dataset or vector containing ilr or ipt coordinates
number of parts of the simplex
method to build the basis, one of "basic", "balanced", "optimal" "PBhclust", "PBmaxvar" or "PBangprox"
All methods give a matrix containing by columns the basis elements for the
canonical basis of the clr-plane used for the ilr and ipt transform. Only one of the
arguments x
, z
or D
is needed
to determine the dimension of the simplex.
Method "basic" computes a triangular Helmert matrix (corresponding to
the original ilr transformation defined by Egozcue et al, 2003).
In this case, ilrBase
is a wrapper catching
the answers of gsi.ilrBase
and is to be
used as the more convenient function.
Method "balanced" returns an ilr matrix associated with a balanced partition,
splitting the parts in groups as equal as possible. Transforms ilr
and ipt
computed
with this basis are less affected by any component (as happens with "basic").
The following methods are all data-driven and will fail if x
is not given.
Some of these methods are extended to non-acomp datasets via the cpt
general functionality. Use with care with non-acomp objects!
Method "optimal" is a wrapper to gsi.optimalilrBase
, providing the ilr basis
with less influence of missing values. It is computed as a hierarchical
cluster of variables, with parts previously transformed to
1 (if the value is lost) or 0 (if it is recorded).
Methods "PBhclust", "PBmaxvar" and "PBangprox" are principal balance methods (i.e.
balances approximating principal components in different ways). These are all
resolved by calls to gsi.PrinBal
. Principal balances functionality should be
considered beta!
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
# NOT RUN {
ilr(c(1,2,3))
ilrBase(D=2)
ilrBase(c(1,2,3))
ilrBase(z= ilr(c(1,2,3)) )
round(ilrBase(D=7),digits= 3)
ilrBase(D=7,method="basic")
ilrBase(D=7,method="balanced")
# }
Run the code above in your browser using DataLab