diff --git a/src/skmatter/utils/_sparsekde.py b/src/skmatter/utils/_sparsekde.py index 9554a4ea1..3d96d2f16 100644 --- a/src/skmatter/utils/_sparsekde.py +++ b/src/skmatter/utils/_sparsekde.py @@ -32,8 +32,9 @@ def effdim(cov): eigval = np.linalg.eigvals(cov) eigval /= sum(eigval) eigval *= np.log(eigval) - if (lowest_eigval := np.min(eigval)) <= -np.max(X.shape)*np.finfo(X.dtype).eps: - raise np.linalg.LinAlgError(f"Matrix is not positive definite. Lowest eigenvalue {lowest_eigval} is above numerical threshold.") + if (lowest_eigval := np.min(eigval)) <= -np.max(cov.shape)*np.finfo(cov.dtype).eps: + raise np.linalg.LinAlgError(f"Matrix is not positive definite. Lowest eigenvalue " + f"{lowest_eigval} is above numerical threshold.") eigval[eigval <= 0.] = 0.0 return np.exp(-sum(eigval))