pyriemann.geometry.mean.mean_logeuclid

pyriemann.geometry.mean.mean_logeuclid(X, sample_weight=None, **kwargs)[source]

Mean of SPD/HPD matrices according to the log-Euclidean metric.

Log-Euclidean mean is [1]:

\[\mathbf{M} = \exp{ \left( \sum_i w_i \ \log{\mathbf{X}_i} \right) }\]

with \(w\) being the weights which sum to 1.

Parameters:
Xndarray, shape (…, n_matrices, n, n)

Set of SPD/HPD matrices.

sample_weightNone | ndarray, shape (n_matrices,), default=None

Weights for each matrix. If None, it uses equal weights.

Returns:
Mndarray, shape (…, n, n)

Log-Euclidean mean.

See also

gmean

Notes

Changed in version 0.12: Add support for NumPy and PyTorch.

References

[1]

Geometric means in a novel vector space structure on symmetric positive-definite matrices V. Arsigny, P. Fillard, X. Pennec, and N. Ayache. SIAM Journal on Matrix Analysis and Applications. Volume 29, Issue 1 (2007).