mushi.composition.clr_inv
- clr_inv(mat)[source]
Performs inverse centre log ratio transformation.
This function transforms compositions from the real space to Aitchison geometry. The \(clr^{-1}\) transform is both an isometry, and an isomorphism defined on the following spaces
\(clr^{-1}: U \rightarrow S^D\)
where \(U= \{x :\sum\limits_{i=1}^D x = 0 \; \forall x \in \mathbb{R}^D\}\)
This transformation is defined as follows
\[clr^{-1}(x) = C[\exp( x_1, \ldots, x_D)]\]- Parameters
mat (array_like, float) – a matrix of real values where rows = transformed compositions and columns = components
- Returns
inverse clr transformed matrix
- Return type
Examples
>>> import numpy as np >>> import mushi.composition as cmp >>> x = np.array([.1, .3, .4, .2]) >>> cmp.clr_inv(x) DeviceArray([0.21383822, 0.26118259, 0.28865141, 0.23632778], dtype=float64)