Stan Documentation

repository·develop·Indexed 25 days ago

https://github.com/stan-dev/stan

A C++ library for Bayesian inference and optimization providing NUTS (HMC), ADVI, and L-BFGS. Built on the Stan Math library for automatic differentiation, it is accessible via interfaces in R, Python, Julia, MATLAB, Stata, Mathematica, and the command line.

Tokens
367
Snippets
0
Records
3
Agent score
33%

What's inside Stan

  1. Overview of Stan inference capabilities

    develop

    Stan is a C++ package designed for Bayesian inference and optimization. It provides three primary inference methods:

    • Full Bayesian inference: Uses the No-U-Turn sampler (NUTS), a variant of Hamiltonian Monte Carlo (HMC).
    • Approximate Bayesian inference: Uses automatic differentiation variational inference (ADVI).
    • Penalized maximum likelihood estimation (MLE): Uses L-BFGS optimization.

    Stan is built upon the Stan Math library, which provides automatic differentiation (first- and higher-order) and a templated matrix, linear algebra, and probability special function library.

  2. Available Stan interfaces

    develop

    Stan is available through multiple interfaces across different programming languages and environments. While the core is C++, you can use Stan via:

    • R (e.g., RStan)
    • Python (e.g., PyStan)
    • MATLAB
    • Julia
    • Stata
    • Mathematica
    • Command Line
  3. Stan licensing information

    develop

    Licensing varies depending on the component used:

    • Core Stan, Stan Math library, and CmdStan: Licensed under new BSD.
    • RStan and PyStan: Licensed under GPLv3.
    • Other interfaces: Use various other open-source licenses.

    Important Dependency Note: The Stan math library depends on the Intel TBB library (Apache 2.0 license). Because Apache 2.0 is incompatible with GPL-2 when distributed as a unitary binary, users should review the Stan wiki Licensing page for details regarding distribution restrictions.