BridgeStan

BridgeStan: Efficient in-memory access to the methods of a Stan model - Published in JOSS (2023)

https://github.com/roualdes/bridgestan

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

c cpp julia python r stan

Keywords from Contributors

meshing standardization pde interpretability closember ode pypy rating wavelets hydrology

Scientific Fields

Physics Physical Sciences - 40% confidence
Last synced: 4 months ago · JSON representation ·

Repository

BridgeStan provides efficient in-memory access through Python, Julia, and R to the methods of a Stan model.

Basic Info
Statistics
  • Stars: 104
  • Watchers: 6
  • Forks: 12
  • Open Issues: 7
  • Releases: 17
Topics
c cpp julia python r stan
Created over 3 years ago · Last pushed 4 months ago
Metadata Files
Readme Contributing License Citation

README.md

The BridgeStan logo

BridgeStan

DOCS DOI CI

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.

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.

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

JOSS Publication

BridgeStan: Efficient in-memory access to the methods of a Stan model
Published
July 22, 2023
Volume 8, Issue 87, Page 5236
Authors
Edward A. Roualdes ORCID
California State University, Chico
Brian Ward ORCID
Center for Computational Mathematics, Flatiron Institute
Bob Carpenter ORCID
Center for Computational Mathematics, Flatiron Institute
Adrian Seyboldt ORCID
PyMC Labs
Seth D. Axen ORCID
Cluster of Excellence Machine Learning: New Perspectives for Science, University of Tübingen
Editor
Nikoleta Glynatsi ORCID
Tags
Stan Python Rust C++ automatic differentiation

Citation (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

All Time
  • Total Commits: 425
  • Total Committers: 13
  • Avg Commits per committer: 32.692
  • Development Distribution Score (DDS): 0.384
Past Year
  • Commits: 52
  • Committers: 4
  • Avg Commits per committer: 13.0
  • Development Distribution Score (DDS): 0.442
Top Committers
Name Email 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
enhancement (10) question (7) c-api (5) python (4) cpp (4) good first issue (4) dependencies (4) documentation (3) windows (2) help wanted (2) julia (1) code-cleanup (1) rust (1) github_actions (1)
Pull Request Labels
dependencies (89) github_actions (67) documentation (30) julia (22) python (20) enhancement (18) cpp (18) rust (18) R-lang (17) code-cleanup (13) submodules (12) c-api (9) bug (4) windows (4) help wanted (1)

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.

  • Versions: 16
  • Dependent Packages: 1
  • Dependent Repositories: 0
  • Downloads: 549 Last month
Rankings
Dependent packages count: 7.0%
Average: 19.4%
Downloads: 20.8%
Dependent repos count: 30.5%
Maintainers (2)
Last synced: 4 months ago
juliahub.com: BridgeStan

BridgeStan provides efficient in-memory access through Python, Julia, and R to the methods of a Stan model.

  • Versions: 16
  • Dependent Packages: 5
  • Dependent Repositories: 0
  • Downloads: 10 Total
Rankings
Dependent repos count: 9.9%
Stargazers count: 13.7%
Forks count: 19.4%
Average: 20.5%
Dependent packages count: 38.9%
Last synced: 4 months ago
crates.io: bridgestan

Rust interface for BridgeStan

  • Versions: 13
  • Dependent Packages: 0
  • Dependent Repositories: 1
  • Downloads: 19,764 Total
Rankings
Forks count: 15.6%
Stargazers count: 16.2%
Dependent repos count: 16.5%
Average: 23.9%
Downloads: 35.3%
Dependent packages count: 36.1%
Maintainers (1)
Last synced: 4 months ago

Dependencies

R/DESCRIPTION cran
  • R6 >= 2.4.0 imports
  • testthat >= 3.0.0 suggests
.github/workflows/docs.yaml actions
  • actions/checkout v3 composite
  • actions/setup-python v4 composite
  • ad-m/github-push-action master composite
  • julia-actions/setup-julia v1 composite
.github/workflows/main.yaml actions
  • 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
.github/workflows/release.yaml actions
  • 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
docs/requirements.txt pypi
  • breathe *
  • ipykernel *
  • ipython *
  • ipywidgets *
  • myst-parser *
  • nbsphinx *
  • pydata-sphinx-theme *
  • sphinx >5
  • sphinx-copybutton *
python/pyproject.toml pypi