pyriemann.utils.distance.distance_logchol

pyriemann.utils.distance.distance_logchol(A, B, squared=False)

Log-Cholesky distance between SPD/HPD matrices.

The log-Cholesky distance between two SPD/HPD matrices \(\mathbf{A}\) and \(\mathbf{B}\) is [1]:

\[d(\mathbf{A},\mathbf{B}) = \left( \Vert \text{lower}(\text{chol}(\mathbf{A})) - \text{lower}(\text{chol}(\mathbf{B})) \Vert_F^2 + \Vert \log(\text{diag}(\text{chol}(\mathbf{A}))) - \log(\text{diag}(\text{chol}(\mathbf{B}))) \Vert_F^2 \right)^\frac{1}{2}\]
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.

Returns:
dfloat or ndarray, shape (…,)

Log-Cholesky distance between A and B.

See also

distance

Notes

Added in version 0.7.

References

[1]

Riemannian geometry of symmetric positive definite matrices via Cholesky decomposition Z. Lin. SIAM J Matrix Anal Appl, 2019, 40(4), pp. 1353-1370.