set.seed(123)
# Load the example data
data(piecewise_exp_cc, package = "BayesFBHborrow")
data(piecewise_exp_hist, package = "BayesFBHborrow")
# Set your tuning parameters
tuning_parameters <- list("Jmax" = 5,
"pi_b" = 0.5,
"cprop_beta" = 3.25,
"alpha" = 0.4)
# Set hyperparameters to default, with the borrowing model "mix"
out <- BayesFBHborrow(data = piecewise_exp_cc, data_hist = piecewise_exp_hist,
model_choice = 'mix', tuning_parameters = tuning_parameters,
iter = 2, warmup_iter = 0)
# Create a summary of the output
summary(out$out, estimator = "out_fixed")
# Plot the predictive curves for the treatment group
plots <- plot(out$out, out$out$time_grid, x_pred = c(1))
Run the code above in your browser using DataLab