composition_stats.ilr_inv

composition_stats.ilr_inv(mat, basis=None, check=True)

Performs inverse isometric log ratio transform.

This function transforms compositions from the real space to Aitchison geometry. The \(ilr^{-1}\) transform is both an isometry, and an isomorphism defined on the following spaces

\(ilr^{-1}: \mathbb{R}^{D-1} \rightarrow S^D\)

The inverse ilr transformation is defined as follows

\[ilr^{-1}(x) = \bigoplus\limits_{i=1}^{D-1} x \odot e_i\]

where \([e_1,\ldots, e_{D-1}]\) is an orthonormal basis in the simplex.

If an orthonormal basis isn’t specified, the J. J. Egozcue orthonormal basis derived from Gram-Schmidt orthogonalization will be used by default.

Parameters
mat: numpy.ndarray, float

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

basis: numpy.ndarray, float, optional

orthonormal basis for Aitchison simplex defaults to J.J.Egozcue orthonormal basis

check: bool

Specifies if the basis is orthonormal.

Notes

If the basis parameter is specified, it is expected to be a basis in the Aitchison simplex. If there are D-1 elements specified in mat, then the dimensions of the basis needs be D-1 x D, where rows represent basis vectors, and the columns represent proportions.

Examples

>>> import numpy as np
>>> from composition_stats import ilr
>>> x = np.array([.1, .3, .6,])
>>> ilr_inv(x)
array([ 0.34180297,  0.29672718,  0.22054469,  0.14092516])