pyriemann.geometry.geodesic.geodesic_logeuclid

pyriemann.geometry.geodesic.geodesic_logeuclid(A, B, alpha=0.5)[source]

Log-Euclidean geodesic between SPD/HPD matrices.

The matrix at position \(\alpha\) on the log-Euclidean geodesic between two SPD/HPD matrices \(\mathbf{A}\) and \(\mathbf{B}\) is:

\[\mathbf{C} = \exp \left( (1-\alpha) \log(\mathbf{A}) + \alpha \log(\mathbf{B}) \right)\]

\(\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 | ndarray, shape (…,), default=0.5

Position on the geodesic. If ndarray, one value per matrix pair.

Changed in version 0.12.

Returns:
Cndarray, shape (…, n, n)

SPD/HPD matrices on the log-Euclidean geodesic.

See also

geodesic

Notes

Changed in version 0.12: Add support for NumPy and PyTorch. Add support for array-valued alpha.

References

[1]

Geometric means in a novel vector space structure on symmetric positive-definite matrices V. Arsigny, P. Fillard, X. Pennec, N. Ayache. SIAM J Matrix Anal Appl, 2007, 29 (1), pp. 328-347