pyriemann.utils.distance.distance_logeuclid

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

Log-Euclidean distance between SPD matrices.

The Log-Euclidean distance between two SPD matrices A and B is:

\[d(\mathbf{A},\mathbf{B}) = \Vert \log(\mathbf{A}) - \log(\mathbf{B}) \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

Log-Euclidean distance between A and B.