Learn R Programming

runjags (version 0.9.9-2)

runjags: Run Bayesian MCMC Models in the BUGS syntax from Within R

Description

A set of functions to allow any user specified model to be run in JAGS from within R, returning the MCMC chains as R objects. Includes functions to read external WinBUGS type textfiles, and allows several ways of automatically specifying model data from existing R objects or R functions. Also includes functions to automatically calculate model run length, autocorrealtion and Gelman Rubin statistic diagnostics for all models to simplify the process of achieving chain convergence. Designed for maximum compatibility with WinBUGS syntax, although minor modification to existing .bug files will be required. Also provides functions for submission and retrieval of jobs (both JAGS runs and user-specified R code execution) to Apple Xgrid distributed computing clusters (Mac OS X machines only). Requires Just Another Gibbs Sampler (JAGS) for most functions, see: http://www-fis.iarc.fr/~martyn/software/jags/

Arguments

Details

JAGS is a program which allows analysis of Bayesian models using Markov chain Monte Carlo (MCMC) simulation, and was developed by Martyn Plummer to be an alternative to BUGS that ran on UNIX systems as well as Windows systems (see: http://www-fis.iarc.fr/~martyn/software/jags/ for more information). The R package rjags is a native R interface to the JAGS library, and allows a far greater level of control and analysis of compiled models, which is often more useful for model development. This package was intended to provide additional functions to help automate the process of running models, including interpretation of WinBUGS type text files including data and initial values, automated retrieval of objects within the working environment to be passed as data or initial values to the model, automated convergence diagnostics, and automated collation and plotting of results. The package also includes functions for running JAGS models, and any other user specified R code, over Xgrid distributed computing clusters from within R (requires Mac OS X and access to an Xgrid system).

See Also

run.jags for basic model runs

autorun.jags for automated running of models to convergence and automated calculation of necessary sample sizes

run.jagsfile and autorun.jagsfile for running of local WinBUGS style text files, as well as methods of automating retrieval of data and initial values from local text files or character strings

read.winbugs for translation of WinBUGS text files into JAGS compatible model, data and initial values files

combine.mcmc and dump.format for MCMC related tools

timestring, new_unique and ask for more general tools

xgrid.run.jags and xgrid.submit.jags for use of Xgrid clusters to run JAGS models remotely

xgrid.run and xgrid.submit for use of Xgrid clusters for remote execution of user specified R code

jags.model in the rjags package for fine control over the JAGS libraries