bugs.script: Writes script for running MultiBUGS

Description Usage Arguments Value See Also

View source: R/bugs.script.R

Description

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

Usage

1
2
3
4
5
6
7
bugs.script(parameters.to.save, n.chains, n.iter, n.burnin, n.thin,
  n.workers, saveExec, restart, model.file.bug, model.file,
  debug = FALSE, is.inits, fix.founders, 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

n.workers

number of worker processes to distribute computation across

saveExec

If TRUE, a re-startable image of the MultiBUGS 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 MultiBUGS 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 MultiBUGS code

debug

if FALSE, MultiBUGS is closed automatically, otherwise MultiBUGS 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 MultiBUGS

DIC

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

useWINE

as in bugs meta function

newWINE

as in bugs meta function

WINEPATH

as in bugs meta function

bugs.seed

random seed for MultiBUGS (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 MultiBUGS.

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.


MultiBUGS/R2MultiBUGS documentation built on April 18, 2019, 11:57 p.m.