talira

Python interface to Stan for Bayesian inference

open sourceISCfree

PyStan is a Python interface to Stan: you pass it a Stan program and data, and it compiles the model and runs Stan's sampler, with an interface similar to RStan's. It caches compiled models and their samples automatically, and runs on Linux and macOS with a C++ compiler (gcc 9+ or clang 10+).

Problems it solves

  • fit a Stan model from a Python script
  • Bayesian inference in Python with Stan
  • run the eight schools model in Python

Features

  • compile and sample Stan models from Python
  • automatic caching of compiled models and samples
  • RStan-like interface

Limitations

  • Stan's install page says PyStan is no longer actively supported as of 3.10.0.1
  • Linux and macOS only.2

Alternatives

The same job

These do what PyStan does.

  1. CmdStanPy Lightweight Python interface to CmdStan
  2. Stan Probabilistic programming language for Bayesian statistical modelling
  3. CmdStan Command-line interface to Stan for compiling and running Bayesian models
  4. PyMC Bayesian modeling and probabilistic programming in Python

Compare PyStan with the top 3