Skip to content
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

Closed
wants to merge 31 commits into from
Closed
Changes from 1 commit
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
689870e
update mvn to use mvn chol
spinkney Aug 29, 2021
43301e9
fix name error
spinkney Aug 29, 2021
1f145da
updates
spinkney Aug 29, 2021
94e1de7
Update multi_normal_lpdf.hpp
spinkney Aug 29, 2021
76202bb
update
spinkney Aug 29, 2021
b494cf8
Update multi_normal_lpdf.hpp
spinkney Aug 29, 2021
0ddcd07
[Jenkins] auto-formatting by clang-format version 6.0.0-1ubuntu2~16.0…
stan-buildbot Aug 29, 2021
c8b5721
add ops and partials to include
spinkney Aug 29, 2021
37d096d
Merge branch 'multi_normal_derivatives' of https://github.com/spinkne…
spinkney Aug 29, 2021
a31b732
more includes
spinkney Aug 29, 2021
0e2c9f0
Daniel's help
spinkney Sep 2, 2021
8013fc6
got it working
spinkney Sep 2, 2021
98f4d34
Merge commit '6ec156000d25f0ae5ba2e329583b08c7d609a6a0' into HEAD
yashikno Sep 2, 2021
2c5caf9
[Jenkins] auto-formatting by clang-format version 6.0.0-1ubuntu2~16.0…
stan-buildbot Sep 2, 2021
be5d702
just call multi_normal_cholesky_lpdf
spinkney Sep 2, 2021
e70eefc
[Jenkins] auto-formatting by clang-format version 6.0.0-1ubuntu2~16.0…
stan-buildbot Sep 2, 2021
045548e
removing unused vars
spinkney Sep 2, 2021
115e059
add T_return
spinkney Sep 2, 2021
5a08610
updated typo
spinkney Sep 5, 2021
f3e83d1
Merge commit 'd59561bbe8fc53f5c32d592ef5f43c162e806940' into HEAD
yashikno Sep 5, 2021
f29b9e9
[Jenkins] auto-formatting by clang-format version 6.0.0-1ubuntu2~16.0…
stan-buildbot Sep 5, 2021
3695b9a
Delete tests0_test.cpp
spinkney Sep 9, 2021
d0c60f4
review updates
spinkney Sep 9, 2021
d80ad31
Update multi_normal_lpdf.hpp
spinkney Sep 9, 2021
eda6111
Merge commit 'b9f683599349a2ba7746f54e6f95ce254d3201cf' into HEAD
yashikno Sep 9, 2021
18f82c4
[Jenkins] auto-formatting by clang-format version 6.0.0-1ubuntu2~16.0…
stan-buildbot Sep 9, 2021
2c6fb4a
Update multi_normal_lpdf.hpp
spinkney Apr 19, 2022
d982680
Merge commit '355463dfab94eb0e4e4b5e2a4d447724cd32d2f8' into HEAD
yashikno Apr 19, 2022
3e5f61b
[Jenkins] auto-formatting by clang-format version 10.0.0-4ubuntu1
stan-buildbot Apr 19, 2022
c83cbb1
header fix
spinkney Apr 19, 2022
f2c8672
Merge branch 'multi_normal_derivatives' of https://github.com/spinkne…
spinkney Apr 19, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Update multi_normal_lpdf.hpp
  • Loading branch information
spinkney committed Aug 29, 2021
commit 94e1de79d56fea01b6a207625affcd26e0943ba8
28 changes: 6 additions & 22 deletions stan/math/prim/prob/multi_normal_lpdf.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -77,23 +77,7 @@ return_type_t<T_y, T_loc, T_covar> multi_normal_lpdf(const T_y& y,

auto L_Sigma = cholesky(Sigma_ref);

if (size_y == 0) {
return lp;
}

if (include_summand<propto>::value) {
lp += NEG_LOG_SQRT_TWO_PI * size_y * size_vec;
}

if (include_summand<propto, T_covar_elem>::value) {
lp -= 0.5 * log_determinant_ldlt(ldlt_Sigma) * size_vec;
}

template <typename T_y, typename T_loc, typename T_covar>
inline return_type_t<T_y, T_loc, T_covar> multi_normal_cholesky_lpdf(
const T_y& y, const T_loc& mu, const T_covar& L) {
return multi_normal_cholesky_lpdf<false>(y, mu, L);
}


// auto ldlt_Sigma = make_ldlt_factor(Sigma_ref);
// check_ldlt_factor(function, "LDLT_Factor of covariance parameter",
Expand Down Expand Up @@ -123,11 +107,11 @@ inline return_type_t<T_y, T_loc, T_covar> multi_normal_cholesky_lpdf(
// return lp;
// }

// template <typename T_y, typename T_loc, typename T_covar>
// inline return_type_t<T_y, T_loc, T_covar> multi_normal_lpdf(
// const T_y& y, const T_loc& mu, const T_covar& Sigma) {
// return multi_normal_lpdf<false>(y, mu, Sigma);
// }
template <typename T_y, typename T_loc, typename T_covar>
inline return_type_t<T_y, T_loc, T_covar> multi_normal_lpdf(
const T_y& y, const T_loc& mu, const T_covar& L_Sigma) {
return multi_normal_cholesky_lpdf<false>(y, mu, L_Sigma);
}

} // namespace math
} // namespace stan
Expand Down