ilr_basis {coda.base} | R Documentation |
Isometric/Orthonormal Log-Ratio Basis for Log-Transformed Compositions
Description
Builds an isometric log-ratio (ilr) basis for a composition with k+1
parts, also called orthonormal log-ratio (olr) basis.
Usage
ilr_basis(dim, type = "default")
olr_basis(dim, type = "default")
Arguments
dim |
An integer indicating the number of components. If a dataframe or matrix is provided, the number of components is inferred from the number of columns. If a character vector specifying the names of the parts is provided the number of component is its length. |
type |
Character string specifying the type of basis to generate.
Options are |
Details
The basis vectors are constructed as:
h_i = \sqrt{\frac{i}{i+1}} \log\frac{\sqrt[i]{\prod_{j=1}^i x_j}}{x_{i+1}}
for i = 1, \ldots, k
.
Setting the type
parameter to "pivot"
(pivot balances) or "cdp"
(codapack balances) allows generating alternative ilr/olr bases.
Value
A matrix representing the orthonormal basis.
References
Egozcue, J.J., Pawlowsky-Glahn, V., Mateu-Figueras, G., & Barceló-Vidal, C. (2003). Isometric logratio transformations for compositional data analysis. Mathematical Geology, 35(3), 279–300.
Examples
ilr_basis(5)
ilr_basis(alimentation[,1:9])