Extension of base_lr_transforms to arrays over arbitrary margins.

glr_array(x, V, parts, dimname = colnames(V))

glrInv_array(y, V, coords, dimname = rownames(V))

alr_array(x, d = dim(x)[parts], parts)

alrInv_array(y, d = dim(y)[coords] + 1, coords)

ilr_array(x, V = NULL, parts)

ilrInv_array(y, V = NULL, coords)

clr_array(x, parts)

clrInv_array(y, coords)

Arguments

x

multidimensional array in simplex

V

transformation matrix (defines transform)

parts

index of dimension of x that represents parts (e.g., compositional variables)

dimname

character vector of dimension name for resulting dimension after transformation

y

multidimensional array in transformed space

coords

index of dimension of x that represents coords (e.g., transformed variables)

d

for ALR, which component (integer position) to take as reference (default is ncol(x)) for alrInv corresponds to column position in untransformed matrix.

Value

array

Details

accelerated for parts OR coords == 1

Examples

a <- array(1:100, dim=c(10, 5, 2)) a <- miniclo_array(a, parts=2) clr_array(a, parts=2)
#> , , 1 #> #> [,1] [,2] [,3] [,4] [,5] #> [1,] -2.5179954 -0.1201001 0.5265270 0.9159918 1.1955767 #> [2,] -2.0013532 -0.2095937 0.3965421 0.7712355 1.0431693 #> [3,] -1.7127404 -0.2464034 0.3241415 0.6851549 0.9498474 #> [4,] -1.5164968 -0.2637338 0.2752627 0.6235694 0.8813985 #> [5,] -1.3702370 -0.2716247 0.2392009 0.5756732 0.8269876 #> [6,] -1.2551615 -0.2743323 0.2111755 0.5365979 0.7817204 #> [7,] -1.1612950 -0.2739918 0.1886317 0.5037127 0.7429424 #> [8,] -1.0827195 -0.2717892 0.1700435 0.4754252 0.7090400 #> [9,] -1.0156437 -0.2684293 0.1544276 0.4506934 0.6789520 #> [10,] -0.9574983 -0.2643512 0.1411139 0.4287960 0.6519396 #> #> , , 2 #> #> [,1] [,2] [,3] [,4] [,5] #> [1,] -0.3103120 -0.1312637 0.02054227 0.1523115 0.2687219 #> [2,] -0.3054667 -0.1295760 0.01995571 0.1500088 0.2650782 #> [3,] -0.3007733 -0.1279305 0.01939420 0.1477754 0.2615343 #> [4,] -0.2962247 -0.1263257 0.01885633 0.1456080 0.2580860 #> [5,] -0.2918142 -0.1247601 0.01834077 0.1435039 0.2547295 #> [6,] -0.2875354 -0.1232323 0.01784629 0.1414602 0.2514611 #> [7,] -0.2833824 -0.1217411 0.01737174 0.1394744 0.2482773 #> [8,] -0.2793498 -0.1202851 0.01691606 0.1375440 0.2451747 #> [9,] -0.2754322 -0.1188631 0.01647825 0.1356668 0.2421502 #> [10,] -0.2716247 -0.1174740 0.01605738 0.1338404 0.2392009 #>