
Centred log-ratio (CLR) transform of compositional data
Source:R/taphonomy.R
morie_taphonomy_clr.RdMaps closed compositions off the simplex into real space via
\(\mathrm{clr}(x) = \log x - \overline{\log x}\) (row-wise). Removes the
closure so downstream Gaussian/causal models are not fed singular covariance.
CLR is rank-deficient (columns sum to zero); for regression/DML inputs prefer
morie_taphonomy_ilr.
Examples
morie_taphonomy_clr(morie_taphonomy_simulate_pxrf(3, seed = 1)[, 1:6])
#> Ca P Fe Sr Pb Zn
#> [1,] 3.711784 3.226372 2.2711521 -1.911188 -0.6282677 -6.669853
#> [2,] 3.503778 2.110763 1.6470240 -1.961472 -0.2345679 -5.065525
#> [3,] 2.744213 1.936511 0.4929704 -2.030117 -1.7946877 -1.348890