Stan Toolkit
A curated collection of tools and interfaces to help you work effectively with Stan across various programming environments and stages of your modeling workflow.
Language-Specific Stan Interfaces
Write, compile, and run Stan models directly within your programming environment.
| Language | Tool | Description |
|---|---|---|
| R | CmdStanR | Interface to Stan for R, based on CmdStan. Recommended interface for R users. |
| Python | CmdStanPy | Interface to Stan for Python, based on CmdStan. Recommended interface for Python users. |
| Web | Stan Playground | Browser-based editor and runtime environment for Stan models. Highly recommended for new users. |
| Julia | Stan.jl | Interface to Stan for Julia users. |
| MATLAB | MatlabStan | Interface to Stan for MATLAB users. |
| Shell | CmdStan | Command-line interface to Stan, usable from any shell environment. |
| R | RStan | R interface to Stan. |
| Python | PyStan | Legacy Python interface to Stan. |
For detailed installation instructions see Getting Started.
High-Level Modeling Interfaces
Simplify model specification in R.
| Language | Tool | Description |
|---|---|---|
| R | brms | Use extended lme4-like formula syntax to specify and fit multivariate and multilevel models in Stan. Requires CmdStanR or RStan, plus C++ compiler. |
| R | rstanarm | Provides robust and efficient pre-compiled Stan versions of R model-fitting packages. Easily installed from CRAN, no C++ compiler needed. |
Visualization, Diagnostics, and Validation Tools
Validate, visualize, and compare fitted models to ensure robust results.
| Language | Tool | Description |
|---|---|---|
| R | bayesplot | Plotting functions for posterior analysis, diagnostics, and model checking. |
| R | loo | Efficient leave-one-out cross-validation and WAIC for Bayesian models. |
| R | posterior | Tools for working with posterior distributions. |
| R | projpred | Projection predictive variable selection for Bayesian models. |
| Python | ArviZ | Exploratory analysis of Bayesian models with extensive visualization capabilities. |
| Julia | ArviZ.jl | Julia interface to ArviZ for Bayesian analysis. |
| Web | MCMC Monitor | Web-based tool for monitoring MCMC diagnostics. |
Developer Tools and APIs
Access Stan’s computational backend for advanced applications and development.
| Language | Tool | Description |
|---|---|---|
| C++ | Stan Math Library | Automatic differentiation and mathematical functions used by Stan. |
| Multiple Languages | BridgeStan | Library providing bindings to a model’s log densities, gradients, and more for C++, Python, Julia, R, and Rust. |
| R | rstantools | Tools for developers of R packages interfacing with Stan. |
| OCaml | stanc3 | The Stan compiler and programatic tools for manipulating Stan programs. |
Editor and IDE Support
Enhance your coding experience with Stan language support in your favorite editor.
| Editor/IDE | Tool | Description |
|---|---|---|
| RStudio | Built-in Support | RStudio 1.2+ includes Stan syntax highlighting and code snippets (Source code) |
| Visual Studio Code | VSCode Stan Extension | Stan language support with syntax highlighting, linting, autocompletion, and snippets |
| Emacs | stan-mode stan-ts-mode |
Major mode for Stan with syntax highlighting and indentation Tree-sitter based (Emacs 29+) major mode for Stan. Fewer features than stan-mode, but generally more up to date syntax highlighting. |
| Vim | stan-vim | Syntax highlighting, indentation, and code folding for Stan in Vim |
| JupyterLab | CmdStanJupyter | Syntax highlighting for Stan code blocks in JupyterLab |
| Javascript | Prism Highlight.js |
Lightweight syntax highlighting library (Source code) Syntax highlighter written in javascript (Source code) |
| Markdown | Pandoc Pygments |
Stan syntax highlighting for document formats (Source code) Python highlighter for Stan code blocks (Source code) |
| Zed | zed-stan-extension | Syntax highlighting for Stan in the Zed editor |
| LaTeX | lstbayes | LaTeX listings for Stan syntax highlighting |
| Sublime Text | SublimeStan | Syntax highlighting for Stan in Sublime Text |
| Atom | atom-language-stan | Stan language support in Atom editor and GitHub.com |
| Language Server Protocol Clients (many editors) | stan-language-server | Autocomplete, code diagnostics, and more. Powers some of the above, such as the VSCode and Zed extensions. |
Software Packages built on Stan
| Language | Tool | Description |
|---|---|---|
| Python, R | PROPHET | Forecasting at scale for time series data. |
| R | blavaan | R package for Bayesian latent variable analysis. |
| R | rethinking | Software for book Statistical Rethinking |
Additional R packages on CRAN which are built on Stan can be found in the reverse links from the packages rstan and rstanarm.