-
Notifications
You must be signed in to change notification settings - Fork 39
Fix LKJ numerical stability with PDMats #395
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
Bijectors.jl documentation for PR #395 is available at: |
Co-authored-by: David Widmann <devmotion@users.noreply.github.com>
# # Because `ReverseDiff` does not play well with structural matrices. | ||
lower_triangular(A::AbstractMatrix) = convert(typeof(A), LowerTriangular(A)) | ||
upper_triangular(A::AbstractMatrix) = convert(typeof(A), UpperTriangular(A)) | ||
|
||
# TODO: Replace remaining uses of `pd_from_{lower,upper}` with |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this a big task / will it be part of this PR?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think so. That's partly why I kept this PR marked as a draft and didn't request reviews. (The other reason is the failing tests)
Closes #387. Turns out that a different matrix type that allows for numerically stable determinants already exists, and it's
PDMats.PDMat
. Credit to @mhauru for the suggestion.