pyriemann.utils.mean.mean_alm¶
- pyriemann.utils.mean.mean_alm(covmats, tol=1e-14, maxiter=100, sample_weight=None)¶
Ando-Li-Mathias (ALM) mean of SPD/HPD matrices.
Return the geometric mean recursively [1], generalizing from:
\[\mathbf{C} = X_1^{\frac{1}{2}} (X_1^{-\frac{1}{2}}X_2^{\frac{1}{2}} X_1^{-\frac{1}{2}})^{\frac{1}{2}} X_1^{\frac{1}{2}}\]and requiring a high number of iterations. Extremely slow, due to the recursive formulation.
- Parameters:
- covmatsndarray, shape (n_matrices, n, n)
Set of SPD/HPD matrices.
- tolfloat, default=10e-14
The tolerance to stop the gradient descent.
- maxiterint, default=100
The maximum number of iterations.
- sample_weightNone | ndarray, shape (n_matrices,), default=None
Weights for each matrix. If None, it uses equal weights.
- Returns:
- Cndarray, shape (n, n)
ALM mean.
See also
Notes
New in version 0.3.
References
[1]Geometric Means T. Ando, C.-K. Li, and R. Mathias. Linear Algebra and its Applications. Volume 385, July 2004, Pages 305-334.