set.seed(123)
# Load example data and set your hyper parameters
data(weibull_cc, package = "BayesFBHborrow")
data(weibull_hist, package = "BayesFBHborrow")
# The datasets consists of 3 (2) columns named "tte", "event" and "X".
# To explicitly run the sampler, extract the samples as following
Y <- weibull_cc$tte
I <- weibull_cc$event
X <- matrix(weibull_cc$X_trt)
# Specify hyperparameters and tuning parameters
hyper <- list("a_sigma" = 2,
"b_sigma" = 2,
"clam_smooth" = 0.5,
"phi" = 3)
tuning_parameters <- list("Jmax" = 5,
"pi_b" = 0.5,
"cprop_beta" = 0.5)
# Set initial values to 'NULL' for default settings
output <- GibbsMH(Y, I, X, NULL, NULL, NULL,
tuning_parameters = tuning_parameters, hyperparameters = hyper,
iter = 5, warmup_iter = 1)
Run the code above in your browser using DataLab