pyriemann.utils.mean.mean_wasserstein

pyriemann.utils.mean.mean_wasserstein(X=None, tol=0.001, maxiter=50, init=None, sample_weight=None, covmats=None)

Mean of SPD/HPD matrices according to the Wasserstein metric.

Wasserstein mean is obtained by an iterative procedure where the update is [1]:

\[\mathbf{K} = \left( \sum_i w_i \ \left( \mathbf{K} \mathbf{X}_i \mathbf{K} \right)^{1/2} \right)^{1/2}\]

with \(\mathbf{K} = \mathbf{M}^{1/2}\).

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

Set of SPD/HPD matrices.

tolfloat, default=10e-4

The tolerance to stop the gradient descent.

maxiterint, default=50

The maximum number of iterations.

initNone | ndarray, shape (n, n), default=None

A SPD/HPD matrix used to initialize the gradient descent. If None the Euclidean mean is used.

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

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

Returns:
Mndarray, shape (n, n)

Wasserstein mean.

See also

mean_covariance

References

[1]

Geometric Radar Processing based on Frechet distance: Information geometry versus Optimal Transport Theory F. Barbaresco. 12th International Radar Symposium (IRS), October 2011