rbugs: Run BUGS from R in a BATCH

Description Usage Arguments Value Author(s) Examples

View source: R/rbugs.R

Description

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

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
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)

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

bugsWorkingDir

a directory to store all the intermediate files

OpenBugs

if TRUE, OpenBugs 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 with the inforamtion of the MCMC sample and each one of the nChains .

Author(s)

Jun Yan jyan@stat.uconn.edu and Marcos Prates marcosop@est.ufmg.br

Examples

1
 ##see examples in \code{\link{pumps}} and \code{\link{schools}}

rbugs documentation built on Jan. 15, 2019, 5:04 p.m.

Related to rbugs in rbugs...