Skip to contents

Maps a \(D\)-part composition to \(D-1\) unconstrained, orthonormal coordinates – unlike CLR these are full rank, so they can go straight into morie_taphonomy_preservation_delta / morie_taphonomy_bhm without singular design matrices. Uses the Egozcue et al. (2003) pivot-coordinate basis $$\mathrm{ilr}_i(x) = \sqrt{\tfrac{i}{i+1}}\, \log\frac{(\prod_{k\le i} x_k)^{1/i}}{x_{i+1}},$$ computed in closed form so R and Python return identical values.

Usage

morie_taphonomy_ilr(x, pseudocount = 1e-06)

Arguments

x

Numeric matrix/data.frame of compositions (>= 2 parts).

pseudocount

Zero-guarding pseudocount (default 1e-6).

Value

A numeric matrix with ncol(x) - 1 columns (ilr1...).

References

Egozcue JJ, et al. (2003). Isometric logratio transformations for compositional data analysis. Mathematical Geology 35(3), 279–300. doi:10.1023/A:1023818214614

Examples

morie_taphonomy_ilr(morie_taphonomy_simulate_pxrf(3, seed = 1)[, 1:6])
#>           ilr1      ilr2     ilr3     ilr4     ilr5
#> [1,] 0.3432383 0.9781026 4.313635 2.193849 7.306458
#> [2,] 0.9850109 0.9473373 3.794918 1.394941 5.549005
#> [3,] 0.5711313 1.5083890 3.251650 2.308143 1.477635