Skip to main content

Python interface to CmdStan

Project description


pipeline status coverage report PyPI package version Documentation Status

Python interface to CmdStan.


After installing, pip install -U pycmdstan, a contrived example would be

from pycmdstan import Model, Run

model = Model('''
data { vector[20] x; real mu; }
parameters { real sig; }
model { x ~ normal(mu, sig); }

assert model.sample(data={'mu': 5.0, x: randn(20)}, chains=4).R_hat.max() < 1.2

See the docs for more.


Contributions are welcome, please start in the issue tracker. Use YAPF to format the code. The Dockerfile can ease local development,

docker build -t pycmdstan .
docker run --rm -it pycmdstan pytest -n4 pycmdstan/


  • PSIS code is by Aki Vehtari & Tuomas Sivula (BSD licensed, repo here)

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for pycmdstan, version 0.9
Filename, size File type Python version Upload date Hashes
Filename, size pycmdstan-0.9-py3-none-any.whl (16.3 kB) File type Wheel Python version py3 Upload date Hashes View
Filename, size pycmdstan-0.9.tar.gz (14.4 kB) File type Source Python version None Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring DigiCert DigiCert EV certificate Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page