pyriemann.utils.mean.mean_covariance

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

Mean of SPD matrices according to a metric.

Parameters
covmatsndarray, shape (n_matrices, n_channels, n_channels)

Set of SPD 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.

argslist of params

The arguments passed to the sub function.

Returns
Cndarray, shape (n_channels, n_channels)

Mean of SPD matrices.