From ddd12a391f56ad46522080e6dc8eacee5cb1e238 Mon Sep 17 00:00:00 2001 From: Daniel Lee Date: Wed, 3 Jan 2024 02:12:47 -0500 Subject: [PATCH] updating tests after removing _log() probability functions --- stan/math/prim/prob.hpp | 67 ------------------- .../math/prim/prob/lkj_corr_cholesky_lpdf.hpp | 1 - stan/math/prim/prob/logistic_cdf.hpp | 8 +-- stan/math/prim/prob/logistic_lccdf.hpp | 8 +-- stan/math/prim/prob/logistic_lcdf.hpp | 8 +-- stan/math/prim/prob/multi_student_t_lpdf.hpp | 1 - test/prob/beta/beta_test.hpp | 2 +- test/unit/math_include_test.cpp | 2 +- 8 files changed, 14 insertions(+), 83 deletions(-) diff --git a/stan/math/prim/prob.hpp b/stan/math/prim/prob.hpp index 70aafe82422..9466bea1450 100644 --- a/stan/math/prim/prob.hpp +++ b/stan/math/prim/prob.hpp @@ -6,11 +6,8 @@ #include #include #include -#include -#include #include #include -#include #include #include #include @@ -20,7 +17,6 @@ #include #include #include -#include #include #include #include @@ -28,13 +24,11 @@ #include #include #include -#include #include #include #include #include #include -#include #include #include #include @@ -43,15 +37,11 @@ #include #include #include -#include -#include #include #include #include #include -#include #include -#include #include #include #include @@ -61,7 +51,6 @@ #include #include #include -#include #include #include #include @@ -69,12 +58,9 @@ #include #include #include -#include #include #include -#include #include -#include #include #include #include @@ -83,7 +69,6 @@ #include #include #include -#include #include #include #include @@ -91,7 +76,6 @@ #include #include #include -#include #include #include #include @@ -99,7 +83,6 @@ #include #include #include -#include #include #include #include @@ -107,7 +90,6 @@ #include #include #include -#include #include #include #include @@ -115,7 +97,6 @@ #include #include #include -#include #include #include #include @@ -123,10 +104,8 @@ #include #include #include -#include #include #include -#include #include #include #include @@ -134,13 +113,11 @@ #include #include #include -#include #include #include #include #include #include -#include #include #include #include @@ -148,7 +125,6 @@ #include #include #include -#include #include #include #include @@ -156,32 +132,25 @@ #include #include #include -#include #include #include #include #include -#include #include #include -#include #include #include -#include #include #include -#include #include #include #include #include #include #include -#include #include #include #include -#include #include #include #include @@ -189,34 +158,24 @@ #include #include #include -#include #include #include -#include #include #include -#include #include -#include #include -#include #include #include -#include #include -#include #include #include #include #include #include -#include #include #include -#include #include #include -#include #include #include #include @@ -224,10 +183,7 @@ #include #include #include -#include -#include #include -#include #include #include #include @@ -237,26 +193,20 @@ #include #include #include -#include #include #include #include #include #include -#include #include #include #include -#include #include #include -#include #include #include -#include #include #include -#include #include #include #include @@ -264,7 +214,6 @@ #include #include #include -#include #include #include #include @@ -272,7 +221,6 @@ #include #include #include -#include #include #include #include @@ -280,7 +228,6 @@ #include #include #include -#include #include #include #include @@ -288,10 +235,7 @@ #include #include #include -#include -#include #include -#include #include #include #include @@ -301,7 +245,6 @@ #include #include #include -#include #include #include #include @@ -309,7 +252,6 @@ #include #include #include -#include #include #include #include @@ -318,14 +260,12 @@ #include #include #include -#include #include #include #include #include #include #include -#include #include #include #include @@ -333,7 +273,6 @@ #include #include #include -#include #include #include #include @@ -342,7 +281,6 @@ #include #include #include -#include #include #include #include @@ -350,10 +288,8 @@ #include #include #include -#include #include #include -#include #include #include #include @@ -366,14 +302,11 @@ #include #include #include -#include #include #include -#include #include #include #include -#include #include #include diff --git a/stan/math/prim/prob/lkj_corr_cholesky_lpdf.hpp b/stan/math/prim/prob/lkj_corr_cholesky_lpdf.hpp index 878541a8502..97233e2c6ee 100644 --- a/stan/math/prim/prob/lkj_corr_cholesky_lpdf.hpp +++ b/stan/math/prim/prob/lkj_corr_cholesky_lpdf.hpp @@ -7,7 +7,6 @@ #include #include #include -#include namespace stan { namespace math { diff --git a/stan/math/prim/prob/logistic_cdf.hpp b/stan/math/prim/prob/logistic_cdf.hpp index 9250b6036d3..eef0d128958 100644 --- a/stan/math/prim/prob/logistic_cdf.hpp +++ b/stan/math/prim/prob/logistic_cdf.hpp @@ -11,7 +11,7 @@ #include #include #include -#include +#include #include #include @@ -78,16 +78,16 @@ return_type_t logistic_cdf(const T_y& y, const T_loc& mu, if (!is_constant_all::value) { partials<0>(ops_partials)[n] - += exp(logistic_log(y_dbl, mu_dbl, sigma_dbl)) / Pn; + += exp(logistic_lpdf(y_dbl, mu_dbl, sigma_dbl)) / Pn; } if (!is_constant_all::value) { partials<1>(ops_partials)[n] - += -exp(logistic_log(y_dbl, mu_dbl, sigma_dbl)) / Pn; + += -exp(logistic_lpdf(y_dbl, mu_dbl, sigma_dbl)) / Pn; } if (!is_constant_all::value) { partials<2>(ops_partials)[n] += -(y_dbl - mu_dbl) * sigma_inv_vec - * exp(logistic_log(y_dbl, mu_dbl, sigma_dbl)) / Pn; + * exp(logistic_lpdf(y_dbl, mu_dbl, sigma_dbl)) / Pn; } } diff --git a/stan/math/prim/prob/logistic_lccdf.hpp b/stan/math/prim/prob/logistic_lccdf.hpp index 95bb142fc39..25763a63b34 100644 --- a/stan/math/prim/prob/logistic_lccdf.hpp +++ b/stan/math/prim/prob/logistic_lccdf.hpp @@ -12,7 +12,7 @@ #include #include #include -#include +#include #include #include @@ -79,16 +79,16 @@ return_type_t logistic_lccdf(const T_y& y, const T_loc& mu, if (!is_constant_all::value) { partials<0>(ops_partials)[n] - -= exp(logistic_log(y_dbl, mu_dbl, sigma_dbl)) / Pn; + -= exp(logistic_lpdf(y_dbl, mu_dbl, sigma_dbl)) / Pn; } if (!is_constant_all::value) { partials<1>(ops_partials)[n] - -= -exp(logistic_log(y_dbl, mu_dbl, sigma_dbl)) / Pn; + -= -exp(logistic_lpdf(y_dbl, mu_dbl, sigma_dbl)) / Pn; } if (!is_constant_all::value) { partials<2>(ops_partials)[n] -= -(y_dbl - mu_dbl) * sigma_inv_vec - * exp(logistic_log(y_dbl, mu_dbl, sigma_dbl)) / Pn; + * exp(logistic_lpdf(y_dbl, mu_dbl, sigma_dbl)) / Pn; } } return ops_partials.build(P); diff --git a/stan/math/prim/prob/logistic_lcdf.hpp b/stan/math/prim/prob/logistic_lcdf.hpp index 0b221124667..ce86d2d381c 100644 --- a/stan/math/prim/prob/logistic_lcdf.hpp +++ b/stan/math/prim/prob/logistic_lcdf.hpp @@ -12,7 +12,7 @@ #include #include #include -#include +#include #include #include @@ -78,16 +78,16 @@ return_type_t logistic_lcdf(const T_y& y, const T_loc& mu, if (!is_constant_all::value) { partials<0>(ops_partials)[n] - += exp(logistic_log(y_dbl, mu_dbl, sigma_dbl)) / Pn; + += exp(logistic_lpdf(y_dbl, mu_dbl, sigma_dbl)) / Pn; } if (!is_constant_all::value) { partials<1>(ops_partials)[n] - += -exp(logistic_log(y_dbl, mu_dbl, sigma_dbl)) / Pn; + += -exp(logistic_lpdf(y_dbl, mu_dbl, sigma_dbl)) / Pn; } if (!is_constant_all::value) { partials<2>(ops_partials)[n] += -(y_dbl - mu_dbl) * sigma_inv_vec - * exp(logistic_log(y_dbl, mu_dbl, sigma_dbl)) / Pn; + * exp(logistic_lpdf(y_dbl, mu_dbl, sigma_dbl)) / Pn; } } return ops_partials.build(P); diff --git a/stan/math/prim/prob/multi_student_t_lpdf.hpp b/stan/math/prim/prob/multi_student_t_lpdf.hpp index a5eaef677bc..ef7111d3ba7 100644 --- a/stan/math/prim/prob/multi_student_t_lpdf.hpp +++ b/stan/math/prim/prob/multi_student_t_lpdf.hpp @@ -13,7 +13,6 @@ #include #include #include -#include #include #include diff --git a/test/prob/beta/beta_test.hpp b/test/prob/beta/beta_test.hpp index 94315dd8c9d..6bc07a43383 100644 --- a/test/prob/beta/beta_test.hpp +++ b/test/prob/beta/beta_test.hpp @@ -1,5 +1,5 @@ // Arguments: Doubles, Doubles, Doubles -#include +#include #include #include diff --git a/test/unit/math_include_test.cpp b/test/unit/math_include_test.cpp index ecebf955cd2..d325a216f58 100644 --- a/test/unit/math_include_test.cpp +++ b/test/unit/math_include_test.cpp @@ -68,7 +68,7 @@ TEST_F(Math, paper_example_3) { double y = 1.3; stan::math::var mu = 0.5, sigma = 1.2; - stan::math::var lp = normal_log(y, mu, sigma); + stan::math::var lp = normal_lpdf(y, mu, sigma); EXPECT_FLOAT_EQ(-1.323482, lp.val()); }