skbio.stats.composition.
alr_inv
(mat, denominator_idx=0)[source]¶State: Experimental as of 0.5.5. Performs inverse additive log ratio transform.
This function transforms compositions from the non-isometric real space of alrs to Aitchison geometry.
\(alr^{-1}: \mathbb{R}^{D-1} \rightarrow S^D\)
The inverse alr transformation is defined as follows
where \(C[x]\) is the closure operation defined as
for some \(D\) dimensional real vector \(x\) and \(D\) is the number of components for every composition.
Parameters: |
|
---|---|
Returns: | Inverse alr transformed matrix or vector where rows sum to 1. |
Return type: | numpy.ndarray |
Examples
>>> import numpy as np
>>> from skbio.stats.composition import alr, alr_inv
>>> x = np.array([.1, .3, .4, .2])
>>> alr_inv(alr(x))
array([ 0.1, 0.3, 0.4, 0.2])