# \donttest{
# Load example dataset
data(dengueMS)
# Declare formulas
formulas <- c("dengue_cases ~ tmin + f(year, model='rw1')")
# Tranform formulas into a 'GHRformulas' object
ghr_formula <- as_GHRformulas(formulas)
# Fit multiple models
results <- fit_models(
formulas = ghr_formula,
data = dengue_MS[dengue_MS$year %in% 2005:2010,],
family = "nbinomial",
name = "model",
offset = "population",
nthreads = 2,
control_compute = list(config = FALSE),
pb = TRUE
)
# Generate 100 samples from the posterior predictive distribution of the model
ppd_df <- sample_ppd(
results,
mod_id = "model1",
s = 100,
nthreads = 2)
# }
Run the code above in your browser using DataLab