Issue
I need to find out if matrix is positive definite. My matrix is numpy matrix. I was expecting to find any related method in numpy library, but no success. I appreciate any help.
Solution
You can also check if all the eigenvalues of matrix are positive, if so the matrix is positive definite:
import numpy as np
def is_pos_def(x):
return np.all(np.linalg.eigvals(x) > 0)
Answered By - Akavall
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.