# pyriemann.utils.mean.mean_power¶

pyriemann.utils.mean.mean_power(covmats, p, *, sample_weight=None, zeta=1e-09, maxiter=100)

Power mean of SPD matrices.

Power mean is the solution of [1] [2]:

$\mathbf{C} = \frac{1}{m} \sum_i \mathbf{C} \sharp_p \mathbf{C}_i$

where $$\mathbf{A} \sharp_p \mathbf{B}$$ is the geodesic between matrices $$\mathbf{A}$$ and $$\mathbf{B}$$.

Parameters
covmatsndarray, shape (n_matrices, n_channels, n_channels)

Set of SPD matrices.

pfloat

Exponent, in [-1,+1]. For p=0, it returns pyriemann.utils.mean.mean_riemann().

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

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

zetafloat, default=10e-10

Stopping criterion.

maxiterint, default=100

The maximum number of iterations.

Returns
Cndarray, shape (n_channels, n_channels)

Power mean.

Notes

New in version 0.3.

References

1

Matrix Power means and the Karcher mean Y. Lim and M. Palfia. Journal of Functional Analysis, Volume 262, Issue 4, 15 February 2012, Pages 1498-1514.

2

Fixed Point Algorithms for Estimating Power Means of Positive Definite Matrices M. Congedo, A. Barachant, and R. Bhatia. IEEE Transactions on Signal Processing, Volume 65, Issue 9, pp.2211-2220, May 2017