Translating probability density functions: From R to BUGS and back again

David S. LeBauer, Michael C. Dietze, Benjamin M. Bolker

Research output: Contribution to journalArticle

Abstract

The ability to implement statistical models in the BUGS language facilitates Bayesian inference by automating MCMC algorithms. Software packages that interpret the BUGS language include OpenBUGS, WinBUGS, and JAGS. R packages that link BUGS software to the R environment, including rjags and R2WinBUGS, are widely used in Bayesian analysis. Indeed, many packages in the Bayesian task view on CRAN (http://cran.r-project.org/web/views/Bayesian.html) depend on this integration. However, the R and BUGS languages use different representations of common probability density functions, creating a potential for errors to occur in the implementation or interpretation of analyses that use both languages. Here we review different parameterizations used by the R and BUGS languages, describe how to translate between the languages, and provide an R function, r2bugs.distributions, that transforms parameterizations from R to BUGS and back again.

Original languageEnglish (US)
Pages (from-to)207-209
Number of pages3
JournalR Journal
Volume5
Issue number1
DOIs
StatePublished - Jan 1 2013

ASJC Scopus subject areas

  • Statistics and Probability
  • Numerical Analysis
  • Statistics, Probability and Uncertainty

Fingerprint Dive into the research topics of 'Translating probability density functions: From R to BUGS and back again'. Together they form a unique fingerprint.

  • Cite this