genBugsScript {rbugs}R Documentation

Generating Script File for BUGS

Description

Generating a script file to run BUGS batch-mode.

Usage

genBugsScript(paramSet, n.chains, n.iter, n.burnin, n.thin, dic,
              model.file, data.file, inits.files,
              workingDir=NULL, bugsWorkingDir=getwd(),
              script, debug = FALSE, useWine=FALSE,
              linbugs=TRUE, seed=314159)

Arguments

paramSet A character vector of the names of the parameter to be monitored.
n.chains The number of chains to be monitored.
n.iter The number of iterations of each chain.
n.burnin The length of the burn-in.
n.thin Thinning rate.
dic
model.file A character string of the name of file which contains the model specification for BUGS. It should end with .txt to be recognizable by BUGS.
data.file A character string of the name of the data file. It should end with .txt to be recognizable by BUGS.
inits.files A vector of file names of initial values. They should end with .txt to be recognizable by BUGS.
workingDir A character string specifying the directory to store temporary files for running BUGS.
bugsWorkingDir A character string specifying the directory which is recognizable by windows, if using wine.
script A character string naming the files to print the script to. It must end with .txt to be recognizable by BUGS.
debug A logical value indicating whether or not closing the BUGS window after running the script.
useWine If TRUE, BUGS is used via wine.
linbugs If TRUE, linbugs is used.
seed An integer of random number seed.

Details

This function only write a script to ‘script’, which uses the file names of ‘model.file’, ‘data.file’, and ‘inits.files’, without actually reading them. These file names should be correct when using runBugs.

workingDir and bugsWorkingDir establish the translation between a directory native to the operating system and a directory recognizable by wine. They are the same if useWine == FALSE.

Value

None.

Author(s)

Jun Yan jyan@stat.uiowa.edu

See Also

genDataFile, genInitsFile, format4Bugs

Examples

## no tested examples for mac-os.
## Not run: 
script.file <- paste(tempfile("script"), ".txt", sep="")
genBugsScript(paramSet=c("alpha", "theta"), n.chains=2, n.keep=1500,
              n.burnin=500, n.thin=1,
              model.file="/var/scratch/c/tmp/model.txt",
              data.file="/var/scratch/c/tmp/data.txt",
              inits.file=c("/var/scratch/c/tmp/init1.txt",
                           "/var/scratch/c/tmp/init2.txt"),
              workingDir="/var/scratch/c/tmp",
              bugsWorkingDir="c:/tmp",
              script=script.file,
              debug=FALSE, useWine=TRUE)
file.show(script.file)
unlink(script.file)
## End(Not run)

[Package rbugs version 0.3-6 Index]