composition_stats.centralize¶
- composition_stats.centralize(mat)¶
Center data around its geometric average.
- Parameters
- matarray_like, float
a matrix of proportions where rows = compositions and columns = components each composition (row) must add up to unity (see closure())
- Returns
- numpy.ndarray
centered composition matrix
Examples
>>> import numpy as np >>> from composition_stats import centralize >>> X = np.array([[.1,.3,.4, .2],[.2,.2,.2,.4]]) >>> centralize(X) array([[ 0.17445763, 0.30216948, 0.34891526, 0.17445763], [ 0.32495488, 0.18761279, 0.16247744, 0.32495488]])