BridgeStan: Efficient in-memory access to the methods of a Stan model
Edward A. Roualdes, Brian Ward, Bob Carpenter, Adrian Seyboldt, Seth D. Axen · The Journal of Open Source Software · 2023
Stan provides a probabilistic programming language in which users can code Bayesian models (Carpenter et al., 2017; Stan Development Team, 2022).A Stan program is transpiled to to a C++ class that links to the Stan math library to implement smooth, unconstrained posterior log densities, gradients, and Hessians as well as constraining/unconstraining transforms.Implementation is provided through automatic differentiation in the Stan math library (Carpenter et al., 2015).BridgeStan provides in-memory access to the methods of Stan models through Python, Julia, R, and Rust.This allows algorithm development in these languages with the numerical efficiency and expressiveness of Stan models.Furthermore, these features are exposed through a language-agnostic C API, allowing foreign function interfaces in other languages to utilize BridgeStan with minimal additional development.