pyriemann.utils.distance.distance_harmonic

pyriemann.utils.distance.distance_harmonic(A, B)

Harmonic distance between SPD matrices.

The harmonic distance between two SPD matrices A and B is:

\[d(\mathbf{A},\mathbf{B}) = \Vert \mathbf{A}^{-1} - \mathbf{B}^{-1} \Vert_F\]
Parameters
Andarray, shape (…, n, n)

First SPD matrices, at least 2D ndarray.

Bndarray, shape (…, n, n)

Second SPD matrices, same dimensions as A.

Returns
dndarray, shape (…,) or float

Harmonic distance between A and B.