coda_replacement: Replacement of missing values and below-detection zeros in...

View source: R/zero_replacement_imputation.R

coda_replacementR Documentation

Replacement of missing values and below-detection zeros in compositional data

Description

Performs imputation of missing values and/or values below the detection limit in compositional data using an EM algorithm assuming normality on the simplex.

Usage

coda_replacement(
  X,
  DL = NULL,
  dl_prop = 0.65,
  eps = 1e-04,
  parameters = FALSE,
  debug = FALSE,
  maxit = 500
)

Arguments

X

A compositional data set: numeric matrix or data frame where rows represent observations and columns represent parts.

DL

An optional matrix or vector of detection limits. If 'NULL', the minimum non-zero value in each column of 'X' is used.

dl_prop

A numeric value between 0 and 1 used for initialization in the EM algorithm.

eps

Convergence tolerance.

parameters

Logical; if 'TRUE', return additional estimated parameters.

debug

Logical; if 'TRUE', print the log-likelihood at each iteration.

maxit

Maximum number of iterations

Value

If 'parameters = FALSE', a numeric matrix with imputed values. If 'parameters = TRUE', a list with the estimated clr mean, clr covariance, and imputed clr coordinates.


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