Repository navigation
TST: Add test for PD hessian - #3099
Conversation
| Hinv = np.linalg.inv(-1 * self.hessian(xopt)) | ||
| except: | ||
| H = -1 * self.hessian(xopt) | ||
| w, v = np.linalg.eigh(H) |
There was a problem hiding this comment.
I usually prefer, evals, evecs = np.linalg.eigh... to remember which is which
There was a problem hiding this comment.
If we are already calculating the eigenvalues, then we should keep them.
I think we can add them to mlefit.mle_retvals, retvals see line 474 below
2a5fe13 to
e345b5b
Compare
Add test for PD hessian Raise if not PD before inversion closes statsmodels#3098 closes statsmodels#3094
Remove try, except in hessian inversion Add custom warning type for hessian inversion Add check for finite elements before computing eigenvalues
e345b5b to
605a006
Compare
|
backport label for kalman_loglike, |
|
I think it is pretty harmless and provides the user with more information. |
|
merged @bashtage Thank you I had forgotten that we might have negative eigenvalues in some cases, #3094. |
BUG/REF: hessian: check positive-definite and asfortranarray
Add test for PD hessian
Raise if not PD before inversion
closes #3098
closes #3094