MCMC, Particle Filtering, and Programmable Hierarchical Modeling
Overview
A system for writing hierarchical statistical models largely compatible with 'BUGS' and 'JAGS', writing nimbleFunctions to operate models and do basic R-style math, and compiling both models and nimbleFunctions via custom-generated C++. 'NIMBLE' includes default methods for MCMC, Laplace Approximation, deterministic nested approximations, Monte Carlo Expectation Maximization, and some other tools. The nimbleFunction system makes it easy to do things like implement new MCMC samplers from R, customize the assignment of samplers to different parts of a model from R, and compile the new samplers automatically via C++ alongside the samplers 'NIMBLE' provides. 'NIMBLE' extends the 'BUGS'/'JAGS' language by making it extensible: New distributions and functions can be added, including as calls to external compiled code. Although most people think of MCMC as the main goal of the 'BUGS'/'JAGS' language for writing models, one can use 'NIMBLE' for writing arbitrary other kinds of model-generic algorithms as well. A full User Manual is available at https://r-nimble.org.
USER LEVEL CHANGES
- Improve warning message about bad pWAIC values to make clear that
individual pWAIC values can be obtained via getWAICdetails (Issue 1626).
- Modify how
getParentshandlesself=FALSEto avoid returning any of the
input nodes. Formerly if multiple inputs were provided and one of the provided
inputs was the parent of another, this would be returned (PR #1633).
BUG FIXES
- Fix
prior_samplesMCMC sampler. Formerly this sampler gave incorrect
results as it did not account for the density of dependent variables and
simply iterated through the prior samples (PR #1624).
- Fix/robustify dimension checking to avoid warning about dimension of
right-hand side-only dynamically-indexed variables (PR #1632).
Show all changes in 1.4.3Hide the rest of the changes in 1.4.3
- Allow constants whose names start with a period (PR #1629).
- Fix corner case in
getConditionallyIndepedentSetswhennodesis
provided and givenNodes is not (Issue #1625).
DEVELOPER LEVEL CHANGES
- Update handling of various cases in
setupMargNodesto fix some
inconsistencies in corner cases (PR #1633).
- Fix UBSAN issue as requested by CRAN, avoiding
std::copycalls that
make zero-length copy (PR #1627).
From inst/NEWS.md in the release
Install
Health
- OK13 OK2026-08-26
- NOTE12 OK, 1 NOTE2026-07-11
- OK13 OK2026-05-02
- NOTE10 OK, 4 NOTE2026-04-09
- WARNING6 OK, 5 NOTE, 3 WARNING2026-03-21
Show 1 earlier changeHide 1 earlier change
- NOTE11 OK, 3 NOTE2026-03-10
Documentation
- Help pages
- 153 (1 internal)includes a package overview page
- Examples that run
- 78%56 run in a plain check · 15 never run · 1 hold no code
- Exported functions with examples
- 50%
- Documented parameters
- 99%
- Return-value docs
- 42%
- Help pages citing references
- 16%
Downloads
Repository
- PRs merged (all time)
- 90%
- Median days to close, 50 most recently updated closed issues
- 52
- Median days to close, 50 most recently updated closed PRs
- 14
Stars over time
Forks over time
Releases over time
Issues over time
PRs over time
Commits over time
Commit identities over time
5 development-tooling and community-health practices detected across 3 families in the upstream repository
Checks run against github.com/nimble-dev/nimble on 2026-10-11.
Dependencies
Installing nimble adds 13 packages (6 with compiled code, 8.5 MB of source tarballs). Heaviest: igraph 4.8 MB, vctrs 1.0 MB, rlang 766 KB.
Show all 37 packagesHide all 37 packages
Code & Tests
People & History
Show 5 peopleHide 5 people
Pick two releases to compare their code metrics.
- 1.4.3Latest
- RR 4.6.0 released · 2026-04-24
- 1.4.22026-04-01 · diff ↗
- 1.4.1
- 1.4.02025-12-13 · diff ↗ ·
added 17 exports
calc_dmnorm_inv_ld_AltParams, PDinverse_logdet, derived_BASE, derived_logProb, derived_mean, derived_predictive, derived_variance, dmnorm_inv_ld, emptyParam, expAv, expm, gaussParam, getParam_BASE, multiGaussParam, rmnorm_inv_ld, sampler_barker, splitLatents - RR 4.5.0 released · 2025-04-11
- 1.3.0
- 1.2.1
- 1.2.02024-06-09 · diff ↗ ·
removed 2 exports
MCMCsuite, compareMCMCsadded 8 exports
MCEM_mcse, buildAGHQ, nimOptimMethod, runAGHQ, runLaplace, sampler_noncentered, sampler_polyagamma, summaryAGHQ - RR 4.4.0 released · 2024-04-24
- 1.1.02024-01-31 · diff ↗ ·
removed 1 export
sampler_RW_multinomialadded 3 exports
getMacroParameters, nimIntegrate, sampler_prior_samples - 1.0.12023-06-15 · diff ↗
- 1.0.02023-05-23 · diff ↗ ·
removed 2 exports
waicDetailsList, waicListadded 15 exports
mcmc_createModelObject, ADbreak, ADproxyModelClass, AGHQuad_params, AGHQuad_summary, buildLaplace, clearCompiled, getConditionallyIndependentSets, makeModelDerivsInfo, parameterTransform, pow_int, setupMargNodes, summaryLaplace, waicDetailsNimbleList, waicNimbleList - 0.13.22023-05-14 · diff ↗
- RR 4.3.0 released · 2023-04-21
- 0.13.12022-12-14 · diff ↗
Show 39 earlier eventsHide 39 earlier events
- 0.13.0
- RR 4.2.0 released · 2022-04-22
- 0.12.2
- 0.12.12021-10-09 · diff ↗
- 0.12.02021-09-28 · diff ↗ ·
added 7 exports
dlkj_corr_cholesky, rlkj_corr_cholesky, sampler_RW_block_lkj_corr_cholesky, sampler_RW_lkj_corr_cholesky, waicList, waicDetailsList, calculateWAIC - 0.11.12021-05-23 · diff ↗
- RR 4.1.0 released · 2021-05-18
- 0.11.0
- 0.10.12020-11-23 · diff ↗
- 0.10.02020-10-10 · diff ↗ ·
removed 4 exports
getLoadingNamespace, sampler_CRP_old, sampler_RW_PF, sampler_RW_PF_blockadded 5 exports
calcAdaptationFactor, is.nfGenerator, nimbleFunctionList, extractControlElement, nf_preProcessMemberDataObject - 0.9.12020-05-22 · diff ↗
- RR 4.0.0 released · 2020-04-24
- 0.9.02019-12-18 · diff ↗ ·
removed 2 exports
sampler_RJ, sampler_toggledadded 5 exports
any_na, any_nan, buildIteratedFilter2, sampler_RJ_fixed_prior, sampler_RJ_toggled - 0.8.02019-06-02 · diff ↗ ·
removed 5 exports
combine_MCMC_comparison_results, make_MCMC_comparison_pages, rename_MCMC_comparison_method, reshape_comparison_results, updateMCMCcomparisonWithHighOrderESSadded 4 exports
configureRJ, sampler_RJ, sampler_RJ_indicator, sampler_toggled - RR 3.6.0 released · 2019-04-26
- 0.7.12019-03-12 · diff ↗
- 0.7.0.12019-03-01 · diff ↗
- 0.7.02019-02-01 · diff ↗
- 0.6.132019-01-26 · diff ↗ ·
added 7 exports
ddexp, pdexp, printErrors, qdexp, rdexp, sampler_CRP_old, sampler_RW_wishart - 0.6-122018-07-27 · diff ↗
- 0.6-112018-06-14 · diff ↗ ·
added 7 exports
cc_getNodesInExpr, dCRP, getSamplesDPmeasure, rCRP, sampler_CRP, sampler_CRP_concentration, stick_breaking - RR 3.5.0 released · 2018-04-23
- 0.6-102018-03-25 · diff ↗
- unarchivedReturned to CRAN2018-02-07
- 0.6-92018-02-07 · diff ↗
- archivedRemoved from CRAN2018-02-01policy violation Forces the use of '-fPIC', whereas some Linux compilers use '-KPIC' and overriding the user's settings is not acceptable There were also pragmas suppressing warnings
- 0.6-82017-11-22 · diff ↗
- 0.6-72017-11-15 · diff ↗ ·
added 22 exports
calc_dcatConjugacyContributions, CAR_calcM, CAR_calcC, CAR_calcCmatrix, CAR_calcEVs2, CAR_calcEVs3, as.carCM, carBounds, carMaxBound, carMinBound, dcar_proper, is.Cmodel, is.Cnf, is.Rmodel, is.model, model_macro_builder, nimbleMCMC, rcar_proper, runCrossValidate, sampler_CAR_proper, samplesSummary, withNimbleOptions - 0.6-62017-07-29 · diff ↗ ·
added 11 exports
ADNimbleList, CAR_calcNumIslands, as.carAdjacency, dcar_normal, nimDerivs, nimbleExternalCall, nimbleRcall, optimDefaultControl, rcar_normal, sampler_CAR_normal, sampler_categorical - 0.6-52017-06-07 · diff ↗ ·
added 13 exports
calc_dwishAltParams, dflat, dhalfflat, dinvwish_chol, dsqrtinvgamma, nimOptim, nimOptimDefaultControl, optimControlNimbleList, optimResultNimbleList, rflat, rhalfflat, rinvwish_chol, rsqrtinvgamma - 0.6-42017-04-25 · diff ↗ ·
added 18 exports
nimbleType, dinvgamma, eigenNimbleList, is.nl, nimC, nimEigen, nimLogical, nimRep, nimRound, nimSeq, nimSvd, nimbleList, pinvgamma, qinvgamma, rinvgamma, sampler_AF_slice, sampler_RW_dirichlet, svdNimbleList - RR 3.4.0 released · 2017-04-21
- 0.6-32016-12-14 · diff ↗
- 0.6-22016-11-23 · diff ↗ ·
added 9 exports
getBound, getDimension, getDistributionInfo, getParamNames, getType, isDiscrete, isUserDefined, makeBoundInfo, pqDefined - 0.6-1
- 0.62016-09-02 · diff ↗ ·
removed 327 exports
accessorVectorLength_setupCodeTemplate, activeBindingTemplateLength1NonScalar, addArg, addBlockFromCppName, addDistKeywordProcessors, addDistList2matchFunctions, addNecessarySetupCode, addNewCode, addNodeFxn, addNodeFxn_LOOP, addSamplerToSpec, addSetupCodeNames, addSingleModelValuesAccess, addSingleVarAccess, allLHSNodes_SetupTemplate, allModelNodes_SetupTemplate, allModelValuesVars_SetupTemplate, argInfo2PointerStaticCast, assignNumberedObject, autoBlockClass, autoBlockModel, autoBlockParamDefaults, BUGScode, BUGScontextClass, BUGSdeclClass, BUGSsingleContextClass, buildConjugateSamplerFunctions, buildModelInterface, buildNeededObjects, buildNimbleFxnInterface and 297 moreadded 25 exports
calc_dmnormConjugacyContributions, getNodeFunctionIndexedInfo, nimbleInternalFunctions, nfVar<-, values<-, buildAuxiliaryFilter, buildBootstrapFilter, buildEnsembleKF, buildLiuWestFilter, dmvt_chol, identityMatrix, modelValuesConf, nimCat, nimInteger, nimMatrix, nimNumeric, rmvt_chol, run.time, runMCMC, sampler_RW_PF, sampler_RW_PF_block, sampler_RW_llFunction_block, sampler_RW_multinomial, sampler_binary, sampler_posterior_predictive - RR 3.3.0 released · 2016-05-03
- 0.52016-03-29
- RR 3.2.0 released · 2015-04-16
Package metadata
- First published
- 2016-03-29
- Total releases
- 41 / 10 yrs
- License
- BSD_3_clause + file LICENSE | GPL (>= 2) OSI · relicensed from BSD_3_clause + file LICENSE in 0.6-7
- Copyright
- See COPYRIGHTS file.
- Minimum R
- ≥ 3.1.2
- Download size
- 3.2 MB
Cite
Cite this package
Run in R for the authors' preferred citation:
citation("nimble")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-18, which the citation names so these numbers can be found later. More on citing and the projects behind them.