Skip to main content
Files added late

6 files were added to this release more than 14 days after its initial publication. Inspect the release files before installing.

PyStan: The Python Interface to Stan

Stan logo

pypi version travis-ci build status appveyor-ci build status zenodo citation DOI

PyStan provides a Python interface to Stan, a package for Bayesian inference using the No-U-Turn sampler, a variant of Hamiltonian Monte Carlo.

For more information on Stan and its modeling language, see the Stan User’s Guide and Reference Manual at http://mc-stan.org/.

Similar projects

Detailed Installation Instructions

Detailed installation instructions can be found in the doc/installation_beginner.md file.

Quick Installation (Linux and macOS)

NumPy and Cython (version 0.22 or greater) are required. matplotlib is optional.

PyStan and the required packages may be installed from the Python Package Index using pip.

pip install pystan

Alternatively, if Cython (version 0.22 or greater) and NumPy are already available, PyStan may be installed from source with the following commands

git clone --recursive https://github.com/stan-dev/pystan.git
cd pystan
python setup.py install

If you encounter an ImportError after compiling from source, try changing out of the source directory before attempting import pystan. On Linux and OS X cd /tmp will work.

Example

import pystan
import numpy as np
import matplotlib.pyplot as plt

schools_code = """
data {
    int<lower=0> J; // number of schools
    real y[J]; // estimated treatment effects
    real<lower=0> sigma[J]; // s.e. of effect estimates
}
parameters {
    real mu;
    real<lower=0> tau;
    real eta[J];
}
transformed parameters {
    real theta[J];
    for (j in 1:J)
        theta[j] = mu + tau * eta[j];
}
model {
    eta ~ normal(0, 1);
    y ~ normal(theta, sigma);
}
"""

schools_dat = {'J': 8,
               'y': [28,  8, -3,  7, -1,  1, 18, 12],
               'sigma': [15, 10, 16, 11,  9, 11, 10, 18]}

sm = pystan.StanModel(model_code=schools_code)
fit = sm.sampling(data=schools_dat, iter=1000, chains=4)

print(fit)

eta = fit.extract(permuted=True)['eta']
np.mean(eta, axis=0)

# if matplotlib is installed (optional, not required), a visual summary and
# traceplot are available
fit.plot()
plt.show()

Metadata

Release files for pystan 2.19.0.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Files added late

6 files were uploaded more than 14 days after the first file in this release.

While project maintainers occasionally add legitimate files to an existing release, late additions can also indicate a security compromise.

We recommend inspecting the release files before installing.

Source distribution (sdist)

Source distribution for pystan 2.19.0.0
File Size Uploaded
pystan-2.19.0.0.tar.gz 16.5 MB Details

Built distributions (wheels)

Table of built distributions (wheels) for pystan 2.19.0.0
File
pystan-2.19.0.0-cp37-cp37m-win_amd64.whl CPython 3.7 CPython 3.7 pymalloc Windows x86-64 Details
pystan-2.19.0.0-cp37-cp37m-win32.whl CPython 3.7 CPython 3.7 pymalloc Windows x86-32 Details
pystan-2.19.0.0-cp37-cp37m-manylinux1_x86_64.whl CPython 3.7 CPython 3.7 pymalloc Linux glibc 2.5+ x86-64 Details
pystan-2.19.0.0-cp37-cp37m-macosx_10_6_intel.macosx_10_9_intel.macosx_10_9_x86_64.macosx_10_10_intel.macosx_10_10_x86_64.whl CPython 3.7 CPython 3.7 pymalloc macOS 10.10+ Intel (x86-64, i386), macOS 10.10+ x86-64, macOS 10.9+ x86-64, macOS 10.6+ Intel (x86-64, i386), macOS 10.9+ Intel (x86-64, i386) Details
pystan-2.19.0.0-cp36-cp36m-win_amd64.whl CPython 3.6 CPython 3.6 pymalloc Windows x86-64 Details
pystan-2.19.0.0-cp36-cp36m-win32.whl CPython 3.6 CPython 3.6 pymalloc Windows x86-32 Details
pystan-2.19.0.0-cp36-cp36m-manylinux1_x86_64.whl CPython 3.6 CPython 3.6 pymalloc Linux glibc 2.5+ x86-64 Details
pystan-2.19.0.0-cp36-cp36m-macosx_10_6_intel.macosx_10_9_intel.macosx_10_9_x86_64.macosx_10_10_intel.macosx_10_10_x86_64.whl CPython 3.6 CPython 3.6 pymalloc macOS 10.10+ x86-64, macOS 10.6+ Intel (x86-64, i386), macOS 10.9+ x86-64, macOS 10.9+ Intel (x86-64, i386), macOS 10.10+ Intel (x86-64, i386) Details
pystan-2.19.0.0-cp35-cp35m-win_amd64.whl CPython 3.5 CPython 3.5 pymalloc Windows x86-64 Details
pystan-2.19.0.0-cp35-cp35m-win32.whl CPython 3.5 CPython 3.5 pymalloc Windows x86-32 Details
pystan-2.19.0.0-cp35-cp35m-manylinux1_x86_64.whl CPython 3.5 CPython 3.5 pymalloc Linux glibc 2.5+ x86-64 Details
pystan-2.19.0.0-cp35-cp35m-macosx_10_6_intel.macosx_10_9_intel.macosx_10_9_x86_64.macosx_10_10_intel.macosx_10_10_x86_64.whl CPython 3.5 CPython 3.5 pymalloc macOS 10.10+ Intel (x86-64, i386), macOS 10.10+ x86-64, macOS 10.6+ Intel (x86-64, i386), macOS 10.9+ x86-64, macOS 10.9+ Intel (x86-64, i386) Details
pystan-2.19.0.0-cp27-cp27mu-manylinux1_x86_64.whl CPython 2.7 CPython 2.7 pymalloc wide-unicode Linux glibc 2.5+ x86-64 Details
pystan-2.19.0.0-cp27-cp27m-manylinux1_x86_64.whl CPython 2.7 CPython 2.7 pymalloc Linux glibc 2.5+ x86-64 Details
pystan-2.19.0.0-cp27-cp27m-macosx_10_6_intel.macosx_10_9_intel.macosx_10_9_x86_64.macosx_10_10_intel.macosx_10_10_x86_64.whl CPython 2.7 CPython 2.7 pymalloc macOS 10.9+ Intel (x86-64, i386), macOS 10.10+ Intel (x86-64, i386), macOS 10.10+ x86-64, macOS 10.6+ Intel (x86-64, i386), macOS 10.9+ x86-64 Details

Total release size: 908.1 MB

Release files / pystan-2.19.0.0.tar.gz

Download URL pystan-2.19.0.0.tar.gz
Size 16.5 MB
Tags Source
SHA-256 checksum
How to use checksums
b85301b960d5991918b40bd64a4e9321813657a9fc028e0f39edce7220a309eb
BLAKE2b-256 checksum
How to use checksums
4864dc7152b7ca88903669c296beddf3a8de839c3900684136514293dc99d432
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.11.0 pkginfo/1.4.2 requests/2.21.0 setuptools/40.8.0 requests-toolbelt/0.8.0 tqdm/4.19.5 CPython/3.6.5

Release files / pystan-2.19.0.0-cp37-cp37m-win_amd64.whl

File added late

This file was uploaded more than 14 days after the first file in this release.

While project maintainers occasionally add legitimate files to an existing release, late additions can also indicate a security compromise.

We recommend inspecting the release file before installing.

Download URL pystan-2.19.0.0-cp37-cp37m-win_amd64.whl
Size 79.7 MB
Tags CPython 3.7 CPython 3.7 pymalloc Windows x86-64
SHA-256 checksum
How to use checksums
b8bfdc0d9cae3eb2ee627ed3a69a910b9bee14dc7332249b183018460b82e9e6
BLAKE2b-256 checksum
How to use checksums
d2882411ad496304673559a0dbb32b8ecd83c1fbc52cf83d9e1cca2ed66cbba6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.11.0 pkginfo/1.4.2 requests/2.21.0 setuptools/40.8.0 requests-toolbelt/0.8.0 tqdm/4.19.5 CPython/3.6.5

Release files / pystan-2.19.0.0-cp37-cp37m-win32.whl

File added late

This file was uploaded more than 14 days after the first file in this release.

While project maintainers occasionally add legitimate files to an existing release, late additions can also indicate a security compromise.

We recommend inspecting the release file before installing.

Download URL pystan-2.19.0.0-cp37-cp37m-win32.whl
Size 55.7 MB
Tags CPython 3.7 CPython 3.7 pymalloc Windows x86-32
SHA-256 checksum
How to use checksums
c1758a0a3580503d7b3cb54b89b84a3f37f7a67b875175a477b1958485e9d381
BLAKE2b-256 checksum
How to use checksums
5921362c04918f621903d8359754fa8d6b6fcecd31765ce6f4ecd7ddfc80432f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.11.0 pkginfo/1.4.2 requests/2.21.0 setuptools/40.8.0 requests-toolbelt/0.8.0 tqdm/4.19.5 CPython/3.6.5

Release files / pystan-2.19.0.0-cp37-cp37m-manylinux1_x86_64.whl

Download URL pystan-2.19.0.0-cp37-cp37m-manylinux1_x86_64.whl
Size 67.2 MB
Tags CPython 3.7 CPython 3.7 pymalloc Linux glibc 2.5+ x86-64
SHA-256 checksum
How to use checksums
2b33917067123eec8afda90942e26eb4837810c6897db1e5949b42a08d0e23b2
BLAKE2b-256 checksum
How to use checksums
7beac004537cd92c7dcc0112756d2cbc99707e3f67966e57285cdaca68b2e364
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.11.0 pkginfo/1.4.2 requests/2.21.0 setuptools/40.8.0 requests-toolbelt/0.8.0 tqdm/4.19.5 CPython/3.6.5

Release files / pystan-2.19.0.0-cp37-cp37m-macosx_10_6_intel.macosx_10_9_intel.macosx_10_9_x86_64.macosx_10_10_intel.macosx_10_10_x86_64.whl

Download URL pystan-2.19.0.0-cp37-cp37m-macosx_10_6_intel.macosx_10_9_intel.macosx_10_9_x86_64.macosx_10_10_intel.macosx_10_10_x86_64.whl
Size 37.4 MB
Tags CPython 3.7 CPython 3.7 pymalloc macOS 10.10+ Intel (x86-64, i386) macOS 10.10+ x86-64 macOS 10.6+ Intel (x86-64, i386) macOS 10.9+ Intel (x86-64, i386) macOS 10.9+ x86-64
SHA-256 checksum
How to use checksums
b8e6e4bef4ead53d49f59e9d30a6a7e64777db2b7d99a74e1e320f74eed4431a
BLAKE2b-256 checksum
How to use checksums
828b9b48058afd41c41ba704eacae7ee2186a16f2cb6e22970fc97deca8bd6df
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.11.0 pkginfo/1.4.2 requests/2.21.0 setuptools/40.8.0 requests-toolbelt/0.8.0 tqdm/4.19.5 CPython/3.6.5

Release files / pystan-2.19.0.0-cp36-cp36m-win_amd64.whl

File added late

This file was uploaded more than 14 days after the first file in this release.

While project maintainers occasionally add legitimate files to an existing release, late additions can also indicate a security compromise.

We recommend inspecting the release file before installing.

Download URL pystan-2.19.0.0-cp36-cp36m-win_amd64.whl
Size 79.7 MB
Tags CPython 3.6 CPython 3.6 pymalloc Windows x86-64
SHA-256 checksum
How to use checksums
d7716156ae3739f7a38c9817824b7cf837f5e42ae2603d4020bc00a311f0df99
BLAKE2b-256 checksum
How to use checksums
9604857bed4cfe09994b8027e86e6fb345dfa398afc3a26cb8e2dd0d5a865cba
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.11.0 pkginfo/1.4.2 requests/2.21.0 setuptools/40.8.0 requests-toolbelt/0.8.0 tqdm/4.19.5 CPython/3.6.5

Release files / pystan-2.19.0.0-cp36-cp36m-win32.whl

File added late

This file was uploaded more than 14 days after the first file in this release.

While project maintainers occasionally add legitimate files to an existing release, late additions can also indicate a security compromise.

We recommend inspecting the release file before installing.

Download URL pystan-2.19.0.0-cp36-cp36m-win32.whl
Size 55.7 MB
Tags CPython 3.6 CPython 3.6 pymalloc Windows x86-32
SHA-256 checksum
How to use checksums
3378fb5a7285077226bd59c6c1d1a3878f4156dc5a39e2a55f3790377afeedcf
BLAKE2b-256 checksum
How to use checksums
7d56f86d1c39fcb4cdeafbbb8bf7df6e8238ffd11ed1f9da907f20662a5f5f75
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.11.0 pkginfo/1.4.2 requests/2.21.0 setuptools/40.8.0 requests-toolbelt/0.8.0 tqdm/4.19.5 CPython/3.6.5

Release files / pystan-2.19.0.0-cp36-cp36m-manylinux1_x86_64.whl

Download URL pystan-2.19.0.0-cp36-cp36m-manylinux1_x86_64.whl
Size 67.2 MB
Tags CPython 3.6 CPython 3.6 pymalloc Linux glibc 2.5+ x86-64
SHA-256 checksum
How to use checksums
fd82b211ec57d34e7a31f0349a1fd8cf84a852744406b7df851dc8596da066e8
BLAKE2b-256 checksum
How to use checksums
9fec2252bcd6d93f27e726e8616b3e7ed6fb87924aede4afbed22a490980105e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.11.0 pkginfo/1.4.2 requests/2.21.0 setuptools/40.8.0 requests-toolbelt/0.8.0 tqdm/4.19.5 CPython/3.6.5

Release files / pystan-2.19.0.0-cp36-cp36m-macosx_10_6_intel.macosx_10_9_intel.macosx_10_9_x86_64.macosx_10_10_intel.macosx_10_10_x86_64.whl

Download URL pystan-2.19.0.0-cp36-cp36m-macosx_10_6_intel.macosx_10_9_intel.macosx_10_9_x86_64.macosx_10_10_intel.macosx_10_10_x86_64.whl
Size 37.4 MB
Tags CPython 3.6 CPython 3.6 pymalloc macOS 10.10+ Intel (x86-64, i386) macOS 10.10+ x86-64 macOS 10.6+ Intel (x86-64, i386) macOS 10.9+ Intel (x86-64, i386) macOS 10.9+ x86-64
SHA-256 checksum
How to use checksums
cae9dda4f5ab3c50df0a851082a2e429946f318ea0fd83301f2bae86daf43ab3
BLAKE2b-256 checksum
How to use checksums
01fd568f439331b7811a18367ea0f99289417fe3e8711848950e571d340cbad0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.11.0 pkginfo/1.4.2 requests/2.21.0 setuptools/40.8.0 requests-toolbelt/0.8.0 tqdm/4.19.5 CPython/3.6.5

Release files / pystan-2.19.0.0-cp35-cp35m-win_amd64.whl

File added late

This file was uploaded more than 14 days after the first file in this release.

While project maintainers occasionally add legitimate files to an existing release, late additions can also indicate a security compromise.

We recommend inspecting the release file before installing.

Download URL pystan-2.19.0.0-cp35-cp35m-win_amd64.whl
Size 79.7 MB
Tags CPython 3.5 CPython 3.5 pymalloc Windows x86-64
SHA-256 checksum
How to use checksums
c1f8271945c1f2eb89fcf5a1acbb17e9cee5f7fe606636f732c07fd22912a315
BLAKE2b-256 checksum
How to use checksums
c2f42ea598df0c0e8bf9b1e1344d370a88f639e1a86a648c859dd2f1d4b3fca1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.11.0 pkginfo/1.4.2 requests/2.21.0 setuptools/40.8.0 requests-toolbelt/0.8.0 tqdm/4.19.5 CPython/3.6.5

Release files / pystan-2.19.0.0-cp35-cp35m-win32.whl

File added late

This file was uploaded more than 14 days after the first file in this release.

While project maintainers occasionally add legitimate files to an existing release, late additions can also indicate a security compromise.

We recommend inspecting the release file before installing.

Download URL pystan-2.19.0.0-cp35-cp35m-win32.whl
Size 55.6 MB
Tags CPython 3.5 CPython 3.5 pymalloc Windows x86-32
SHA-256 checksum
How to use checksums
53193bdaa79c9c79f3deb49258f29fbe62305d2a8cdf8dc4d67c159844859935
BLAKE2b-256 checksum
How to use checksums
1a2cc56a8447de1e4f128c9f90be3ae45fe779ddce776345650fd45dcbc3290b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.11.0 pkginfo/1.4.2 requests/2.21.0 setuptools/40.8.0 requests-toolbelt/0.8.0 tqdm/4.19.5 CPython/3.6.5

Release files / pystan-2.19.0.0-cp35-cp35m-manylinux1_x86_64.whl

Download URL pystan-2.19.0.0-cp35-cp35m-manylinux1_x86_64.whl
Size 67.2 MB
Tags CPython 3.5 CPython 3.5 pymalloc Linux glibc 2.5+ x86-64
SHA-256 checksum
How to use checksums
4ee613ce1499db317e056daf7fcf7888317ebf09df673533184834d1d13d02db
BLAKE2b-256 checksum
How to use checksums
43a579ff313efbf90cd2055d9a4dac550ef0cdd6609b4c559d6979782bae9824
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.11.0 pkginfo/1.4.2 requests/2.21.0 setuptools/40.8.0 requests-toolbelt/0.8.0 tqdm/4.19.5 CPython/3.6.5

Release files / pystan-2.19.0.0-cp35-cp35m-macosx_10_6_intel.macosx_10_9_intel.macosx_10_9_x86_64.macosx_10_10_intel.macosx_10_10_x86_64.whl

Download URL pystan-2.19.0.0-cp35-cp35m-macosx_10_6_intel.macosx_10_9_intel.macosx_10_9_x86_64.macosx_10_10_intel.macosx_10_10_x86_64.whl
Size 37.4 MB
Tags CPython 3.5 CPython 3.5 pymalloc macOS 10.10+ Intel (x86-64, i386) macOS 10.10+ x86-64 macOS 10.6+ Intel (x86-64, i386) macOS 10.9+ Intel (x86-64, i386) macOS 10.9+ x86-64
SHA-256 checksum
How to use checksums
fcd8b5186531561dfbde7ccb9416255f4c1acb69d323070c218719a436114b08
BLAKE2b-256 checksum
How to use checksums
56f64c49cff1e0788e691dce819a621f07153ed5c758bf1c93c3e678a8ba3f6c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.11.0 pkginfo/1.4.2 requests/2.21.0 setuptools/40.8.0 requests-toolbelt/0.8.0 tqdm/4.19.5 CPython/3.6.5

Release files / pystan-2.19.0.0-cp27-cp27mu-manylinux1_x86_64.whl

Download URL pystan-2.19.0.0-cp27-cp27mu-manylinux1_x86_64.whl
Size 67.1 MB
Tags CPython 2.7 CPython 2.7 pymalloc wide-unicode Linux glibc 2.5+ x86-64
SHA-256 checksum
How to use checksums
36a0503adbfbda56be724b9f5b3444d7bc25417b51e25f4c56ce6fb4d64ff4a1
BLAKE2b-256 checksum
How to use checksums
acb467437c0ab7670f8da2c873eeba5543770410a69491e3df2d6c22308d26d5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.11.0 pkginfo/1.4.2 requests/2.21.0 setuptools/40.8.0 requests-toolbelt/0.8.0 tqdm/4.19.5 CPython/3.6.5

Release files / pystan-2.19.0.0-cp27-cp27m-manylinux1_x86_64.whl

Download URL pystan-2.19.0.0-cp27-cp27m-manylinux1_x86_64.whl
Size 67.1 MB
Tags CPython 2.7 CPython 2.7 pymalloc Linux glibc 2.5+ x86-64
SHA-256 checksum
How to use checksums
59e37a5601c53ef28031c1a0ca1b6cacafedb01d7e67f1e0d174f5ce7beb5e02
BLAKE2b-256 checksum
How to use checksums
a24ae2ef79534cd839b8fe792fb7ddd7543c53c9ff6fdfb0fe0c9555e5c739cc
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.11.0 pkginfo/1.4.2 requests/2.21.0 setuptools/40.8.0 requests-toolbelt/0.8.0 tqdm/4.19.5 CPython/3.6.5

Release files / pystan-2.19.0.0-cp27-cp27m-macosx_10_6_intel.macosx_10_9_intel.macosx_10_9_x86_64.macosx_10_10_intel.macosx_10_10_x86_64.whl

Download URL pystan-2.19.0.0-cp27-cp27m-macosx_10_6_intel.macosx_10_9_intel.macosx_10_9_x86_64.macosx_10_10_intel.macosx_10_10_x86_64.whl
Size 37.3 MB
Tags CPython 2.7 CPython 2.7 pymalloc macOS 10.10+ Intel (x86-64, i386) macOS 10.10+ x86-64 macOS 10.6+ Intel (x86-64, i386) macOS 10.9+ Intel (x86-64, i386) macOS 10.9+ x86-64
SHA-256 checksum
How to use checksums
97375e06b1054de1e555fbe197b979836cfb2cd833dbd3d760768ea17aa41e52
BLAKE2b-256 checksum
How to use checksums
ef8d223604a67214509869751002286afdfbcd49bfa4e41c3584179fb6844a5b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.11.0 pkginfo/1.4.2 requests/2.21.0 setuptools/40.8.0 requests-toolbelt/0.8.0 tqdm/4.19.5 CPython/3.6.5

Release history Release notifications | RSS feed

3.14.0

2 release files

3.10.1

2 release files

3.9.1

2 release files

3.9.0

2 release files

3.8.0

2 release files

3.7.0

2 release files

3.6.0

2 release files

3.5.0

2 release files

3.4.0

2 release files

3.3.0

2 release files

3.2.0

2 release files

3.1.1

2 release files

3.1.0

2 release files

3.0.2

2 release files

3.0.1

2 release files

3.0.0

2 release files

This release

2.19.0.0 This release

16 release files

2.7.0.0

1 release file

2.4.0.0

1 release file

2.3.0.0

1 release file

2.2.0.1

1 release file

2.2.0.0

1 release file

2.1.0.1

1 release file

2.1.0.0

1 release file

2.0.1.3

1 release file

2.0.1.1

1 release file

2.0.1.0

1 release file

2.0.0.1

1 release file

2.0.0.0

1 release file

0.2.2

1 release file

0.2.1

1 release file

0.2.0

1 release file

0.1.1

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page