pyriemann.utils.geodesic.geodesic_logeuclid

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

Log-Euclidean geodesic between SPD matrices.

The matrix at the position alpha on the Log-Euclidean geodesic between two SPD matrices A and B is:

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

C is equal to A if alpha = 0 and B if alpha = 1.

Parameters
Andarray, shape (…, n, n)

First SPD matrices.

Bndarray, shape (…, n, n)

Second SPD matrices.

alphafloat, default=0.5

The position on the geodesic.

Returns
Cndarray, shape (…, n, n)

SPD matrices on the Log-Euclidean geodesic.