BayES BayES

3.3 Interface to OpenBUGS

OpenBUGS is another open-source program that is very similar to JAGS. It too takes as inputs data and a model specification file (written in OpenBUGS’ own language) and draws samples from the posterior distribution of the model’s parameters or latent variables, using an expert system to pick the most appropriate method for sampling from the posterior.

BayESopenbugs() function provides a convenient interface to OpenBUGS, which allows the user to:

The general syntax of the openbugs() function is the following:3

[<model name> = ] openbugs( <model specification file> 
        [, "data"=<list of matrices to pass to OpenBUGS> ] 
        [, "monitor"=<list of parameters to monitor> ] 
        [, "summarize"=<list of parameters to summarize> ] 
        [, "inits"=<structure of initial values> ] 
        [, "chains"=<positive integer> ] 
        [, "burnin"=<positive integer> ] 
        [, "draws"=<positive integer> ] 
        [, "thin"=<positive integer> ] 
        [, "seed"=<positive integer> ] 
        [, "window"=true|false ] 
        [, "debug"=true|false ] 
        );

where:

When OpenBUGS runs using its GUI (under Microsoft® Windows® only) it prints any output on its own output window. When OpenBUGS runs without its GUI then BayES grabs any OpenBUGS output intended for the system’s command console and redirects it to the BayES console in real time. This output is entirely determined by OpenBUGS and it includes information on the stage of the estimation process (model check, loading data, etc.) and very limited information on the progress of the sampler (only whether the burn-in phase is complete).

Many of the sample script files in "$BayESHOME/Samples/3JAGSOpenBUGSStan" contain examples of using the openbugs() function, along with OpenBUGS model specification files for simple models. The OpenBUGS interface is also accessible from the BayES main menu via Interfaces OpenBUGS.

3Arguments inside square brackets are optional. Optional arguments passed to the openbugs() function can be provided in any order, but always after the mandatory argument (model specification file). Optional arguments always come in pairs (eg. "chains"=1).

Share this content:
Facebook Twitter LinkedIn Email
© 2016–20 Grigorios Emvalomatis