Hamiltonian Monte Carlo and Other Gradient-Based MCMC Sampling Algorithms for 'nimble'
Overview
Provides gradient-based MCMC sampling algorithms for use with the MCMC engine provided by the 'nimble' package. This includes two versions of Hamiltonian Monte Carlo (HMC) No-U-Turn (NUTS) sampling, and (under development) Langevin samplers. The `NUTS_classic` sampler implements the original HMC-NUTS algorithm as described in Hoffman and Gelman (2014) doi:10.48550/arXiv.1111.4246. The `NUTS` sampler is a modern version of HMC-NUTS sampling matching the HMC sampler available in version 2.32.2 of Stan (Stan Development Team, 2023). In addition, convenience functions are provided for generating and modifying MCMC configuration objects which employ HMC sampling. Functionality of the 'nimbleHMC' package is described further in Turek, et al (2024) <doi: 10.21105/joss.06745>.
Install
Health
- OK13 OK2026-08-05
- NOTE12 OK, 1 NOTE2026-08-01
- OK13 OK2026-07-21
- NOTE12 OK, 2 NOTE2026-03-10
Documentation
- Help pages
- 8
- Examples that run
- 83%5 run in a plain check · 1 only when donttest examples are enabled (R CMD check --as-cran)
- Exported functions with examples
- 75%
- Documented parameters
- 100%
- Return-value docs
- 75%
- Help pages citing references
- 25%
Downloads
Dependencies
Installing nimbleHMC adds 14 packages (7 with compiled code, 12 MB of source tarballs). Heaviest: igraph 4.8 MB, nimble 3.2 MB, vctrs 1.0 MB.
Code & Tests
People & History
Pick two releases to compare their code metrics.
- 0.2.5Latest
- RR 4.6.0 released · 2026-04-24
- 0.2.42025-12-16 · diff ↗
- RR 4.5.0 released · 2025-04-11
- 0.2.32024-12-18 · diff ↗
- 0.2.22024-06-28 · diff ↗
- RR 4.4.0 released · 2024-04-24
- 0.2.12024-02-09 · diff ↗
- 0.2.02023-09-12 · diff ↗ ·
removed 1 export
sampler_HMCadded 4 exports
sampler_NUTS, sampler_NUTS_classic, stateNL_NUTS, treebranchNL_NUTS - 0.1.12023-07-07 · diff ↗
- 0.1.02023-05-31
- RR 4.3.0 released · 2023-04-21
Package metadata
- First published
- 2023-05-31
- Total releases
- 8 / 3 yrs
- License
- BSD_3_clause + file LICENSE | GPL (>= 2) OSI
- Copyright
- See COPYRIGHTS file.
- Minimum R
- ≥ 3.5.0
- Download size
- 40 KB
Cite
Cite this package
Run in R for the authors' preferred citation:
citation("nimbleHMC")The package provides a citation file that builds its entry when R runs it. Run citation() to see it.
Cite the R Observatory
For a number measured here: a download total, a coverage figure, an archival date.
From data release v2026-10-22, which the citation names so these numbers can be found later. More on citing and the projects behind them.