skbio.stats.composition.
perturb_inv
(x, y)[source]¶State: Experimental as of 0.4.0. Performs the inverse perturbation operation.
This operation is defined as
\(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: | A matrix of proportions where all of the values are nonzero and each composition (row) adds up to 1 |
Return type: | numpy.ndarray, np.float64 |
Examples
>>> import numpy as np
>>> from skbio.stats.composition import perturb_inv
>>> x = np.array([.1,.3,.4, .2])
>>> y = np.array([1./6,1./6,1./3,1./3])
>>> perturb_inv(x,y)
array([ 0.14285714, 0.42857143, 0.28571429, 0.14285714])