skip to main content


Title: Stan : A Probabilistic Programming Language

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 also 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.
 [1] ;  [1] ;  [2] ;  [1] ;  [1] ;  [1] ;  [3] ;  [4] ;  [1] ;  [5]
  1. Columbia Univ., New York, NY (United States)
  2. Adobe Creative Intelligence Lab, San Jose, CA (United States)
  3. York Univ., Toronto (Canada)
  4. NPD Group, Inc., Port Washington, NY (United States)
  5. Indiana Univ., Bloomington, IN (United States)
Publication Date:
Grant/Contract Number:
SC0002099; ATM-0934516; ED-GRANTS-032309-005; R305D090006-09A; 1G20RR030893-01; CNS-1205516
Accepted Manuscript
Journal Name:
Journal of Statistical Software
Additional Journal Information:
Journal Volume: 76; Journal Issue: 1; Journal ID: ISSN 1548-7660
Research Org:
Columbia Univ., New York, NY (United States); Harvard Univ., Cambridge, MA (United States)
Sponsoring Org:
USDOE; National Science Foundation (NSF); US Dept. of Education, Inst. of Education Sciences (IES); National Institutes of Health (NIH)
Country of Publication:
United States
97 MATHEMATICS AND COMPUTING; probabilistic program; Bayesian inference; algorithmic differentiation; Stan
OSTI Identifier: