pyriemann.utils.distance.distance_logdet

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

Log-det distance between SPD matrices.

The log-det distance between two SPD matrices A and B is:

\[d(\mathbf{A},\mathbf{B}) = \sqrt{\log(\det(\frac{\mathbf{A}+\mathbf{B}}{2})) - \frac{1}{2} \log(\det(\mathbf{A} \mathbf{B}))}\]
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-det distance between A and B.