From 5e104ca525649b4d194400b70eb42ad92cbf60b7 Mon Sep 17 00:00:00 2001 From: Rok Cesnovar Date: Sun, 2 Jan 2022 16:47:09 +0100 Subject: [PATCH 1/2] add missing normal_id_glm signatures --- src/middle/Stan_math_signatures.ml | 20 +++++++++++++++++++ .../continuous/normal/normal_id_glm.stan | 9 ++++++++- 2 files changed, 28 insertions(+), 1 deletion(-) diff --git a/src/middle/Stan_math_signatures.ml b/src/middle/Stan_math_signatures.ml index 2c10eb52c6..4abec7b8b1 100644 --- a/src/middle/Stan_math_signatures.ml +++ b/src/middle/Stan_math_signatures.ml @@ -1688,6 +1688,16 @@ let () = , ReturnType UReal , [UVector; UMatrix; UVector; UVector; UReal] , AoS ) ; + add_unqualified + ( "normal_id_glm_lpdf" + , ReturnType UReal + , [UReal; UMatrix; UReal; UVector; UReal] + , AoS ) ; + add_unqualified + ( "normal_id_glm_lpdf" + , ReturnType UReal + , [UReal; UMatrix; UVector; UVector; UReal] + , AoS ) ; add_unqualified ( "normal_id_glm_lpdf" , ReturnType UReal @@ -1703,11 +1713,21 @@ let () = , ReturnType UReal , [UVector; URowVector; UReal; UVector; UVector] , AoS ) ; + add_unqualified + ( "normal_id_glm_lpdf" + , ReturnType UReal + , [UVector; URowVector; UVector; UVector; UReal] + , AoS ) ; add_unqualified ( "normal_id_glm_lpdf" , ReturnType UReal , [UVector; URowVector; UVector; UVector; UVector] , AoS ) ; + add_unqualified + ( "normal_id_glm_lpdf" + , ReturnType UReal + , [UVector; URowVector; UReal; UVector; UReal] + , AoS ) ; add_nullary "not_a_number" ; add_unqualified ("num_elements", ReturnType UInt, [UMatrix], AoS) ; add_unqualified ("num_elements", ReturnType UInt, [UVector], AoS) ; diff --git a/test/integration/good/function-signatures/distributions/univariate/continuous/normal/normal_id_glm.stan b/test/integration/good/function-signatures/distributions/univariate/continuous/normal/normal_id_glm.stan index 37a8cfadab..223b1d0a29 100644 --- a/test/integration/good/function-signatures/distributions/univariate/continuous/normal/normal_id_glm.stan +++ b/test/integration/good/function-signatures/distributions/univariate/continuous/normal/normal_id_glm.stan @@ -15,8 +15,12 @@ transformed data { transformed_data_real = normal_id_glm_lpdf(d_y_v| d_x_m, d_alpha_v, d_beta_v, d_phi); transformed_data_real = normal_id_glm_lpdf(d_y| d_x_m, d_alpha, d_beta_v, d_phi_v); transformed_data_real = normal_id_glm_lpdf(d_y| d_x_m, d_alpha_v, d_beta_v, d_phi_v); + transformed_data_real = normal_id_glm_lpdf(d_y| d_x_m, d_alpha, d_beta_v, d_phi); + transformed_data_real = normal_id_glm_lpdf(d_y| d_x_m, d_alpha_v, d_beta_v, d_phi); transformed_data_real = normal_id_glm_lpdf(d_y_v| d_x_rv, d_alpha, d_beta_v, d_phi_v); transformed_data_real = normal_id_glm_lpdf(d_y_v| d_x_rv, d_alpha_v, d_beta_v, d_phi_v); + transformed_data_real = normal_id_glm_lpdf(d_y_v| d_x_rv, d_alpha, d_beta_v, d_phi); + transformed_data_real = normal_id_glm_lpdf(d_y_v| d_x_rv, d_alpha_v, d_beta_v, d_phi); } parameters { real p_y; @@ -36,10 +40,13 @@ transformed parameters { transformed_param_real = normal_id_glm_lpdf(p_y_v| p_x_m, p_alpha_v, p_beta_v, p_phi); transformed_param_real = normal_id_glm_lpdf(p_y| p_x_m, p_alpha, p_beta_v, p_phi_v); transformed_param_real = normal_id_glm_lpdf(p_y| p_x_m, p_alpha_v, p_beta_v, p_phi_v); + transformed_param_real = normal_id_glm_lpdf(p_y| p_x_m, p_alpha_v, p_beta_v, p_phi); + transformed_param_real = normal_id_glm_lpdf(p_y| p_x_m, p_alpha, p_beta_v, p_phi); transformed_param_real = normal_id_glm_lpdf(p_y_v| p_x_rv, p_alpha, p_beta_v, p_phi_v); transformed_param_real = normal_id_glm_lpdf(p_y_v| p_x_rv, p_alpha_v, p_beta_v, p_phi_v); + transformed_param_real = normal_id_glm_lpdf(p_y_v| p_x_rv, p_alpha, p_beta_v, p_phi); + transformed_param_real = normal_id_glm_lpdf(p_y_v| p_x_rv, p_alpha_v, p_beta_v, p_phi); } model { y_p ~ normal(0, 1); } - From 6942b0cc58bab4d25c7c1eab3e8a0632b25fbb75 Mon Sep 17 00:00:00 2001 From: Rok Cesnovar Date: Sun, 2 Jan 2022 17:41:54 +0100 Subject: [PATCH 2/2] dune promote --- .../univariate/continuous/normal/pretty.expected | 8 ++++++++ test/integration/signatures/stan_math_signatures.t | 4 ++++ 2 files changed, 12 insertions(+) diff --git a/test/integration/good/function-signatures/distributions/univariate/continuous/normal/pretty.expected b/test/integration/good/function-signatures/distributions/univariate/continuous/normal/pretty.expected index 84e807f7e8..2bfb559c1f 100644 --- a/test/integration/good/function-signatures/distributions/univariate/continuous/normal/pretty.expected +++ b/test/integration/good/function-signatures/distributions/univariate/continuous/normal/pretty.expected @@ -896,8 +896,12 @@ transformed data { transformed_data_real = normal_id_glm_lpdf(d_y_v | d_x_m, d_alpha_v, d_beta_v, d_phi); transformed_data_real = normal_id_glm_lpdf(d_y | d_x_m, d_alpha, d_beta_v, d_phi_v); transformed_data_real = normal_id_glm_lpdf(d_y | d_x_m, d_alpha_v, d_beta_v, d_phi_v); + transformed_data_real = normal_id_glm_lpdf(d_y | d_x_m, d_alpha, d_beta_v, d_phi); + transformed_data_real = normal_id_glm_lpdf(d_y | d_x_m, d_alpha_v, d_beta_v, d_phi); transformed_data_real = normal_id_glm_lpdf(d_y_v | d_x_rv, d_alpha, d_beta_v, d_phi_v); transformed_data_real = normal_id_glm_lpdf(d_y_v | d_x_rv, d_alpha_v, d_beta_v, d_phi_v); + transformed_data_real = normal_id_glm_lpdf(d_y_v | d_x_rv, d_alpha, d_beta_v, d_phi); + transformed_data_real = normal_id_glm_lpdf(d_y_v | d_x_rv, d_alpha_v, d_beta_v, d_phi); } parameters { real p_y; @@ -917,8 +921,12 @@ transformed parameters { transformed_param_real = normal_id_glm_lpdf(p_y_v | p_x_m, p_alpha_v, p_beta_v, p_phi); transformed_param_real = normal_id_glm_lpdf(p_y | p_x_m, p_alpha, p_beta_v, p_phi_v); transformed_param_real = normal_id_glm_lpdf(p_y | p_x_m, p_alpha_v, p_beta_v, p_phi_v); + transformed_param_real = normal_id_glm_lpdf(p_y | p_x_m, p_alpha_v, p_beta_v, p_phi); + transformed_param_real = normal_id_glm_lpdf(p_y | p_x_m, p_alpha, p_beta_v, p_phi); transformed_param_real = normal_id_glm_lpdf(p_y_v | p_x_rv, p_alpha, p_beta_v, p_phi_v); transformed_param_real = normal_id_glm_lpdf(p_y_v | p_x_rv, p_alpha_v, p_beta_v, p_phi_v); + transformed_param_real = normal_id_glm_lpdf(p_y_v | p_x_rv, p_alpha, p_beta_v, p_phi); + transformed_param_real = normal_id_glm_lpdf(p_y_v | p_x_rv, p_alpha_v, p_beta_v, p_phi); } model { y_p ~ normal(0, 1); diff --git a/test/integration/signatures/stan_math_signatures.t b/test/integration/signatures/stan_math_signatures.t index d1b6f5e081..ca09b56951 100644 --- a/test/integration/signatures/stan_math_signatures.t +++ b/test/integration/signatures/stan_math_signatures.t @@ -15284,9 +15284,13 @@ Display all Stan math signatures exposed in the language normal_cdf_log(array[] real, array[] real, vector) => real normal_cdf_log(array[] real, array[] real, row_vector) => real normal_cdf_log(array[] real, array[] real, array[] real) => real + normal_id_glm_lpdf(real, matrix, real, vector, real) => real normal_id_glm_lpdf(real, matrix, real, vector, vector) => real + normal_id_glm_lpdf(real, matrix, vector, vector, real) => real normal_id_glm_lpdf(real, matrix, vector, vector, vector) => real + normal_id_glm_lpdf(vector, row_vector, real, vector, real) => real normal_id_glm_lpdf(vector, row_vector, real, vector, vector) => real + normal_id_glm_lpdf(vector, row_vector, vector, vector, real) => real normal_id_glm_lpdf(vector, row_vector, vector, vector, vector) => real normal_id_glm_lpdf(vector, matrix, real, vector, real) => real normal_id_glm_lpdf(vector, matrix, vector, vector, real) => real