isomLR {complmrob}R Documentation

(Inverse) Isometric log-ratio transformation for compositional data

Description

Projects the D-dimensional compositional data on the (D-1)-dimensional simplex isometrically back and forth by transforming the values according to

z_i = \sqrt{\frac{D - i}{D -i + 1}} \log{ \frac{x_i}{ \left( \prod_{j=i+1}^{D} x_j \right)^{1/(D - i)} }}

Usage

isomLR(x, comp = 1)

isomLRinv(z, perc = TRUE)

Arguments

x

a numeric vector of length D or a numeric matrix with D columns

comp

the component to use as the first compositional part

z

a numeric vector of length D-1 or a numeric matrix with D-1 columns.

perc

should the result be a matrix with percentage shares (default TRUE).

Value

isomLR: a numeric matrix with (D-1) columns with the transformed values. The name of the first column is the name of the first part (the other names are according to the order of the columns in the given matrix x)

isomLRinv: a numeric matrix with D columns with the transformed values. The values in the matrix are not on the original scale, but the percentage shares are equal.

Functions

Examples

X <- as.matrix(USArrests[ , -3])
# Get the ilr with relative information of the 1st column to the other cols
ilrZ1 <- isomLR(X)
# Get the ilr with relative information of the 2nd column to the other cols
ilrZ2 <- isomLR(X, 2)
isomLRinv(ilrZ1)

[Package complmrob version 0.7.0 Index]