Projects per year
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.
Original language | English |
---|---|
Pages (from-to) | 1-15 |
Journal | Journal of Statistical Software |
Volume | 75 |
Issue number | 1 |
DOIs | |
Publication status | Published - 1 Dec 2016 |
Bibliographical note
Publisher Copyright:© 2016 Journal of Statistical Software. All rights reserved.
Copyright:
Copyright 2017 Elsevier B.V., All rights reserved.
Keywords
- Additive model
- BUGS
- Generalized additive mixed model
- JAGS
- R
- Smooth
- Spline
ASJC Scopus subject areas
- Software
- Statistics and Probability
- Statistics, Probability and Uncertainty
Fingerprint
Dive into the research topics of 'Just another Gibbs additive Modeler: Interfacing JAGS and mgcv'. Together they form a unique fingerprint.Projects
- 1 Finished
-
Fellowship - Sparse, Rank-Reduced and General Smooth Modelling
Wood, S. (PI)
Engineering and Physical Sciences Research Council
1/02/13 → 30/11/15
Project: Research council