bugs.script: Writes script for running OpenBUGS

Description Usage Arguments Value See Also

Description

Write file ‘script.txt’ for OpenBUGS to read - intended for internal use

Usage

1
2
3
4
5
6
7
8
bugs.script(parameters.to.save, n.chains, n.iter, n.burnin,
           n.thin, saveExec, restart, model.file.bug,
           model.file, debug=FALSE, is.inits, 
           DIC=FALSE, useWINE=FALSE,
           newWINE=TRUE, WINEPATH=NULL, bugs.seed=NULL, summary.only=FALSE,
           save.history=(.Platform$OS.type == "windows" | useWINE==TRUE),
           bugs.data.file, bugs.inits.files,
           over.relax = FALSE) 

Arguments

parameters.to.save

parameters that should be monitored

n.chains

number of Markov chains

n.iter

number of total iterations (including burn in)

n.burnin

length of burn in

n.thin

thinning parameter

saveExec

If TRUE, a re-startable image of the OpenBUGS execution is saved with basename(model.file) and extension .bug in the working directory, which must be specified. The .bug files can be large, so users should monitor them carefully and remove them when not needed.

restart

If TRUE, execution resumes with the final status from the previous execution stored in the .bug file in the working directory. If n.burnin=0,additional iterations are performed and all iterations since the previous burnin are used (including those from past executions). If n.burnin>0, a new burnin is performed, and the previous iterations are discarded, but execution continues from the status at the end of the previous execution. When restart=TRUE, only n.burnin, n.iter, and saveExec inputs should be changed from the call creating the .bug file, otherwise failed or erratic results may be produced.

model.file.bug

If saveExec or restart is TRUE, then model.file.bug receives/contains the OpenBUGS program image for restarting the program. model.file.bug is the name of the file with its full path

model.file

file containing the model written in OpenBUGS code

debug

if FALSE, OpenBUGS is closed automatically, otherwise OpenBUGS remains open for further investigation. With debug = TRUE, no modelQuit() command is added to the end of the script, which can cause an infinite loop with linux execution.

is.inits

logical; whether initial values are given by the user (TRUE) or have to be generated by OpenBUGS

DIC

logical; if TRUE, compute deviance, pD, and DIC automatically in OpenBUGS

useWINE

as in bugs meta function

newWINE

as in bugs meta function

WINEPATH

as in bugs meta function

bugs.seed

random seed for OpenBUGS (default is no seed specified)

summary.only

If TRUE, only a parameter summary for very quick analyses is given, temporary created files are not removed in that case.

save.history

If TRUE (the default), trace plots are generated at the end.

bugs.data.file

character name of the data file

bugs.inits.files

character vector of names of the inits files

over.relax

If TRUE, over-relaxed form of MCMC is used if available from OpenBUGS.

Value

Nothing, but as a side effect, the script file ‘script.txt’ is written

See Also

The main function to be called by the user is bugs.


R2OpenBUGS documentation built on April 3, 2020, 1:08 a.m.