composition_stats.center¶
- composition_stats.center(mat)¶
Compute the geometric average of data.
- Parameters
- matarray_like
a matrix of proportions where rows = compositions columns = components each composition (row) must add up to unity (see closure())
- Returns
- array_like, np.float64
central composition
Examples
>>> import numpy as np >>> from composition_stats import center >>> X = np.array([[.1,.3,.4, .2],[.2,.2,.2,.4]]) >>> center(X) array([ 0.14854315, 0.25728427, 0.29708629, 0.29708629])