skbio.stats.composition.
alr
(mat, denominator_idx=0)[source]¶State: Experimental as of 0.5.5. Performs additive log ratio transformation.
This function transforms compositions from a D-part Aitchison simplex to a non-isometric real space of D-1 dimensions. The argument denominator_col defines the index of the column used as the common denominator. The :math: alr transformed data are amenable to multivariate analysis as long as statistics don’t involve distances.
\(alr: S^D \rightarrow \mathbb{R}^{D-1}\)
The alr transformation is defined as follows
where \(D\) is the index of the part used as common denominator.
Parameters: |
|
---|---|
Returns: | alr-transformed data projected in a non-isometric real space of D-1 dimensions for a D-parts composition |
Return type: | numpy.ndarray |
Examples
>>> import numpy as np
>>> from skbio.stats.composition import alr
>>> x = np.array([.1, .3, .4, .2])
>>> alr(x)
array([ 1.09861229, 1.38629436, 0.69314718])