skbio.stats.composition.clr_inv#

skbio.stats.composition.clr_inv(mat)[source]#

Perform 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:
matarray_like of shape (n_compositions, n_components)

A matrix of clr-transformed data.

Returns:
ndarray of shape (n_compositions, n_components)

Inverse clr-transformed matrix.

Examples

>>> import numpy as np
>>> from skbio.stats.composition import clr_inv
>>> x = np.array([.1, .3, .4, .2])
>>> clr_inv(x)
array([ 0.21383822,  0.26118259,  0.28865141,  0.23632778])