sgmcmc : An R Package for Stochastic Gradient Markov Chain Monte Carlo

Baker, Jack and Fearnhead, Paul and Fox, Emily B. and Nemeth, Christopher John (2019) sgmcmc : An R Package for Stochastic Gradient Markov Chain Monte Carlo. Journal of Statistical Software, 91 (3). pp. 1-27. ISSN 1548-7660

[thumbnail of 1710.00578v1]
PDF (1710.00578v1)
1710.00578v1.pdf - Accepted Version
Available under License Creative Commons Attribution.

Download (534kB)


This paper introduces the R package sgmcmc; which can be used for Bayesian inference on problems with large datasets using stochastic gradient Markov chain Monte Carlo (SGMCMC). Traditional Markov chain Monte Carlo (MCMC) methods, such as Metropolis-Hastings, are known to run prohibitively slowly as the dataset size increases. SGMCMC solves this issue by only using a subset of data at each iteration. SGMCMC requires calculating gradients of the log likelihood and log priors, which can be time consuming and error prone to perform by hand. The sgmcmc package calculates these gradients itself using automatic differentiation, making the implementation of these methods much easier. To do this, the package uses the software library TensorFlow, which has a variety of statistical distributions and mathematical operations as standard, meaning a wide class of models can be built using this framework. SGMCMC has become widely adopted in the machine learning literature, but less so in the statistics community. We believe this may be partly due to lack of software; this package aims to bridge this gap.

Item Type:
Journal Article
Journal or Publication Title:
Journal of Statistical Software
Uncontrolled Keywords:
?? stat.costat.apstat.mlsoftwarestatistics and probabilitystatistics, probability and uncertainty ??
ID Code:
Deposited By:
Deposited On:
10 Oct 2017 10:28
Last Modified:
29 Apr 2024 23:57