Sometimes, we may get a singular matrix as the covariance. The inv_cov won't work. Is it correct to use np.linalg.pinv instead of np.linalg.inv for this kind of case?
np.linalg.pinv
np.linalg.inv