Stan: A Probabilistic Programming Language
- PMID: 36568334
- PMCID: PMC9788645
- DOI: 10.18637/jss.v076.i01
Stan: A Probabilistic Programming Language
Abstract
Stan is a probabilistic programming language for specifying statistical models. A Stan program imperatively defines a log probability function over parameters conditioned on specified data and constants. As of version 2.14.0, Stan provides full Bayesian inference for continuous-variable models through Markov chain Monte Carlo methods such as the No-U-Turn sampler, an adaptive form of Hamiltonian Monte Carlo sampling. Penalized maximum likelihood estimates are calculated using optimization methods such as the limited memory Broyden-Fletcher-Goldfarb-Shanno algorithm. Stan is also a platform for computing log densities and their gradients and Hessians, which can be used in alternative algorithms such as variational Bayes, expectation propagation, and marginal inference using approximate integration. To this end, Stan is set up so that the densities, gradients, and Hessians, along with intermediate quantities of the algorithm such as acceptance probabilities, are easily accessible. Stan can be called from the command line using the cmdstan package, through R using the rstan package, and through Python using the pystan package. All three interfaces support sampling and optimization-based inference with diagnostics and posterior analysis. rstan and pystan also provide access to log probabilities, gradients, Hessians, parameter transforms, and specialized plotting.
Keywords: Bayesian inference; Stan; algorithmic differentiation; probabilistic program.
Figures
References
-
- Betancourt M (2016). “Identifying the Optimal Integration Time in Hamiltonian Monte Carlo.” arXiv:1601.00225 [stat.ME]. URL https://arxiv.org/abs/1601.00225.
-
- Carpenter B, Hoffman MD, Brubaker M, Lee D, Li P, Betancourt M (2015). “The Stan Math Library: Reverse-Mode Automatic Differentiation in C++.” arXiv:1509.07164 [cs.MS]. URL https://arxiv.org/abs/1509.07164.
-
- Chacon S (2009). Pro Git. Apress. doi:10.1007/978-1-4302-1834-0. - DOI
-
- Cohen SD, Hindmarsh AC (1996). “CVODE, A Stiff/Nonstiff ODE Solver in C.” Computers in Physics, 10(2), 138–143.
-
- Driessen V (2010). “A Successful Git Branching Model.” URL http://nvie.com/posts/a-successful-git-branching-model/.
Grants and funding
LinkOut - more resources
Full Text Sources
Other Literature Sources
Medical
Research Materials