alrEM {robCompositions} | R Documentation |
A modified EM alr-algorithm for replacing rounded zeros in compositional data sets.
alrEM(x, pos = ncol(x), dl = rep(0.05, ncol(x) - 1), eps = 1e-04, maxit = 50)
x |
Compositional data |
pos |
Position of the rationing variable for alr transformation |
dl |
Detection limit for each part |
eps |
convergence criteria |
maxit |
maximum number of iterations |
Statistical analysis of compositional data including zeros runs into problems, because log-ratios cannot be applied. Usually, rounded zeros are considerer as missing not at random missing values. The algorithm first applies an additive log-ratio transformation to the compositions. Then the rounded zeros are imputed using a modified EM algorithm. Details can be found in Palarea-Albaladej and Martinn-Fernandez (2008).
The major difference between their MATLAB implementation and this re-implementatin as a R function is that they use the reg.sweep methodology for regression analysis. Nevertheless, we use the standard lm function from R which based on QR-decompositons, which is more accurate than sweep.
xOrig |
Original data frame or matrix |
xImp |
Imputed data |
wind |
Index of the missing values in the data |
iter |
Number of iterations |
eps |
eps |
Matthias Templ and Karel Hron
Palarea-Albaladej, J. and Mart'in-Fern'andez, J.A. (2008) A modified EM alr-algorithm for replacing rounded zeros in compositional data sets. Computers and Geosciences, 34, 902-917
require(compositions) require(robCompositions) data(aitchison359) x <- aitchison359 ## generate rounded zeros artificially: x[x < 5] <- 0 xia <- alrEM(x, pos=2, dl=rep(5,3)) xia$xImp