Generate files (data, init, script) that are necessary to run BUGS, call BUGS through the OS, and collect the MCMC output.
rbugs(data, inits, paramSet, model,
n.chains = 1, n.iter = 2000, n.burnin = floor(n.iter/2),
n.thin = max(1, floor(n.chains * (n.iter - n.burnin)/1000)),
dic = FALSE,
debug = FALSE,
bugs = system("which OpenBUGS", TRUE),
bugsWorkingDir,
OpenBugs = TRUE,
cleanBugsWorkingDir = FALSE,
genFilesOnly = FALSE,
verbose = FALSE, seed = NULL)
a list of data object to be used by BUGS
a list of list of initial values, or a function which returns a list of initial values
a vector of the names of the parameters to be monitored
the file name of the model description
the number of chains to be monitored
the number of iteration of each chain
the length of the burn-in
thinning rate
if TRUE, dic will be monitored
a logical value indicating whether or not closing the BUGS window
the full name (including the path) of the BUGS executable
a directory to store all the intermediate files
if TRUE, OpenBugs is used
if TRUE, the generated files will be removed from the bugsWorkingDir
If TRUE, the script, data, inits, and model files will be generated but not run.
if TRUE, print the log file from BUGS
an interger of random number seed
A list with the inforamtion of the MCMC sample and each one of the nChains
.
# NOT RUN {
##see examples in \code{\link{pumps}} and \code{\link{schools}}
# }
Run the code above in your browser using DataLab