Skip to content

nimbleHMC

Hamiltonian Monte Carlo and Other Gradient-Based MCMC Sampling Algorithms for 'nimble'

v0.2.4 · Dec 16, 2025 · BSD_3_clause + file LICENSE | GPL (>= 2)

Description

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>.

Downloads

CRAN

332

Last 30 days

13488th

821

Last 90 days

3.5K

Last year

Trend: +42.5% (30d vs prior 30d)

r2u CRAN

1

Last 30 days

26

Last 90 days

135

Last year

Trend: -90% (30d vs prior 30d)

autoCRAN

4

Last 7 days

8

Last 30 days

1

All-time

autoCRAN-only: this name is served only by autoCRAN, so the count is exact.

CRAN Check Status

2 NOTE
11 OK
Show all 13 flavors
Flavor Status
r-devel-linux-x86_64-debian-clang OK
r-devel-linux-x86_64-debian-gcc OK
r-devel-linux-x86_64-fedora-clang NOTE
r-devel-linux-x86_64-fedora-gcc NOTE
r-devel-windows-x86_64 OK
r-oldrel-macos-arm64 OK
r-oldrel-macos-x86_64 OK
r-oldrel-windows-x86_64 OK
r-patched-linux-x86_64 OK
r-release-linux-x86_64 OK
r-release-macos-arm64 OK
r-release-macos-x86_64 OK
r-release-windows-x86_64 OK
Check details (2 non-OK)
NOTE r-devel-linux-x86_64-fedora-clang

dependencies in R code

Namespace in Imports field not imported from: ‘methods’
  All declared Imports should be used.
NOTE r-devel-linux-x86_64-fedora-gcc

dependencies in R code

Namespace in Imports field not imported from: ‘methods’
  All declared Imports should be used.

Check History

NOTE 12 OK · 2 NOTE · 0 WARNING · 0 ERROR · 0 FAILURE Mar 10, 2026
NOTE r-devel-linux-x86_64-fedora-clang

dependencies in R code

Namespace in Imports field not imported from: ‘methods’
  All declared Imports should be used.
NOTE r-devel-linux-x86_64-fedora-gcc

dependencies in R code

Namespace in Imports field not imported from: ‘methods’
  All declared Imports should be used.

Code intelligence has not been computed for this package yet.

Code

Structure

Lines of code

3,472

Files

19

Compiled share

0%

Has compiled src

No

Language breakdown

R 1,682 (48.4%)Tests 1,229 (35.4%)Docs 561 (16.2%)

API

Exported functions

8

Internal functions

3

Recent export changes

v0.2.0+4 sampler_NUTS, sampler_NUTS_classic, stateNL_NUTS +1 more  −1 sampler_HMC

Testing & CI

Has tests

Yes

Test-to-code ratio

0.73

testthat edition

CI present

No

CI type

[]

PR gated

No

Docs

Return-value doc rate

75%

\dontrun example ratio

16.7%

Roxygen coverage

100%

Has pkgdown

No

NEWS present

No

Health & Security signals

Informational signals; not verdicts.

on.exit coverage

0%

Unsafe pattern score

0

Dep constraint coverage

50%

Secret pattern count

0

Bundled 3rd-party code

2 items

Portability & License

Min R version

3.5.0

System requirements

C++ standard

License

BSD_3_clause + file LICENSE | GPL (>= 2)

License flags

SPDX valid, OSI approved

History

Versions

7

First release

2023-05-31

Latest release

2025-12-16

Avg cadence

145 days

Cold removal rate

100%

Dep drift

0

LOC over versions

v0.1.0: 1,723 LOCv0.1.1: 1,745 LOCv0.2.0: 3,188 LOCv0.2.1: 3,394 LOCv0.2.2: 3,444 LOCv0.2.3: 3,448 LOCv0.2.4: 3,472 LOC

Per-file churn detail lives in the source pipeline: https://github.com/r-observatory/cran-code-metrics.

Reverse Dependencies (1)

suggests

Dependency Network

Dependencies Reverse dependencies nimble runMCMCbtadjust nimbleHMC

Version History

8 tracked
new 0.2.4 Mar 10, 2026
updated 0.2.4 ← 0.2.3 diff Dec 15, 2025
updated 0.2.3 ← 0.2.2 diff Dec 17, 2024
updated 0.2.2 ← 0.2.1 diff Jun 27, 2024
updated 0.2.1 ← 0.2.0 diff Feb 8, 2024
updated 0.2.0 ← 0.1.1 diff Sep 11, 2023
updated 0.1.1 ← 0.1.0 diff Jul 6, 2023
new 0.1.0 May 30, 2023