Description Usage Arguments Details Value Examples
glr
is generic log-ratio transform, code used by other
transforms, can be called directly.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 |
x |
vector or matrix (rows are samples, parts are columns) of data in simplex |
V |
transformation matrix (defines transform) |
y |
matrix (rows are samples, coords are columns) of transformed data |
D |
the number of parts (e.g., number of columns in untransformed data) |
d |
for ALR, which component (integer position) to take as reference (default is ncol(x)) for alrInv corresponds to column position in untransformed matrix. |
inv |
for ALR and CLR, transformation matrix is different forward and inverse |
The implementation of the ILR transform here relies on the fact that all the standard log-ratio transforms can be written in the following form
y=\log(x)V
with inverse transform given by
x=\mathcal{C}[exp(yV^t)]
where \mathcal{C}[\cdot] is the closure operator (miniclo
). Note however that if V does not represent an orthonormal
basis in the Aitchison geometry then the V used for the log-ratio transform may be different
than the one used for the reverse transform (this is the case for the ALR and CLR transforms).
Default ILR base formed by Gram-Schmidt orthogonalization of an ALR basis.
matrix (converts vectors to row matricies)
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 | #ALR Transform
x <- matrix(runif(30), 10, 3)
x <- miniclo(x)
x.alr <- alr(x, 2)
x <- alrInv(x.alr, 2)
# ILR
x.ilr <- ilr(x)
x <- ilrInv(x.ilr)
# CLR
x.clr <- clr(x)
x <- clrInv(x.clr)
# CUSTOM - Be careful if your custom matrix is not
# orthogonal the inverse transform may not be given by just the transpose!
# For example, this is the case for the ALR
V <- matrix(c(1, 1, -1), 3, 1)
x.custom <- glr(x, V)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.