pyriemann.utils.mean.maskedmean_riemann

pyriemann.utils.mean.maskedmean_riemann(X=None, masks=None, tol=1e-08, maxiter=100, init=None, sample_weight=None, covmats=None)

Masked Riemannian mean of SPD/HPD matrices.

Given masks defined as semi-orthogonal matrices, the masked Riemannian mean of SPD/HPD matrices is obtained with a gradient descent minimizing the sum of affine-invariant Riemannian distances between masked SPD/HPD matrices and the masked mean [1].

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

Set of SPD/HPD matrices.

maskslist of n_matrices ndarray of shape (n, n_i), with different n_i, such that n_i <= n

Masks, defined as semi-orthogonal matrices. See [1].

tolfloat, default=10e-9

The tolerance to stop the gradient descent.

maxiterint, default=100

The maximum number of iteration.

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

A SPD/HPD matrix used to initialize the gradient descent. If None, the Identity 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)

Masked Riemannian mean.

Notes

New in version 0.3.

References

[1] (1,2)

Geodesically-convex optimization for averaging partially observed covariance matrices F. Yger, S. Chevallier, Q. Barthélemy, and S. Sra. Asian Conference on Machine Learning (ACML), Nov 2020, Bangkok, Thailand. pp.417 - 432.