Formula: alr(x)_i = log( x_i / x_ref ), i != ref
References
Aitchison, J. (1986), The Statistical Analysis of Compositional Data,
Chapman and Hall, is the primary source; the definitions below are as printed in
Mateu-Figueras, G., Pawlowsky-Glahn, V. and Egozcue, J. J., The normal distribution
in some constrained sample spaces, arXiv:0802.2643 (published as SORT 37(1):29-56,
2013), Sect. 4.1, which prints them with equation numbers and attributes them to
Aitchison (1982, 1986). alr(x) = (ln(x_1/x_D), ..., ln(x_{D-1}/x_D)), the reference
part being the last one. ref generalises that to any part; parts reports
which 1-based indices the returned coordinates belong to, in their original order.
The index is 1-based in BOTH language arms so the two agree.
Examples
V <- c(1, 2, 3, 4, 5, 6, 7, 8)
Alr(V)
#> $alr
#> [1] -2.0794415 -1.3862944 -0.9808293 -0.6931472 -0.4700036 -0.2876821 -0.1335314
#>
#> $ref
#> [1] 8
#>
#> $parts
#> [1] 1 2 3 4 5 6 7
#>
#> $D
#> [1] 8
#>
#> $method
#> [1] "Additive log-ratio transform"
#>
#> attr(,"class")
#> [1] "morie_rich_result" "list"
