composition_stats.clr_inv

composition_stats.clr_inv(mat)

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
matarray_like, float

a matrix of real values where rows = transformed compositions and columns = components each composition (row) must add up to unity (see closure())

Returns
numpy.ndarray

inverse clr transformed matrix

Examples

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