BridgeStan
BridgeStan: Efficient in-memory access to the methods of a Stan model - Published in JOSS (2023)
Science Score: 100.0%
This score indicates how likely this project is to be science-related based on various indicators:
-
✓CITATION.cff file
Found CITATION.cff file -
✓codemeta.json file
Found codemeta.json file -
✓.zenodo.json file
Found .zenodo.json file -
✓DOI references
Found 7 DOI reference(s) in README and JOSS metadata -
✓Academic publication links
Links to: arxiv.org, joss.theoj.org -
✓Committers with academic emails
4 of 13 committers (30.8%) from academic institutions -
○Institutional organization owner
-
✓JOSS paper metadata
Published in Journal of Open Source Software
Keywords
Keywords from Contributors
Scientific Fields
Repository
BridgeStan provides efficient in-memory access through Python, Julia, and R to the methods of a Stan model.
Basic Info
- Host: GitHub
- Owner: roualdes
- License: bsd-3-clause
- Language: Python
- Default Branch: main
- Homepage: https://roualdes.github.io/bridgestan
- Size: 6.91 MB
Statistics
- Stars: 104
- Watchers: 6
- Forks: 12
- Open Issues: 7
- Releases: 17
Topics
Metadata Files
README.md
BridgeStan
BridgeStan provides efficient in-memory access through Python, Julia, Rust, and R to the methods of a Stan model, including log densities, gradients, Hessians, and constraining and unconstraining transforms. The motivation was developing inference algorithms in higher-level languages for arbitrary Stan models.
Stan is a probabilistic programming language for coding statistical models. For an introduction to what can be coded in Stan, see the Stan User's Guide.
BridgeStan is currently shipping with Stan version 2.37.0
Documentation is available at https://roualdes.us/bridgestan/
Compatibility
BridgeStan has been tested with the following operating system and C++ compiler combinations.
- Linux: Ubuntu 20.04 with gcc 9.4.0
- Apple: Mac OS X 12.2 with Apple clang 11.0.3
- Microsoft: Windows 10 with gcc MSYS2 5.3.0
Installing BridgeStan
Installing the core of BridgeStan is as simple as
installing a C++ toolchain
(libraries, compiler, and the make command), and downloading this
repository. To download the latest development version, you can run
shell
git clone --recurse-submodules https://github.com/roualdes/bridgestan.git
For a full guide on installing, configuring, and using BridgeStan, consult the documentation
Using BridgeStan
Compiling a Stan program
To compile the Stan model in test_models/multi/multi.stan to a binary
shared object (.so file), use the following.
$ cd bridgestan
$ make test_models/multi/multi_model.so
This will require internet access the first time you run it in order
to download the appropriate Stan compiler for your platform into
<bridgestan-dir>/bin/stanc[.exe]
Example programs
This repository includes examples of calling Stan through BridgeStan in Python, Julia, R, Rust, and C.
From Python:
example.pyFrom Julia:
example.jlFrom R:
example.rFrom Rust:
example.rsFrom C:
example.c
Examples of other functionality can be found in the test folder for each interface.
Software using BridgeStan
We are aware of the following projects using BridgeStan.
Julia
- https://github.com/sethaxen/StanLogDensityProblems.jl
- https://github.com/Julia-Tempering/Pigeons.jl
- https://github.com/TuringLang/TuringBenchmarking.jl
Python
- https://github.com/pymc-devs/nutpie (through Rust)
- https://github.com/UoL-SignalProcessingGroup/retrospectr
- https://github.com/UoL-SignalProcessingGroup/SMC-NUTS
R
- https://github.com/JTorgander/hmc-sandbox
- https://github.com/UCL/rmcmc
- https://github.com/CerulloE1996/BayesMVP/
Other
- https://github.com/xhep-lab/polystan
Research using BridgeStan
If you use BridgeStan in your research, please consider citing our JOSS paper and letting us know so we can list your project here.
- Verified Density Compilation for a Probabilistic Programming Language
- Variational Inference with Gaussian Score Matching
- Stein Π-Importance Sampling
- Batch and match: black-box variational inference with a score-based divergence
- Variational Inference in Location-Scale Families: Exact Recovery of the Mean and Correlation Matrix
- Sampling From Multiscale Densities With Delayed Rejection Generalized Hamiltonian Monte Carlo
- MCBench: A Benchmark Suite for Monte Carlo Sampling Algorithms
Acknowledgements
The Julia and Python APIs were derived from the Stan Model Server API, which in turn was derived from ReddingStan.
Thanks to Sebastian Weber (GitHub @wds15) for enabling multi-threaded calls from Julia to a single Stan model instance.
Thanks to Adrian Seyboldt (GitHub @aseyboldt) for providing the Rust wrapper.
Owner
- Name: Edward A. Roualdes
- Login: roualdes
- Kind: user
- Location: Chico, CA
- Company: CSU, Chico
- Website: https://roualdes.us
- Repositories: 41
- Profile: https://github.com/roualdes
JOSS Publication
BridgeStan: Efficient in-memory access to the methods of a Stan model
Authors
Tags
Stan Python Rust C++ automatic differentiationCitation (CITATION.cff)
cff-version: "1.2.0"
authors:
- family-names: Roualdes
given-names: Edward A.
orcid: "https://orcid.org/0000-0002-8757-3463"
- family-names: Ward
given-names: Brian
orcid: "https://orcid.org/0000-0002-9841-3342"
- family-names: Carpenter
given-names: Bob
orcid: "https://orcid.org/0000-0002-2433-9688"
- family-names: Seyboldt
given-names: Adrian
orcid: "https://orcid.org/0000-0002-4239-4541"
- family-names: Axen
given-names: Seth D.
orcid: "https://orcid.org/0000-0003-3933-8247"
contact:
- family-names: Roualdes
given-names: Edward A.
orcid: "https://orcid.org/0000-0002-8757-3463"
doi: 10.5281/zenodo.7760173
message: If you use this software, please cite our article in the
Journal of Open Source Software.
preferred-citation:
authors:
- family-names: Roualdes
given-names: Edward A.
orcid: "https://orcid.org/0000-0002-8757-3463"
- family-names: Ward
given-names: Brian
orcid: "https://orcid.org/0000-0002-9841-3342"
- family-names: Carpenter
given-names: Bob
orcid: "https://orcid.org/0000-0002-2433-9688"
- family-names: Seyboldt
given-names: Adrian
orcid: "https://orcid.org/0000-0002-4239-4541"
- family-names: Axen
given-names: Seth D.
orcid: "https://orcid.org/0000-0003-3933-8247"
date-published: 2023-07-22
doi: 10.21105/joss.05236
issn: 2475-9066
issue: 87
journal: Journal of Open Source Software
publisher:
name: Open Journals
start: 5236
title: "BridgeStan: Efficient in-memory access to the methods of a
Stan model"
type: article
url: "https://joss.theoj.org/papers/10.21105/joss.05236"
volume: 8
title: "`BridgeStan`: Efficient in-memory access to the methods of a
Stan model"
GitHub Events
Total
- Create event: 26
- Commit comment event: 8
- Release event: 3
- Issues event: 17
- Watch event: 13
- Delete event: 28
- Issue comment event: 57
- Push event: 107
- Pull request review event: 30
- Pull request review comment event: 24
- Pull request event: 55
- Fork event: 1
Last Year
- Create event: 26
- Commit comment event: 8
- Release event: 3
- Issues event: 17
- Watch event: 13
- Delete event: 28
- Issue comment event: 57
- Push event: 107
- Pull request review event: 30
- Pull request review comment event: 24
- Pull request event: 55
- Fork event: 1
Committers
Last synced: 5 months ago
Top Committers
| Name | Commits | |
|---|---|---|
| Brian Ward | b****d@f****g | 262 |
| dependabot[bot] | 4****] | 53 |
| Edward A. Roualdes | e****s@c****u | 38 |
| Bob Carpenter | b****r@f****g | 21 |
| Bob Carpenter | c****p@a****m | 21 |
| github-actions[bot] | 4****] | 17 |
| Adrian Seyboldt | a****t | 4 |
| Seth Axen | s****h@s****m | 2 |
| Marco Inacio | m@m****m | 2 |
| Jonah Gabry | j****y@g****m | 2 |
| Rok Češnovar | r****r@f****i | 1 |
| Alex Phillips | a****s@g****m | 1 |
| Mike Lawrence | m****c@g****m | 1 |
Committer Domains (Top 20 + Academic)
Issues and Pull Requests
Last synced: 4 months ago
All Time
- Total issues: 78
- Total pull requests: 238
- Average time to close issues: 24 days
- Average time to close pull requests: 3 days
- Total issue authors: 27
- Total pull request authors: 10
- Average comments per issue: 4.49
- Average comments per pull request: 1.42
- Merged pull requests: 218
- Bot issues: 1
- Bot pull requests: 86
Past Year
- Issues: 10
- Pull requests: 56
- Average time to close issues: 13 days
- Average time to close pull requests: 1 day
- Issue authors: 6
- Pull request authors: 3
- Average comments per issue: 1.9
- Average comments per pull request: 0.45
- Merged pull requests: 48
- Bot issues: 1
- Bot pull requests: 30
Top Authors
Issue Authors
- roualdes (13)
- WardBrian (12)
- nsiccha (7)
- aseyboldt (7)
- bob-carpenter (7)
- sethaxen (4)
- avehtari (4)
- goedman (3)
- gil2rok (2)
- YuFuOliver (2)
- daslu (1)
- alexandrebouchard (1)
- fonnesbeck (1)
- dependabot[bot] (1)
- fredhu0514 (1)
Pull Request Authors
- WardBrian (126)
- dependabot[bot] (86)
- aseyboldt (7)
- roualdes (5)
- bob-carpenter (4)
- randommm (4)
- sethaxen (3)
- alecksphillips (1)
- mike-lawrence (1)
- jgabry (1)
Top Labels
Issue Labels
Pull Request Labels
Packages
- Total packages: 3
-
Total downloads:
- julia 10 total
- cargo 19,764 total
- pypi 549 last-month
-
Total dependent packages: 6
(may contain duplicates) -
Total dependent repositories: 1
(may contain duplicates) - Total versions: 45
- Total maintainers: 3
pypi.org: bridgestan
Access the methods of a Stan model in Python.
- Homepage: https://github.com/roualdes/bridgestan
- Documentation: https://bridgestan.readthedocs.io/
- License: BSD-3-Clause
-
Latest release: 2.6.2
published 8 months ago
Rankings
juliahub.com: BridgeStan
BridgeStan provides efficient in-memory access through Python, Julia, and R to the methods of a Stan model.
- Homepage: https://roualdes.github.io/bridgestan
- Documentation: https://docs.juliahub.com/General/BridgeStan/stable/
- License: BSD-3-Clause
-
Latest release: 2.6.2
published 9 months ago
Rankings
crates.io: bridgestan
Rust interface for BridgeStan
- Homepage: https://roualdes.github.io/bridgestan/latest/
- Documentation: https://docs.rs/bridgestan/
- License: BSD-3-Clause
-
Latest release: 2.6.2
published 8 months ago
Rankings
Maintainers (1)
Dependencies
- R6 >= 2.4.0 imports
- testthat >= 3.0.0 suggests
- actions/checkout v3 composite
- actions/setup-python v4 composite
- ad-m/github-push-action master composite
- julia-actions/setup-julia v1 composite
- KyleMayes/install-llvm-action v1 composite
- actions/cache v3 composite
- actions/checkout v3 composite
- actions/setup-python v4 composite
- julia-actions/setup-julia v1 composite
- r-lib/actions/setup-r v2.6.4 composite
- r-lib/actions/setup-r-dependencies v2.6.4 composite
- KyleMayes/install-llvm-action v1 composite
- actions/checkout v3 composite
- actions/setup-python v4 composite
- actions/upload-artifact v3 composite
- julia-actions/setup-julia v1 composite
- ncipollo/release-action v1 composite
- peter-evans/commit-comment v2 composite
- pypa/gh-action-pypi-publish v1.8.10 composite
- breathe *
- ipykernel *
- ipython *
- ipywidgets *
- myst-parser *
- nbsphinx *
- pydata-sphinx-theme *
- sphinx >5
- sphinx-copybutton *
