Skip to content

Commit 8e7a88d

Browse files
committed
the model runs but its not picking up any cure fraction. I've tried some edge case input values but nothing is changing in the output??..
1 parent d117a60 commit 8e7a88d

File tree

3 files changed

+418
-4
lines changed

3 files changed

+418
-4
lines changed

R/bmcm_stan.R

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,8 @@ bmcm_stan <- function(input_data,
4040
bg_varname = "bg_rate",
4141
bg_hr = 1,
4242
t_max = 70,
43+
save_stan_code = FALSE,
44+
read_stan_code = FALSE,
4345
...) {
4446
call <- match.call()
4547
rtn_wd <- getwd()
@@ -143,9 +145,14 @@ bmcm_stan <- function(input_data,
143145
stan_inputs$model_code <- create_stancode(distns)
144146

145147
## for testing
146-
# writeLines(stan_inputs$model_code, con = here::here("data/stan_model_code.stan"))
147-
# model_code <- readr::read_file(here::here("data/stan_model_code_test.stan"))
148-
# stan_inputs$model_code <- model_code
148+
if (save_stan_code) {
149+
writeLines(stan_inputs$model_code, con = here::here("data/stan_model_code.stan"))
150+
}
151+
152+
if (read_stan_code) {
153+
model_code <- readr::read_file(here::here("data/stan_model_code.stan"))
154+
stan_inputs$model_code <- model_code
155+
}
149156

150157
res <- list()
151158

R/default_prior_cure.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ default_prior_cure <- function(formula_cure,
1717
n_groups <- formula_cure$n_groups
1818
nvars <- formula_cure$nvars
1919

20-
# treatment fixed effect
20+
# treatment fixed effect on cure fraction
2121
mu_alpha_fe <- rep(-1, nTx)
2222
sigma_alpha_fe <- rep(0.5, nTx)
2323

0 commit comments

Comments
 (0)