runExample: Run standard BUGS example

Description Usage Arguments Details Value See Also

Description

This function runs one of the standard BUGS examples stored in the bugs-examples package using its canonical name

Usage

1
runExample(example, engine=c("OpenBUGS", "WinBUGS", "JAGS", "BRugs"), exDir)

Arguments

example

A list containing sufficient information to run the example. See Details below

engine

Name of the engine to use for running the example

exDir

Name of the directory where the model files will be found. By default the ‘examples’ directory of the installed bugs-examples package is used

Details

The example list must have the following components

name

The name of the example

parameters

A character vector of the names of parameters to save

nSample

Number of samples to keep after burnin.

nBurnin

Number of burnin iterations to discard.

nThin

Thinning interval to use for the chain. Setting nThin to n instead of 1 increases the total run time by n but does not affect the number of stored samples

nChain

Number of parallel chains to run

The runExamples function will search for model files in the exDir directory. These files must have the same base name as the example with extensions “model.txt”, “data.txt”, and “inits.txt”.

Value

An list with the following components

coda

An mcmc.list object containing output for the monitored variables

runtime

The run time as returned by system.time

engine

The name of the MCMC engine

name

The name of the example

See Also

bugsex


BUGSExamples documentation built on May 2, 2019, 6:15 p.m.