{"id":17202491,"url":"https://github.com/roualdes/bridgestan","last_synced_at":"2025-10-04T05:25:15.420Z","repository":{"id":58884638,"uuid":"533431569","full_name":"roualdes/bridgestan","owner":"roualdes","description":"BridgeStan provides efficient in-memory access through Python, Julia, and R to the methods of a Stan model.","archived":false,"fork":false,"pushed_at":"2025-10-02T14:27:45.000Z","size":7169,"stargazers_count":105,"open_issues_count":7,"forks_count":12,"subscribers_count":6,"default_branch":"main","last_synced_at":"2025-10-03T13:46:01.363Z","etag":null,"topics":["c","cpp","julia","python","r","stan"],"latest_commit_sha":null,"homepage":"https://roualdes.us/bridgestan","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/roualdes.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE-CODE","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,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2022-09-06T17:26:14.000Z","updated_at":"2025-10-02T14:16:22.000Z","dependencies_parsed_at":"2023-10-14T18:49:15.815Z","dependency_job_id":"7e757d2a-e39a-40db-af8c-63d140c2f63d","html_url":"https://github.com/roualdes/bridgestan","commit_stats":null,"previous_names":[],"tags_count":18,"template":false,"template_full_name":null,"purl":"pkg:github/roualdes/bridgestan","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/roualdes%2Fbridgestan","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/roualdes%2Fbridgestan/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/roualdes%2Fbridgestan/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/roualdes%2Fbridgestan/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/roualdes","download_url":"https://codeload.github.com/roualdes/bridgestan/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/roualdes%2Fbridgestan/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":278187818,"owners_count":25944822,"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","status":"online","status_checked_at":"2025-10-03T02:00:06.070Z","response_time":53,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["c","cpp","julia","python","r","stan"],"created_at":"2024-10-15T02:14:48.806Z","updated_at":"2025-10-04T05:25:15.415Z","avatar_url":"https://github.com/roualdes.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cpicture\u003e\n  \u003csource media=\"(prefers-color-scheme: dark)\" srcset=\"./docs/_static/image/logo_w.png\"\u003e\n  \u003cimg alt=\"The BridgeStan logo\" src=\"./docs/_static/image/logo.png\" align=\"right\" width=25%\u003e\n\u003c/picture\u003e\n\n# BridgeStan\n\n[![DOCS](https://img.shields.io/badge/docs-latest-blue)](https://roualdes.us/bridgestan/) [![DOI](https://joss.theoj.org/papers/10.21105/joss.05236/status.svg)](https://doi.org/10.21105/joss.05236) [![CI](https://github.com/roualdes/bridgestan/actions/workflows/main.yaml/badge.svg)](https://github.com/roualdes/bridgestan/actions/workflows/main.yaml)\n\nBridgeStan provides efficient in-memory access through Python, Julia,\nRust, and R to the methods of a [Stan](https://mc-stan.org) model, including\nlog densities, gradients, Hessians, and constraining and unconstraining\ntransforms.  The motivation was developing inference algorithms in\nhigher-level languages for arbitrary Stan models.\n\nStan is a probabilistic programming language for coding statistical\nmodels.  For an introduction to what can be coded in Stan, see the\n[*Stan User's Guide*](https://mc-stan.org/docs/stan-users-guide/index.html).\n\nBridgeStan is currently shipping with Stan version 2.37.0\n\nDocumentation is available at https://roualdes.us/bridgestan/\n\n\n#### Compatibility\n\nBridgeStan has been tested with the following operating system and C++\ncompiler combinations.\n\n* Linux: Ubuntu 20.04 with gcc 9.4.0\n* Apple: Mac OS X 12.2 with Apple clang 11.0.3\n* Microsoft: Windows 10 with gcc MSYS2 5.3.0\n\n\n## Installing BridgeStan\n\nInstalling the core of BridgeStan is as simple as\n[installing a C++ toolchain](https://mc-stan.org/docs/cmdstan-guide/installation.html#cpp-toolchain)\n(libraries, compiler, and the `make` command), and downloading this\nrepository. To download the latest development version, you can run\n\n```shell\ngit clone --recurse-submodules https://github.com/roualdes/bridgestan.git\n```\n\nFor a full guide on installing, configuring, and using BridgeStan, consult the\n[documentation](https://roualdes.us/bridgestan/latest/getting-started.html)\n\n## Using BridgeStan\n\n### Compiling a Stan program\n\nTo compile the Stan model in `test_models/multi/multi.stan` to a binary\nshared object (`.so` file), use the following.\n\n```\n$ cd bridgestan\n$ make test_models/multi/multi_model.so\n```\n\nThis will require internet access the first time you run it in order\nto download the appropriate Stan compiler for your platform into\n`\u003cbridgestan-dir\u003e/bin/stanc[.exe]`\n\n### Example programs\n\nThis repository includes examples of calling Stan through BridgeStan\nin Python, Julia, R, Rust, and C.\n\n* From Python: [`example.py`](python/example.py)\n\n* From Julia: [`example.jl`](julia/example.jl)\n\n* From R: [`example.r`](R/example.R)\n\n* From Rust: [`example.rs`](rust/examples/example.rs)\n\n* From C: [`example.c`](c-example/example.c)\n\nExamples of other functionality can be found in the `test` folder for each interface.\n\n## Software using BridgeStan\n\nWe are aware of the following projects using BridgeStan.\n\n### Julia\n\n- https://github.com/sethaxen/StanLogDensityProblems.jl\n- https://github.com/Julia-Tempering/Pigeons.jl\n- https://github.com/TuringLang/TuringBenchmarking.jl\n\n### Python\n\n- https://github.com/pymc-devs/nutpie (through Rust)\n- https://github.com/UoL-SignalProcessingGroup/retrospectr\n- https://github.com/UoL-SignalProcessingGroup/SMC-NUTS\n\n\n### R\n\n- https://github.com/JTorgander/hmc-sandbox\n- https://github.com/UCL/rmcmc\n- https://github.com/CerulloE1996/BayesMVP/\n\n### Other\n\n- https://github.com/xhep-lab/polystan\n\n## Research using BridgeStan\n\nIf you use BridgeStan in your research, please consider citing [our JOSS paper](https://joss.theoj.org/papers/10.21105/joss.05236)\nand letting us know so we can list your project here.\n\n- [*Verified Density Compilation for a Probabilistic Programming Language*](https://doi.org/10.1145/3591245)\n- [*Variational Inference with Gaussian Score Matching*](https://arxiv.org/pdf/2307.07849.pdf)\n- [*Stein Π-Importance Sampling*](https://arxiv.org/pdf/2305.10068.pdf)\n- [*Batch and match: black-box variational inference with a score-based divergence*](https://arxiv.org/abs/2402.14758)\n- [*Variational Inference in Location-Scale Families: Exact Recovery of the Mean and Correlation Matrix*](https://arxiv.org/abs/2410.11067)\n- [*Sampling From Multiscale Densities With Delayed Rejection Generalized Hamiltonian Monte Carlo*](https://arxiv.org/abs/2406.02741)\n- [*MCBench: A Benchmark Suite for Monte Carlo Sampling Algorithms*](https://arxiv.org/abs/2501.03138)\n\n## Acknowledgements\n\nThe Julia and Python APIs were derived from the\n[Stan Model Server](https://github.com/bob-carpenter/stan-model-server/)\nAPI, which in turn was derived from\n[ReddingStan](https://github.com/dmuck/redding-stan).\n\nThanks to Sebastian Weber (GitHub [@wds15](https://github.com/wds15))\nfor enabling multi-threaded calls from Julia to a single Stan model instance.\n\nThanks to Adrian Seyboldt (GitHub [@aseyboldt](https://github.com/aseyboldt))\nfor providing the Rust wrapper.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Froualdes%2Fbridgestan","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Froualdes%2Fbridgestan","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Froualdes%2Fbridgestan/lists"}