Learn R Programming

coda.base (version 1.0.3)

ilr_basis: 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")

Value

A matrix representing the orthonormal basis.

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 "pivot", "cdp". Any other option will return the Helmert basis defined by Egozcue et al., 2013..

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.

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

Run this code
ilr_basis(5)
ilr_basis(alimentation[,1:9])

Run the code above in your browser using DataLab