Documentation
learn to use Stan
Language Manual
The modeling language manual contains a guide to programming in Stan with example models, a reference manual for the language itself, and a reference guide to the built-in special functions and probability functions. Stan’s modeling language is portable across all interfaces.
-
Modeling Language User's Guide and Reference Manual, Version 2.14.0
(GitHub pdf, CC-BY 4.0 license)
Examples
The quick start guides for each interface contain some example models that illustrate how to run Stan.
The modeling language manual contains other examples of model to illustrate coding techniques in Stan.
A larger set of example models translating the BUGS examples (Volumes 1 through 3) and the models from several Bayesian textbooks are also available:
-
Example Models (GitHub)
Case Studies
There are a number of longer, tutorial case studies for particular applications, models, and methodologies. These can be found on their own page:
Tutorials
Getting-started material for Stan, its interfaces, and underlying technology.
Text
-
Thomas P. Harte and R. Michael Weylandt (2016) Modern Bayesian Tools for Time Series Analysis. 2016. R in Finance Conference, Chicago, IL.
-
Jim Savage (2016) A quick-start introduction to Stan for economists. A QuantEcon Notebook.
-
Michael Clark (2015) Bayesian Basics (including Stan, BUGS, and JAGS) Center for Statistical Consultation and Research, University of Michigan.
-
Tanner Sorensen and Shravan Vasishth (2015) A tutorial on fitting Bayesian linear mixed models using Stan. 2015. University of Postdam. Earlier draft, arXiv: 1506.06201.
-
Aki Vehtari, Andrew Gelman, and Jonah Gabry (2015) Practical Bayesian model evaluation using leave-one-out cross-validation and WAIC. In Statistics and Computing, Online first doi:10.1007/s11222-016-9696-4. arXiv: 1507.04544.
Video
-
Scalable Bayesian Inference with Hamiltonian Monte Carlo (40 minutes) (ICERM Video Archive)
Michael Betancourt (2016) -
Some Bayesian Modeling Techniques in Stan (100 minutes) (YouTube)
Michael Betancourt (2016) -
Scalable Bayesian Inference with Hamiltonian Monte Carlo (60 minutes) (YouTube)
Michael Betancourt (2016) -
ADVI — 10 Minute Presentation (YouTube)
Alp Kucukelbir (2015) -
Probabilistic Modeling and Inference Made Easy (60 minutes) (Vimeo).
Bob Carpenter (2015) -
Bayesian Inference and MCMC (3 hours) (YouTube).
Bob Carpenter (2015) -
Bayes Days 2015 Stan/RStan Tutorials (5 hours) (YouTube)
Mike Lawrence (2015) -
Stan for the beginners [Bayesian inference] in 6 mins (close captioned) (YouTube)
Ehsan Karim (2015) -
Efficient Bayesian inference with Hamiltonian Monte Carlo (YouTube)
Michael Betancourt (2014) Machine Learning Summer School, Reykjavik -
The Stan modeling language (YouTube)
Michael Betancourt (2014) Machine Learning Summer School, Reykjavik
Papers
-
Cole C. Monnahan, James T. Thorson, and Trevor A. Branch (2016) Faster estimation of Bayesian models in ecology using Hamiltonian Monte Carlo. Methods in Ecology and Evolution.
-
Bob Carpenter, Andrew Gelman, Matt Hoffman, Daniel Lee, Ben Goodrich, Michael Betancourt, Marcus A. Brubaker, Jiqiang Guo, Peter Li, and Allen Riddell (2016) In press for Journal of Statistical Software. Stan: A Probabilistic Programming Language.
-
Andrew Gelman, Daniel Lee, and Jiqiang Guo (2015) Stan: A probabilistic programming language for Bayesian inference and optimization. In press, Journal of Educational and Behavior Science.
-
Bob Carpenter, Matthew D. Hoffman, Marcus Brubaker, Daniel Lee, Peter Li, and Michael Betancourt (2015) The Stan Math Library: Reverse-Mode Automatic Differentiation in C++. arXiv: 1509.07164
Books
-
Kentarou Matsuura (2016) Bayesian Statistical Modeling Using Stan and R. Kyoritsu Shuppan Co., Ltd.
-
Julian J. Faraway (2016) Extending the Linear Model with R: Generalized Linear, Mixed Effects and Nonparametric Regression Models, Second Edition. Chapman & Hall/CRC Press.
-
Richard McElreath (2016) Statistical Rethinking: A Bayesian Course with Examples in R and Stan. Chapman & Hall/CRC Press.
free online: Chapters 1 and 12; code examples; video tutorials (follow title link above) -
Fränzi Korner-Nievergelt, Tobias Roth, Stefanie von Felten, Jérôme Guélat, Bettina Almasi, Pius Korner-Nievergelt (2015) Bayesian Data Analysis in Ecology Using Linear Models with R, BUGS, and Stan. Academic Press.
-
John Kruschke (2015) Doing Bayesian Data Analysis, Second Edition: A Tutorial with R, JAGS, and Stan. Academic Press.
-
Andrew Gelman, John B. Carlin, Hal S. Stern, David B. Dunson, Aki Vehtari, and Donald B. Rubin (2013) Bayesian Data Analysis, Third Edition. Chapman & Hall/CRC Press.
free online: Appendix C: Computation in R and Stan
