-
-
Notifications
You must be signed in to change notification settings - Fork 186
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
Multi normal derivatives #2572
Multi normal derivatives #2572
Conversation
…4.1 (tags/RELEASE_600/final)
…y/math into multi_normal_derivatives
…4.1 (tags/RELEASE_600/final)
Thanks Daniel!
…4.1 (tags/RELEASE_600/final)
…4.1 (tags/RELEASE_600/final)
@SteveBronder or @bob-carpenter , everything is working well except that the expression_tests fail for I assume that if the expression_tests got to I think the issue is that there are some legacy signatures in |
The one issue is the failing expression test. The issue is that the multi normal is testing the expression @rok-cesnovar is this a stanc required change? |
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.
These expression failures were legit. Suggesting changes that make them pass at least locally for multi_normal_lpdf.
The expressions are now handled properly. @bob-carpenter would you have time to review this? You definitely know more about these multi normal lpdf than me. |
Jenkins Console Log Machine informationProductName: Mac OS X ProductVersion: 10.11.6 BuildVersion: 15G22010CPU: G++: Clang: |
This is ready, @bob-carpenter will you have time to look prior to the feature freeze? |
I'm heading out of town on vacation for a few days, so I won't be able to review until next Tuesday at the earliest. |
No worries, enjoy your vacation! |
@spinkney mind merging in develop here? We should get this in for the next release. |
@rok-cesnovar can you restart the CI/jenkins process? Once that finishes I can merge in |
@rok-cesnovar (or @bob-carpenter or @bgoodri) I updated this to use the |
…y/math into multi_normal_derivatives
Taking the square root is where most of the precision gained from using LDLT gets lost. There should be a way to differentiate with respect to the diagonal elements of D directly. |
Ok, then I may as well have kept it simple by taking the cholesky decomposition and passing that to The way I think this should be done is to create a |
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.
Looks ok to me. @spinkney, is this still something that you're good with?
@spinkney, I didn't realize this was a draft. Let me know what you think. |
The issue is that the cholesky decomposition is less stable than the ldlt so I'm waiting until tuples get in the language or once someone implements ldlt with derivatives. |
Summary
This shows that
multi_normal
should just take the cholesky decomposition and callmulti_normal_cholesky
.I just copied all the
multi_normal_cholesky_lpdf
code over. I wasn't sure how to just call it. That should be updated. The unit tests that callmulti_normal_log
fail.Question: Would it be better to form the cholesky decomposition using
ldlt
instead ofcholesky_decompose()
?Tests
No new tests.
Here's a benchmark vs the current
multi_normal_lpdf
Side Effects
None
Release notes
multi_normal_lpdf
now takes the Cholesky decomposition of the covariance matrix and callsmulti_normal_cholesky_lpdf
under the hoodChecklist
Math issue Update
multi_normal
to callmulti_normal_cholesky
after the cholesky #2544Copyright holder: Sean Pinkney
The copyright holder is typically you or your assignee, such as a university or company. By submitting this pull request, the copyright holder is agreeing to the license the submitted work under the following licenses:
- Code: BSD 3-clause (https://opensource.org/licenses/BSD-3-Clause)
- Documentation: CC-BY 4.0 (https://creativecommons.org/licenses/by/4.0/)
the basic tests are passing
./runTests.py test/unit
)make test-headers
)make test-math-dependencies
)make doxygen
)make cpplint
)the code is written in idiomatic C++ and changes are documented in the doxygen
the new changes are tested