zero_na_conditional_obasis: Conditional orthonormal basis for zeros and missing values

View source: R/utils.R

zero_na_conditional_obasisR Documentation

Conditional orthonormal basis for zeros and missing values

Description

Compute orthonormal ilr bases adapted to patterns of missing values and structural zeros.

Usage

zero_na_conditional_obasis(X)

Arguments

X

A numeric matrix or data frame with observations in rows and parts in columns.

Details

Each row of 'X' is treated as one observation. For each observation, parts are split into three ordered blocks:

  • missing values ('NA'),

  • zeros,

  • strictly positive values.

The resulting basis is constructed so that:

  • the first coordinates describe the internal structure of the 'NA' block,

  • the next coordinate contrasts the 'NA' block with the positive block,

  • the following coordinates describe the internal structure of the zero block,

  • the next coordinate contrasts the zero block with the positive block,

  • the remaining coordinates describe the internal structure of the positive block.

Value

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

Examples

X <- rbind(
  c(1, NA, 0, 2),
  c(NA, 3, 0, 4),
  c(1, 2, 3, 4)
)

zero_na_conditional_obasis(X)

Xdf <- data.frame(
  a = c(1, NA, 1),
  b = c(NA, 3, 2),
  c = c(0, 0, 3),
  d = c(2, 4, 4)
)

zero_na_conditional_obasis(Xdf)


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