# pyriemann.utils.distance.distance_harmonic¶

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

Harmonic distance between invertible matrices.

The harmonic distance between two invertible 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 invertible matrices, at least 2D ndarray.

Bndarray, shape (…, n, n)

Second invertible matrices, same dimensions as A.

Returns
dndarray, shape (…,) or float

Harmonic distance between A and B.