pyriemann.utils.geodesic.geodesic_wasserstein¶
- pyriemann.utils.geodesic.geodesic_wasserstein(A, B, alpha=0.5)¶
Wasserstein geodesic between SPD/HPD matrices.
The matrix at position \(\alpha\) on the Wasserstein geodesic between two SPD/HPD matrices \(\mathbf{A}\) and \(\mathbf{B}\) is given in [1]:
\[\mathbf{C} = (1-\alpha)^2\mathbf{A} + \alpha^2\mathbf{B} + \alpha(1-\alpha)((\mathbf{AB})^{1/2} + (\mathbf{BA})^{1/2})\]\(\mathbf{C}\) is equal to \(\mathbf{A}\) if \(\alpha\) = 0, and \(\mathbf{B}\) if \(\alpha\) = 1.
- Parameters:
- Andarray, shape (…, n, n)
First SPD/HPD matrices.
- Bndarray, shape (…, n, n)
Second SPD/HPD matrices.
- alphafloat, default=0.5
Position on the geodesic.
- Returns:
- Cndarray, shape (…, n, n)
SPD/HPD matrices on the Wasserstein geodesic.
See also
Notes
..versionadded:: 0.8
References
[1]Wasserstein Riemannian geometry of Gaussian densities L. Malagò, L. Montrucchio, G. Pistone. Information Geometry, 2018, 1, pp. 137–179.