sgmcmc: Stochastic Gradient Markov Chain Monte Carlo

Provides functions that performs popular stochastic gradient Markov chain Monte Carlo (SGMCMC) methods on user specified models. The required gradients are automatically calculated using 'TensorFlow' <>, an efficient library for numerical computation. This means only the log likelihood and log prior functions need to be specified. The methods implemented include stochastic gradient Langevin dynamics (SGLD), stochastic gradient Hamiltonian Monte Carlo (SGHMC), stochastic gradient Nose-Hoover thermostat (SGNHT) and their respective control variate versions for increased efficiency. References: M. Welling, Y. W. Teh (2011) <>; T. Chen, E. B. Fox, C. E. Guestrin (2014) <arXiv:1402.4102>; N. Ding, Y. Fang, R. Babbush, C. Chen, R. D. Skeel, H. Neven (2014) <>; J. Baker, P. Fearnhead, E. B. Fox, C. Nemeth (2017) <arXiv:1706.05439>.

Version: 0.2.0
Depends: R (≥ 3.0), tensorflow
Imports: utils
Suggests: testthat, MASS, knitr, ggplot2, rmarkdown
Published: 2017-09-26
Author: Jack Baker [aut, cre, cph], Christopher Nemeth [aut, cph], Paul Fearnhead [aut, cph], Emily B. Fox [aut, cph], STOR-i [cph]
Maintainer: Jack Baker <j.baker1 at>
License: GPL-3
NeedsCompilation: no
SystemRequirements: TensorFlow (
Materials: README NEWS
CRAN checks: sgmcmc results


Reference manual: sgmcmc.pdf
Vignettes: Gaussian Mixture
Logistic Regression
Multivariate Gaussian
Bayesian Neural Network
Getting Started
Package source: sgmcmc_0.2.0.tar.gz
Windows binaries: r-devel:, r-release:, r-oldrel:
OS X El Capitan binaries: r-release: sgmcmc_0.2.0.tgz
OS X Mavericks binaries: r-oldrel: sgmcmc_0.2.0.tgz
Old sources: sgmcmc archive


Please use the canonical form to link to this page.