pyriemann.utils.geodesic.geodesic_riemann

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

Affine-invariant Riemannian geodesic between SPD matrices.

The matrix at the position alpha on the affine-invariant Riemannian geodesic between two SPD matrices A and B is:

\[\mathbf{C} = \mathbf{A}^{1/2} \left( \mathbf{A}^{-1/2} \mathbf{B} \mathbf{A}^{-1/2} \right)^\alpha \mathbf{A}^{1/2}\]

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 affine-invariant Riemannian geodesic.