| ced | R Documentation |
Normalised Aitchison distance between an original and an imputed (or otherwise modified) compositional data set, used to evaluate imputation methods.
ced(x, y, ni)
x |
matrix or data frame with the original compositions: strictly positive values, no missing values. |
y |
matrix or data frame of the same dimensions as |
ni |
positive number used for normalisation, typically the number of imputed or replaced values. |
The compositional error distance is the sum of the row-wise
Aitchison distances between x and y, divided by ni,
\mathrm{ced}(X, Y) = \frac{1}{n_i}\sum_{i=1}^{n} d_a(x_i, y_i),
where d_a is the Aitchison distance (see aDist).
Rows that are identical in x and y contribute zero. If ni
is the number of imputed cells (e.g. sum(is.na(x)) before imputation, or
the number of rounded zeros that were replaced), the result is the average
error per imputed value, which makes results comparable across data sets with
different numbers of missing values.
Columns are matched by position, not by name.
The compositional error distance, a single non-negative number. If
x and y are single-row data frames it is returned as a 1 x 1
matrix with the row names as dimnames, as in aDist.
Matthias Templ
Hron, K., Templ, M., Filzmoser, P. (2010). Imputation of missing values for compositional data using classical and robust methods. Computational Statistics and Data Analysis, 54 (12), 3095-3107. \Sexpr[results=rd]{tools:::Rd_expr_doi("10.1016/j.csda.2009.11.023")}
Templ, M., Hron, K., Filzmoser, P., Gardlo, A. (2016). Imputation of rounded zeros for high-dimensional compositional data. Chemometrics and Intelligent Laboratory Systems, 155, 183-190. \Sexpr[results=rd]{tools:::Rd_expr_doi("10.1016/j.chemolab.2016.04.011")}
aDist, rdcm, impKNNa,
impCoda, imputeBDL
data(expenditures)
x <- expenditures
x[1, 3] <- NA
xi <- impKNNa(x)$xImp
# average Aitchison error per imputed value
ced(expenditures, xi, ni = sum(is.na(x)))
# without imputation error the distance is zero
ced(expenditures, expenditures, ni = 1)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.