conditional_obasis: Conditional orthonormal basis

View source: R/utils.R

conditional_obasisR Documentation

Conditional orthonormal basis

Description

Compute orthonormal ilr bases associated with conditioning patterns on the parts of a composition.

Usage

conditional_obasis(C)

Arguments

C

A numeric matrix or data frame with one conditioning pattern per row. Columns correspond to parts. For each row, entries equal to '0' define one block and positive entries define the complementary block.

Details

Each row of 'C' defines one conditioning pattern. For a given row, the ilr basis is constructed by separating the parts marked with '0' from the parts marked with a positive value.

If a conditioning row contains 'nz' zeros, then:

  • the first 'nz - 1' coordinates describe the internal log-ratio structure of the parts marked with '0',

  • the coordinate 'nz' describes the balance between the block of parts marked with '0' and the block of parts marked with positive values,

  • the remaining coordinates describe the internal log-ratio structure of the parts marked with positive values.

Thus, each basis preserves the split defined by the conditioning pattern and completes it to an orthonormal basis of the clr-plane.

Value

A three-dimensional array of dimension '(D - 1, D, nrow(C))', where 'D' is the number of parts. Each slice contains one orthonormal ilr basis.

Examples

C <- rbind(
  c(0, 0, 1, 1, 0),
  c(0, 1, 0, 1, 0)
)

conditional_obasis(C)

Cdf <- data.frame(
  a = c(0, 0),
  b = c(0, 1),
  c = c(1, 0),
  d = c(1, 1),
  e = c(0, 0)
)

conditional_obasis(Cdf)


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