function spd_truncated_svd

deeptime.numeric.spd_truncated_svd(mat, dim=None, eps=0.0)

Rank-reduced singular value decomposition of symmetric positive (semi-)definite matrix. The method yields for a matrix \(A\in\mathbb{R}^{n\times n}\) singular values \(s\in\mathbb{R}^d\) and singular vectors \(U\in\mathbb{R}^{n\times d}\) so that A approx Umathrm{diag}(x)U^top.

All the negligible components are removed from the spectrum. In case of dim being specified it keeps at most the dim dominant components but may remove even more, depending on the input matrix.

Eps influences the tolerance under which components are deemed negligible. In particular, if the product of eps and the largest singular value is larger than a component of the spectrum, it is removed.

Parameters:
  • mat ((n, n) ndarray) – Input matrix.

  • dim (int, optional, default=None) – The dimension.

  • eps (float, optional, default = 0) – Tolerance.

Returns:

  • s ((k, ) ndarray) – Leading singular values.

  • U ((n, k) ndarray) – Leading singular vectors.