Skip to content

Commit

Permalink
bug fix in multi_student_t mix test
Browse files Browse the repository at this point in the history
  • Loading branch information
SteveBronder committed Aug 14, 2023
1 parent 86b0594 commit 1e08001
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions stan/math/prim/prob/multi_normal_prec_lpdf.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ return_type_t<T_y, T_loc, T_covar> multi_normal_prec_lpdf(
auto&& y_ref = to_ref(y);
auto&& mu_ref = to_ref(mu);
lp_type lp(0);
vector_seq_view<T_y> y_vec(y_ref);
vector_seq_view<T_loc> mu_vec(mu_ref);
vector_seq_view<std::decay_t<decltype(y_ref)>> y_vec(y_ref);
vector_seq_view<std::decay_t<decltype(mu_ref)>> mu_vec(mu_ref);
size_t size_vec = max_size_mvt(y_ref, mu_ref);

int size_y = y_vec[0].size();
Expand Down
4 changes: 2 additions & 2 deletions test/unit/math/mix/prob/multi_student_t_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,15 @@ TEST(ProbDistributionsMultiStudentT, matvar) {
auto f_const_y = [](const auto& y) {
return [&y](const auto& nu, const auto& mu, const auto& sigma) {
auto&& sigma_ref = stan::math::to_ref(sigma);
auto sigma_sym = stan::math::multiply(0.5, sigma + sigma.transpose());
auto sigma_sym = stan::math::multiply(0.5, sigma_ref + sigma_ref.transpose());
return stan::math::multi_student_t_lpdf(y, nu, mu, sigma_sym);
};
};

auto f_const_nu = [](const auto& nu) {
return [&nu](const auto& y, const auto& mu, const auto& sigma) {
auto&& sigma_ref = stan::math::to_ref(sigma);
auto sigma_sym = stan::math::multiply(0.5, sigma + sigma.transpose());
auto sigma_sym = stan::math::multiply(0.5, sigma_ref + sigma_ref.transpose());
return stan::math::multi_student_t_lpdf(y, nu, mu, sigma_sym);
};
};
Expand Down

0 comments on commit 1e08001

Please sign in to comment.