User manual

Chapter 14: ESS for BUGS 77
14 ESS for BUGS
ESS[BUGS] was originally designed for use with BUGS software. Later, it evolved to support
JAGS as a dialect of the BUGS language via ESS[JAGS], however, ESS[JAGS] is documented
in the section Help for JAGS. ESS[BUGS] provides 5 features. First, BUGS syntax is de-
scribed to allow for proper fontification of statements, distributions, functions, commands
and comments in BUGS model files, command files and log files. Second, ESS creates tem-
plates for the command file from the model file so that a BUGS batch process can be defined
by a single file. Third, ESS provides a BUGS batch script that allows ESS to set BUGS
batch parameters. Fourth, key sequences are defined to create a command file and submit a
BUGS batch process. Lastly, interactive submission of BUGS commands is also supported.
14.1 ESS[BUGS]–Model files
Model files with the .bug’ extension are edited in ESS[BUGS] mode if (require ’ess-bugs-
d) was performed. Model files with the .jag extension are edited in ESS[JAGS] mode if
(require ’ess-jags-d) was performed. Three keys are bound for your use in ESS[BUGS],
F2, C-c C-c and =. F2 performs the same action as it does in ESS[SAS], See Section 13.5
[ESS(SAS)–Function keys for batch processing], page 71. C-c C-c performs the function
ess-bugs-next-action which you will use a lot. Pressing it in an empty buffer for a model
file will produce a template for you. = inserts the set operator, <-.
14.2 ESS[BUGS]–Command files
To avoid extension name collision, .bmd is used for BUGS command files and .jmd for
JAGS command files. When you have finished editing your model file and press C-c C-c, a
command file is created if one does not already exist. When you are finished editing your
command file, pressing C-c C-c again will submit your command file as a batch job.
14.3 ESS[BUGS]–Log files
To avoid extension name collision, .bog is used for BUGS log files. The command line
generated by ESS creates the .bog transcript file. Similarly, .jog is used for JAGS log
files.