B2i: Balances to isometric log-ratio

Description Usage Arguments Details Value References Examples

View source: R/B2i.R

Description

Coefficients of log of parts in a balance matrix, (+1) for numerator and (-1) for denominator, are transformed into the corresponding isometric log-ratio (ilr) coefficients

Usage

1
B2i(bal, balnames=FALSE)

Arguments

bal

a (D-1 x D) balance matrix with cells +1, 0 or -1.

balnames

logical, if TRUE, balance names are attributed to ilr transforms; if FALSE (default) ilr transforms are numbered ilr1 to ilrD1, where D1=D-1 and D is the number of parts.

Details

Two scalars multiplying positive and negative cells respectively are defined for each row of the matrix bal in such a way that the resulting matrix defines the ilr transformation to apply to the log of a compositional vector. The output transformation matrix is transposed for application to a compositional dataset where the compositions are the rows.

Value

a D \times (D-1) matrix giving the coefficients of the ilr transforms

References

Pawlowsky-Glahn, V., J. J. Egozcue, and R. Tolosana-Delgado (2007). Lecture Notes on Compositional Data Analysis.

Examples

1
2
3
4
5
6
7
8
9
bal <- matrix(c(1,-1,0,1,1,-1),nrow=2, byrow=TRUE)
colnames(bal) <- paste("l.P",1:3,sep="") 
bal
B2i(bal)

rownames(bal) <- paste("B",1:2,sep="") 
bal
B2i(bal,balnames=TRUE)
B2i(bal)

SGB documentation built on March 26, 2020, 8:02 p.m.