Just Another Gibbs Additive Modeler: Interfacing JAGS and mgcv
Simon N. Wood
Journal of Statistical Software, 2016, vol. 075, issue i07
Abstract:
The BUGS language offers a very flexible way of specifying complex statistical models for the purposes of Gibbs sampling, while its JAGS variant offers very convenient R integration via the rjags package. However, including smoothers in JAGS models can involve some quite tedious coding, especially for multivariate or adaptive smoothers. Further, if an additive smooth structure is required then some care is needed, in order to centre smooths appropriately, and to find appropriate starting values. R package mgcv implements a wide range of smoothers, all in a manner appropriate for inclusion in JAGS code, and automates centring and other smooth setup tasks. The purpose of this note is to describe an interface between mgcv and JAGS, based around an R function, jagam, which takes a generalized additive model (GAM) as specified in mgcv and automatically generates the JAGS model code and data required for inference about the model via Gibbs sampling. Although the auto-generated JAGS code can be run as is, the expectation is that the user would wish to modify it in order to add complex stochastic model components readily specified in JAGS. A simple interface is also provided for visualisation and further inference about the estimated smooth components using standard mgcv functionality. The methods described here will be un-necessarily inefficient if all that is required is fully Bayesian inference about a standard GAM, rather than the full flexibility of JAGS. In that case the BayesX package would be more efficient.
Date: 2016-12-20
References: View references in EconPapers View complete reference list from CitEc
Citations: View citations in EconPapers (9)
Downloads: (external link)
https://www.jstatsoft.org/index.php/jss/article/view/v075i07/v75i07.pdf
https://www.jstatsoft.org/index.php/jss/article/do ... 7/mgcv_1.8-16.tar.gz
https://www.jstatsoft.org/index.php/jss/article/do ... ile/v075i07/v75i07.R
https://www.jstatsoft.org/index.php/jss/article/do ... e/v075i07/sitka.jags
Related works:
This item may be available elsewhere in EconPapers: Search for items with the same title.
Export reference: BibTeX
RIS (EndNote, ProCite, RefMan)
HTML/Text
Persistent link: https://EconPapers.repec.org/RePEc:jss:jstsof:v:075:i07
DOI: 10.18637/jss.v075.i07
Access Statistics for this article
Journal of Statistical Software is currently edited by Bettina Grün, Edzer Pebesma and Achim Zeileis
More articles in Journal of Statistical Software from Foundation for Open Access Statistics
Bibliographic data for series maintained by Christopher F. Baum ().