skbio.stats.composition.ilr_inv#

skbio.stats.composition.ilr_inv(mat, basis=None, check=True)[source]#

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

A matrix of ilr-transformed data.

basisndarray or sparse matrix, optional

Orthonormal basis for Aitchison simplex. Defaults to J. J. Egozcue orthonormal basis.

checkbool

Check to see if basis is orthonormal.

Returns:
ndarray of shape (n_compositions, n_components)

Inverse ilr-transformed matrix.

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) \times D\), where rows represent basis vectors, and the columns represent proportions.

Examples

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