Formula: clr(x)_i = log( x_i / g(x) ), g(x) the geometric mean; sum_i clr(x)_i = 0
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). clr(x) = (ln(x_1/g(x)), ..., ln(x_D/g(x))). The transform
maps S^D onto the hyperplane of vectors summing to zero, so sum_check is zero up
to rounding and is reported as a check on the caller's data rather than as a result.
Examples
V <- c(1, 2, 3, 4, 5, 6, 7, 8)
Clr(V)
#> $clr
#> [1] -1.3255754 -0.6324282 -0.2269631 0.0607190 0.2838625 0.4661841 0.6203348
#> [8] 0.7538662
#>
#> $geomean
#> [1] 3.764351
#>
#> $D
#> [1] 8
#>
#> $sum_check
#> [1] 7.771561e-16
#>
#> $method
#> [1] "Centred log-ratio transform"
#>
#> attr(,"class")
#> [1] "morie_rich_result" "list"
