rbugs {rbugs}R Documentation

Run BUGS from R in a BATCH

Description

Generate files (data, init, script) that are necessary to run BUGS, call BUGS through the OS, and collect the MCMC output.

Usage

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 = Sys.getenv("BUGS"),
      workingDir = NULL, 
      bugsWorkingDir,
      useWine = FALSE, wine = Sys.getenv("WINE"),
      linbugs = TRUE, 
      cleanBugsWorkingDir = FALSE,
      genFilesOnly = FALSE,
      verbose = FALSE, seed = 314159)

Arguments

data a list of data object to be used by BUGS
inits a list of list of initial values, or a function which returns a list of initial values
paramSet a vector of the names of the parameters to be monitored
model the file name of the model description
n.chains the number of chains to be monitored
n.iter the number of iteration of each chain
n.burnin the length of the burn-in
n.thin thinning rate
dic if TRUE, dic will be monitored
debug a logical value indicating whether or not closing the BUGS window
bugs the full name (including the path) of the BUGS executable
workingDir a directory to store all the intermediate files
bugsWorkingDir required, the nominal name of the working directory, which is the same as workingDir if useWine is "FALSE". If useWine is "TRUE", it should be a directory which is recognizable by the Windows system though wine.
useWine a logical value with "TRUE" meaning wine is used
wine if useWine==TRUE, the full name of wine
linbugs if TRUE, linbugs is used
cleanBugsWorkingDir if TRUE, the generated files will be removed from the bugsWorkingDir
genFilesOnly If TRUE, the script, data, inits, and model files will be generated but not run.
verbose if TRUE, print the log file from BUGS
seed an interger of random number seed

Value

A list of MCMC outputs with length nChains.

Author(s)

Jun Yan jyan@stat.uiowa.edu

Examples

## see examples in this-is-escaped-code{ and this-is-escaped-codenormal-bracket52bracket-normal

[Package rbugs version 0.3-6 Index]