# \donttest{
simdata2 <- data.frame(DATA1$X, y = DATA1$y)
# 1. One tool version
fit_one <- BayesSIM(y ~ ., data = simdata2,
niter = 5000, nburnin = 1000, nchain = 1)
# 2. Split version
models <- BayesSIM_setup(y ~ ., data = simdata2)
Ccompile <- compileModelAndMCMC(models)
nimSampler <- get_sampler(Ccompile)
initList <- getInit(models)
mcmc.out <- runMCMC(nimSampler, niter = 5000, nburnin = 1000, thin = 1,
nchains = 1, setSeed = TRUE, inits = initList,
summary = TRUE, samplesAsCodaMCMC = TRUE)
# "fit_split" becomes exactly the same as the class of "fit_one" object and apply generic functions.
fit_split <- as_bsim(models, mcmc.out)
# }
Run the code above in your browser using DataLab