pyriemann.utils.test.is_pos_def

pyriemann.utils.test.is_pos_def(X, tol=0.0, fast_mode=False)

Check if all matrices are positive definite (PD).

Check if all matrices are positive definite, fast verification is done with Cholesky decomposition, while full check compute all eigenvalues to verify that they are positive.

Parameters:
Xndarray, shape (…, n, n)

The set of square matrices, at least 2D ndarray.

tolfloat, default 0.0

Threshold below which eigen values are considered zero.

fast_modeboolean, default=False

Use Cholesky decomposition to avoid computing all eigenvalues.

Returns:
retboolean

True if all matrices are positive definite.