pyriemann.utils.geodesic.geodesic_logeuclid

pyriemann.utils.geodesic.geodesic_logeuclid(A, B, alpha=0.5)

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, default=0.5

Position on the geodesic.

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

SPD/HPD matrices on the Log-Euclidean geodesic.