Interfaces
ways to install and run Stan
Installation
Installation procedures vary according to your choice of preferred programming environment.
-
The core Stan C++ libraries and command line interface can be installed from conda
-
Source code and pre-built binaries for linux can be installed from the Github stan-dev releases page.
Stan Interfaces
The Stan modeling language and statistical algorithms are exposed through interfaces into many popular computing environments.
Actively supported interfaces
-
CmdStan (shell, command-line terminal)
-
CmdStanR (R, lightweight wrapper for CmdStan)
-
CmdStanPy (Python, lightweight wrapper for CmdStan)
-
MathematicaStan (Mathematica)
-
RStan (R)
-
Stan.jl (Julia)
Unsupported interfaces
-
MatlabStan (MATLAB)
-
PyStan (Python)
-
StataStan (Stata)
-
ScalaStan (Scala)
Programs written in the Stan modeling language are portable across interfaces.
Higher-Level Interfaces
RStanArm and brms provide R formula interfaces that automate regression modeling.
The main differences between these packages are that RStanArm uses precompiled models whereas brms compiles on the fly, and that they support slightly different classes of models and automated posterior analyses; both allow raw Stan output to be recovered and used directly.
Lower-Level Interfaces
The Stan Math Library provides differentiable special functions, probability densities, and linear algebra in C++.
-
Stan Math Library (C++)
The Stan Core Library includes the language source-to-source compiler, I/O, inference algorithms, and posterior analysis algorithms, all in C++.
-
Stan (C++)
Useful Tools
ShinyStan provides interactive visual summaries and advanced posterior analysis of MCMC output.
-
ShinyStan (R)
The bayesplot package is a ggplot2-based plotting library for graphing parameter estimates, MCMC diagnostics, and posterior predictive checks.
-
bayesplot (R)
The rstantools package provides various tools for developers of R packages interfacing with Stan.
-
rstantools (R)
The loo package provides efficient leave-one-out cross-validation and WAIC calculations.
-
loo (R)
Stan Language Syntax Aware Editors
RStudio now recognizes .stan
files and provides syntax highlighting,
formatting, and checking.
Emacs
Vim has several plugins that offer syntax highlighting and support for Stan.
VSCode
Atom has a language definition plugin for Stan, which also provides the highlighting seen on GitHub.
Sublime Text
Jupyter Lab
Kate Editor
This highlighting is also the one used by the pandoc tool used by RMarkdown.
Javascript (Web)
-
Prism: a lightweight, robust, and elegant syntax highlighting library. (Source code)
-
Highlight.js: a syntax highlighter written in JavaScript (Source code)
Other