skbio.stats.composition.
ilr
(mat, basis=None, check=True)[source]¶State: Experimental as of 0.4.0. Performs isometric log ratio transformation.
This function transforms compositions from Aitchison simplex to the real space. The :math: ilr` transform is both an isometry, and an isomorphism defined on the following spaces
\(ilr: S^D \rightarrow \mathbb{R}^{D-1}\)
The ilr transformation is defined as follows
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
basis: numpy.ndarray, float, optional
|
---|
Examples
>>> import numpy as np
>>> from skbio.stats.composition import ilr
>>> x = np.array([.1, .3, .4, .2])
>>> ilr(x)
array([-0.7768362 , -0.68339802, 0.11704769])