spd_learn.functional.distance_chol#

spd_learn.functional.distance_chol(A, B, squared=False)[source]#

Cholesky distance between SPD/HPD matrices.

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

\[d(\mathbf{A},\mathbf{B}) = \Vert \text{chol}(\mathbf{A}) - \text{chol}(\mathbf{B}) \Vert_F\]
Parameters:
  • A (ndarray, shape (..., n, n)) – First SPD/HPD matrices.

  • B (ndarray, shape (..., n, n)) – Second SPD/HPD matrices, same dimensions as A.

  • squared (bool, default=False) – Return squared distance.

Returns:

d – Cholesky distance between A and B.

Return type:

float or ndarray, shape (…,)

Notes

Added in version 0.7.

Changed in version 0.12: Add support for NumPy and PyTorch.

See also

distance

References

[1]

Non-Euclidean statistics for covariance matrices, with applications to diffusion tensor imaging I.L. Dryden, A. Koloydenko, D. Zhou. Ann Appl Stat, 2009, 3(3), pp. 1102-1123.