mushi.composition.ilr_inv

ilr_inv(mat, basis)[source]

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 orthornormal 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

  • basis (numpy.ndarray, float, optional) – orthonormal basis for Aitchison simplex defaults to J.J.Egozcue orthonormal basis

Examples

>>> import numpy as np
>>> import mushi.composition as cmp
>>> x = np.array([.1, .3, .6,])
>>> basis = cmp._gram_schmidt_basis(4)
>>> cmp.ilr_inv(x, basis)
DeviceArray([0.34180297, 0.29672718, 0.22054469, 0.14092516], dtype=float64)