Skip to content

Commit

Permalink
fix vector lambda bug
Browse files Browse the repository at this point in the history
  • Loading branch information
n8thangreen committed Sep 15, 2024
1 parent 71f2e58 commit 022bc67
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions R/stan_code_blocks.R
Original file line number Diff line number Diff line change
Expand Up @@ -75,9 +75,7 @@ make_latent_model_code <- function(model, id = 1L) {

scode$trans_params_main <-
glue("lambda_{id} = exp(lp_{id});\n",
"if (lambda_{id} > 100) {{ // arbitrarily choose a reasonable upper bound\n",
" lambda_{id} = 100;\n",
"}\n")
"lambda_{id} = min(lambda_{id}, 100);\n")

scode$model <-
glue("shape_{id} ~ gamma(a_shape_{id}, b_shape_{id});\n")
Expand Down

0 comments on commit 022bc67

Please sign in to comment.