Using R to Run 'JAGS'

Providing wrapper functions to implement Bayesian analysis in JAGS. Some major features include monitoring convergence of a MCMC model using Rubin and Gelman Rhat statistics, automatically running a MCMC model till it converges, and implementing parallel processing of a MCMC model for multiple chains.


R2jags: Using R to Run JAGS to perform Bayesian inference using MCMC

R-CMD-check CRAN_Status_Badge CRAN_Download_Badge CRAN_Download_Badge

Perform Bayesian modelling in R using JAGS.

:rocket: This is the development version of the R package R2jags (currently on version 0.9-0). The stable version is now release 0.8-9, on CRAN.

Contents

Overview

R2jags provides a set of wrapper functions to implement Bayesian analysis using Markov Chain Monte Carlo (specifically, Gibbs sampling) in JAGS. Some major features include monitoring convergence of a MCMC model using Gelman-Rubin Potential Scale Reduction (“Rhat”) statistics, automatically running a MCMC model until it converges, and implementing parallel processing of a MCMC model for multiple chains.

Features

Main features of R2jags include:

  • Wrapping functions around rjags to run JAGS in the background and produce a MCMC analysis of a given model.
  • Summary statistics and tables
  • Convergence and auto-correlation calculations and plots

Installation

Install the released version from CRAN with

install.packages("R2jags")

The development version (in this repo, which can be updated more quickly and more often than the stable one) can be installed from r-universe.dev, using the following command

install.packages(
  'R2jags', 
  repos = c('https://giabaio.r-universe.dev', 'https://cloud.r-project.org')
)

Alternatively, you can install the development version using remotes, with the following command.

install.packages("remotes")
remotes::install_github("giabaio/R2jags",ref="devel")

NB: On Windows machines, you need to install a few dependencies, including Rtools first, e.g. by running

pkgs <- c("MASS", "Rtools", "remotes")
repos <- "https://cran.rstudio.com"
install.packages(pkgs, repos = repos, dependencies = "Depends")

before installing the package using remotes.

License

License: GPLv3

Contributing

Please submit contributions through Pull Requests, following the contributing guidelines. To report issues and/or seek support, please file a new ticket in the issue tracker.

Please note that this project is released with a Contributor Code of Conduct. By participating in this project you agree to abide by its terms.

Reference manual

It appears you don't have a PDF plugin for this browser. You can click here to download the reference manual.

install.packages("R2jags")

0.9-0 by Yu-Sung Su, 3 days ago


https://github.com/suyusung/R2jags


Report a bug at https://github.com/suyusung/R2jags/issues/


Browse source code at https://github.com/cran/R2jags


Authors: Yu-Sung Su [aut, cre] , Masanao Yajima [aut] , Gianluca Baio [ctb]


Documentation:   PDF Manual  


GPL (> 2) license


Imports abind, coda, graphics, grDevices, methods, parallel, stats, stringr, utils

Depends on rjags

Suggests testthat

System requirements: JAGS (>= 5.0.0, https://mcmc-jags.sourceforge.io)


Imported by BTSPAS, BayesPostEst, EBASE, IIVpredictor, MBNMAdose, MBNMAtime, MigConnectivity, MisRepARMA, MixSIAR, NAPrior, SurviMChd, afthd, agRee, aggreCAT, autoMR, baker, bamdit, bayesmsm, bml, boral, cosimmr, eefAnalytics, isoWater, jagstargets, jarbes, longit, mcmsupply, midas2, missingHE, mvnma, popbayes, reslr, rnmamod, sparsesurv, ssifs.

Depended on by BayesianMediationA, hbbr, hdbma, miscF, simmr.

Suggested by AICcmodavg, LakeMetabolizer, binest, bridgesampling, broom.mixed, emdbook, expertsurv, ftsa, gaawr2, gap, mcmsector, postpack, priorsense, rFIA.


See at CRAN