From 1e08001971526a8598a616daa56d59fbf1a75099 Mon Sep 17 00:00:00 2001 From: Steve Bronder Date: Mon, 14 Aug 2023 17:18:24 -0400 Subject: [PATCH] bug fix in multi_student_t mix test --- stan/math/prim/prob/multi_normal_prec_lpdf.hpp | 4 ++-- test/unit/math/mix/prob/multi_student_t_test.cpp | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/stan/math/prim/prob/multi_normal_prec_lpdf.hpp b/stan/math/prim/prob/multi_normal_prec_lpdf.hpp index b2f2639e7be..37aa52baf0c 100644 --- a/stan/math/prim/prob/multi_normal_prec_lpdf.hpp +++ b/stan/math/prim/prob/multi_normal_prec_lpdf.hpp @@ -35,8 +35,8 @@ return_type_t multi_normal_prec_lpdf( auto&& y_ref = to_ref(y); auto&& mu_ref = to_ref(mu); lp_type lp(0); - vector_seq_view y_vec(y_ref); - vector_seq_view mu_vec(mu_ref); + vector_seq_view> y_vec(y_ref); + vector_seq_view> mu_vec(mu_ref); size_t size_vec = max_size_mvt(y_ref, mu_ref); int size_y = y_vec[0].size(); diff --git a/test/unit/math/mix/prob/multi_student_t_test.cpp b/test/unit/math/mix/prob/multi_student_t_test.cpp index acf97298591..350d9583e4d 100644 --- a/test/unit/math/mix/prob/multi_student_t_test.cpp +++ b/test/unit/math/mix/prob/multi_student_t_test.cpp @@ -12,7 +12,7 @@ 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); }; }; @@ -20,7 +20,7 @@ TEST(ProbDistributionsMultiStudentT, matvar) { 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); }; };