pyriemann.utils.distance.distance_logeuclid¶
- pyriemann.utils.distance.distance_logeuclid(A, B, squared=False)¶
Log-Euclidean distance between SPD/HPD matrices.
The log-Euclidean distance between two SPD/HPD matrices \(\mathbf{A}\) and \(\mathbf{B}\) is [1]:
\[d(\mathbf{A},\mathbf{B}) = \Vert \log(\mathbf{A}) - \log(\mathbf{B}) \Vert_F\]- Parameters:
- Andarray, shape (…, n, n)
First SPD/HPD matrices, at least 2D ndarray.
- Bndarray, shape (…, n, n)
Second SPD/HPD matrices, same dimensions as A.
- squaredbool, default False
Return squared distance.
Added in version 0.5.
- Returns:
- dfloat or ndarray, shape (…,)
Log-Euclidean distance between A and B.
See also
References
[1]Geometric means in a novel vector space structure on symmetric positive-definite matrices V. Arsigny, P. Fillard, X. Pennec, N. Ayache. SIAM J Matrix Anal Appl, 2007, 29 (1), pp. 328-347