{"id":20917516,"url":"https://github.com/nimble-dev/nimblehmc","last_synced_at":"2025-07-17T03:02:39.734Z","repository":{"id":37801976,"uuid":"427937191","full_name":"nimble-dev/nimbleHMC","owner":"nimble-dev","description":"HMC and other derivative-based MCMC sampling algorithms for the nimble package","archived":false,"fork":false,"pushed_at":"2025-06-13T17:49:30.000Z","size":6137,"stargazers_count":13,"open_issues_count":6,"forks_count":1,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-07-08T02:49:33.801Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"R","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/nimble-dev.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":"CITATION.cff","codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2021-11-14T13:31:48.000Z","updated_at":"2025-06-13T17:49:34.000Z","dependencies_parsed_at":"2023-11-14T15:31:09.401Z","dependency_job_id":"910b66e6-5dfe-4193-98b3-31e19dda11e4","html_url":"https://github.com/nimble-dev/nimbleHMC","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/nimble-dev/nimbleHMC","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nimble-dev%2FnimbleHMC","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nimble-dev%2FnimbleHMC/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nimble-dev%2FnimbleHMC/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nimble-dev%2FnimbleHMC/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nimble-dev","download_url":"https://codeload.github.com/nimble-dev/nimbleHMC/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nimble-dev%2FnimbleHMC/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":264359769,"owners_count":23595996,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-18T16:33:55.322Z","updated_at":"2025-07-17T03:02:39.702Z","avatar_url":"https://github.com/nimble-dev.png","language":"R","readme":"# nimbleHMC\n\n[![tests](https://github.com/nimble-dev/nimbleHMC/workflows/tests/badge.svg)](https://github.com/nimble-dev/nimbleHMC/actions)\n\n[![DOI](https://joss.theoj.org/papers/10.21105/joss.06745/status.svg)](https://doi.org/10.21105/joss.06745)\n\nProvides derivative-based MCMC sampling algorithms and convenence functions, for use in conjunction with the MCMC engine avaialble in the `nimble` package.  Sampling algorithms include:\n\n- No-U-Turn Hamiltonian Monte Carlo (`NUTS`) sampler\n- Historical implementation of the original No-U-Turn HMC (`NUTS_classic`) sampler\n- Langevin sampler (*under development*)\n\nSee the HMC section of the [Nimble User Manual](https://r-nimble.org/html_manual/cha-mcmc.html#subsec:HMC) for more information and examples.\n\n[General package information](https://cran.r-project.org/web/packages/nimbleHMC/) about `nimbleHMC`, and the [complete API for package functions](https://cran.r-project.org/web/packages/nimbleHMC/nimbleHMC.pdf) are available on CRAN.\n\nAdditional information about the `nimble`package itself is available at the [nimble website](https://r-nimble.org/).\n\n\n\n### Installation and Package Requirements\n\nUse of `nimbleHMC` requires installation of the core `nimble` package.  Detailed instructions for installing `nimble` are available in the [`nimble` package README](https://github.com/nimble-dev/nimble/blob/devel/README.md).\n\n`nimbleHMC` must be used with version `1.0.0` or higher of `nimble`, or the latest version available on CRAN.  To check the version number of the currently installed version of `nimble`, use:\n\n```r\npackageVersion(\"nimble\")\n```\n\nThe `nimbleHMC` package itself can be installed directly from CRAN, using:\n\n```r\ninstall.packages(\"nimbleHMC\")\n```\n\n\n\u003c!--\nlibrary(remotes)\nremotes::install_github(\"nimble-dev/nimble\", ref = \"devel\", subdir = \"packages/nimble\")\nremotes::install_github(\"nimble-dev/nimbleHMC\", ref=\"master\", subdir = \"nimbleHMC\")\n\nFor errors during installation of `nimbleHMC` occuring on Windows machines, relating to either of the following error messages:\n\nError: package 'nimble' is not installed for 'arch = i386'\nError: loading failed for 'i386'\n\ntry installing the `nimbleHMC` package using:\n\nremotes::install_github(\"nimble-dev/nimbleHMC\", ref=\"master\", subdir = \"nimbleHMC\", INSTALL_opts=c(\"--no-multiarch\"))\n--\u003e\n\n\n\n### Automatic Differentiation\n\n`nimbleHMC` makes use of the automatic differentiation (AD) feature of `nimble`, which was released in `nimble` version 1.0.0.  See [Chapter 16: Automatic Derivatives](https://r-nimble.org/html_manual/cha-AD.html) of the Nimble User Manual for more information about the capabilities of the AD system, and how to use the AD system to calculate derivatives of functions written as `nimble` algorithms, as well as derivatives of model calculations.\n\n\u003c!--\nIn order to use HMC sampling (and other derivative-based algorithms), derivatives need to be enabled for `nimble` using the setting:\nnimbleOptions(enableDerivs = TRUE)\n--\u003e\n\nFor using HMC sampling on a model, derivative calculations need to be built into for the model object.  This is accomplished using the `buildDerivs = TRUE` argument in the call to `nimbleModel` as:\n```\nnimbleModel(code, constants, data, inits, buildDerivs = TRUE)\n```\n\nFor using HMC sampling on models that include user-defined distributions, you will need to include the argument `buildDerivs = TRUE` in the definition of your distribution, as:\n\n```\ndmy_distribution \u003c- nimbleFunction(\n    run = function(x = double(), param = double(), log = integer(0, default = 0)) {\n        ...\n    },\n    buildDerivs = TRUE\n)\n```\n\n\n### Contributing and Support\n\nContributions to the `nimbleHMC` package should be submitted via pull request on GitHub.  For additional guideliens on making contributions, please see the [contributing guidelines for the `nimble` package](https://github.com/nimble-dev/nimble/blob/devel/CONTRIBUTING.md).\n\nIssues, feature requests, or bugs should be reported using GitHub issues, submitted to the `nimbleHMC` repository.\n\nFor additional support using `nimble` or `nimbleHMC`, please see the [Nimble User Manual](https://r-nimble.org/html_manual/cha-welcome-nimble.html).  Any additional questions can be submitted to the [nimble-users Google group](https://groups.google.com/g/nimble-users).\n\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnimble-dev%2Fnimblehmc","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnimble-dev%2Fnimblehmc","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnimble-dev%2Fnimblehmc/lists"}