ilr_basis: Isometric and orthonormal log-ratio bases

View source: R/basis.R

ilr_basisR Documentation

Isometric and orthonormal log-ratio bases

Description

Construct an isometric log-ratio (ilr) basis for a composition with D parts. The ilr basis is an orthonormal basis of the clr-plane and provides D - 1 coordinates. The same basis is sometimes referred to as an orthonormal log-ratio (olr) basis.

Usage

ilr_basis(dim, type = "default")

olr_basis(dim, type = "default")

Arguments

dim

Number of parts. It can be:

  • a single integer,

  • a matrix or data frame, in which case the number of columns is used,

  • a character vector of part names, in which case its length is used.

type

Type of ilr basis to construct. Available options are:

  • '"default"': standard Helmert-type ilr basis,

  • '"pivot"': pivot balance basis,

  • '"cdp"': CoDaPack default basis.

Details

For 'type = "default"', the function returns the standard Helmert-type ilr basis. Alternative constructions are available through 'type = "pivot"' and 'type = "cdp"'.

The default basis vectors are:

h_i = \sqrt{\frac{i}{i+1}} \log \frac{\sqrt[i]{\prod_{j=1}^i x_j}}{x_{i+1}}, \qquad i = 1, \ldots, D - 1

Value

A matrix with D rows and D - 1 columns representing an orthonormal log-ratio 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])
ilr_basis(c("a", "b", "c", "d"), type = "pivot")


coda.base documentation built on March 4, 2026, 9:06 a.m.