pyriemann.utils.mean.mean_covariance

pyriemann.utils.mean.mean_covariance(covmats, metric='riemann', sample_weight=None, **kwargs)

Mean of matrices according to a metric.

Compute the mean of a set of matrices according to a metric [1].

Parameters:
covmatsndarray, shape (n_matrices, n, n)

Set of matrices.

metricstring, default=’riemann’

The metric for mean, can be: ‘ale’, ‘alm’, ‘euclid’, ‘harmonic’, ‘identity’, ‘kullback_sym’, ‘logdet’, ‘logeuclid’, ‘riemann’, ‘wasserstein’, or a callable function.

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

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

**kwargsdict

The keyword arguments passed to the sub function.

Returns:
Cndarray, shape (n, n)

Mean of matrices.

References

[1]

Review of Riemannian distances and divergences, applied to SSVEP-based BCI S. Chevallier, E. K. Kalunga, Q. Barthélemy, E. Monacelli. Neuroinformatics, Springer, 2021, 19 (1), pp.93-106