-
-
Notifications
You must be signed in to change notification settings - Fork 183
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 student t cholesky derivatives #2990
Conversation
matrix_partials_t L_deriv(num_dims, num_dims); | ||
L_deriv.setZero(); |
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.
@SteveBronder I couldn't find a way to conditionally create this partial matrix. I wanted to do something like
const auto& L_deriv
= to_ref_if<include_summand<propto, T_covar_elem>::value>(Eigen::MatrixXd::Zero(num_dims, num_dims));
Since this matrix only needs to get created when that condition passes. However, I can't just wrap it in a conditional because Eigen complains that the matrix isn't available further down the code in the loop.
…-dev/math into multi-student-t-derivatives
…-dev/math into multi-student-t-derivatives
@spinkney is this ready for review? |
Yep! |
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.
Two small optionals but overall good!
|
||
for (size_t i = 1, size_mvt_y = num_y; i < size_mvt_y; i++) { | ||
check_size_match( | ||
function, "Size of one of the vectors of the random variable", | ||
y_vec[i].size(), "Size of another vector of the random variable", | ||
y_vec[i].size(), "Size of the first vector of the random variable", |
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.
Isn't it the previous one? I think leaving it as another would be good
if (unlikely(num_dims == 0)) { | ||
return T_return(0); | ||
} |
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.
Can you move this up to just check this right after declaring num_dims
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.
Resolved merge conflicts with develop and applied @SteveBronder's suggestions, will merge when tests pass
Jenkins Console Log Machine informationNo LSB modules are available. Distributor ID: Ubuntu Description: Ubuntu 20.04.3 LTS Release: 20.04 Codename: focalCPU: G++: Clang: |
Summary
This adds derivatives for the
multi_student_t_cholesky_lpdf
.Tests
Added a mix test.
Side Effects
No.
Release notes
Adds derivatives for the
multi_student_t_cholesky_lpdf
Checklist
Copyright 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