skfolio.utils.stats.is_positive_semidefinite#

skfolio.utils.stats.is_positive_semidefinite(x, *, atol=0.0)[source]#

Return True if the matrix is positive semidefinite within a tolerance.

The caller must provide a finite, symmetric matrix.

Parameters:
xndarray of shape (n, n)

Matrix to check.

atolfloat, default=0.0

Nonnegative absolute tolerance. Eigenvalues greater than or equal to -atol are accepted.

Returns:
valuebool

True if all eigenvalues are at least -atol, False otherwise. Singular matrices are accepted.