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/.
Important links
HTML documentation: https://pystan.readthedocs.org
Issue tracker: https://github.com/stan-dev/pystan/issues
Source code repository: https://github.com/stan-dev/pystan
Stan: http://mc-stan.org/
Stan User’s Guide and Reference Manual (pdf) available at http://mc-stan.org
Similar projects
Detailed Installation Instructions
Detailed installation instructions can be found in the installation_beginner.md file
Quick Installation
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]}
fit = pystan.stan(model_code=schools_code, 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.11.0.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distributions (sdists)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| pystan-2.11.0.0.zip | 31.3 MB | Without provenance | Details for pystan-2.11.0.0.zip | |
| pystan-2.11.0.0.tar.gz | 16.9 MB | Without provenance | Details for pystan-2.11.0.0.tar.gz |
Built distributions (wheels)
Total release size: 848.3 MB
Release files / pystan-2.11.0.0.zip
| Download URL | pystan-2.11.0.0.zip |
|---|---|
| Size | 31.3 MB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
9ea7313c0bf51ea6c8a62979e62b20b2e1343363e1dac38e2a175dc7e8703a62
|
|
BLAKE2b-256 checksum How to use checksums |
e619f4857fb7aa42bba9da1611fb367cd06880195627d74dbd672847161abb6e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Release files / pystan-2.11.0.0.tar.gz
| Download URL | pystan-2.11.0.0.tar.gz |
|---|---|
| Size | 16.9 MB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
c4ffd1437d0341d8eb7d9d62e0b3dd80fc8a9386d105192f50a397221c0dbcdd
|
|
BLAKE2b-256 checksum How to use checksums |
30300f513035224c05328a01354bf24438565df203b5e798e8fb8754264e9cf5
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Release files / pystan-2.11.0.0-cp35-cp35m-win_amd64.whl
| Download URL | pystan-2.11.0.0-cp35-cp35m-win_amd64.whl |
|---|---|
| Size | 39.1 MB |
| Tags | CPython 3.5 CPython 3.5 pymalloc Windows x86-64 |
|
SHA-256 checksum How to use checksums |
123b4e4fefb100402dc112b20a0a01994a8939de2023eb2d0d30a0c8a9483103
|
|
BLAKE2b-256 checksum How to use checksums |
fd4bdb82851cc2c4126ed100d74c64d91f0d68e82f7910182ca37ed1db4abd7f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Release files / pystan-2.11.0.0-cp35-cp35m-win32.whl
| Download URL | pystan-2.11.0.0-cp35-cp35m-win32.whl |
|---|---|
| Size | 39.0 MB |
| Tags | CPython 3.5 CPython 3.5 pymalloc Windows x86-32 |
|
SHA-256 checksum How to use checksums |
e38810c54215b500c069aff105cc185b631efd3780cb913ebb806815a0bc7f0b
|
|
BLAKE2b-256 checksum How to use checksums |
59aabacc9d0dbcb6a01ef4c104fc3723054a3cb57e34654cee303fd4933db8bd
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Release files / pystan-2.11.0.0-cp35-cp35m-manylinux1_x86_64.whl
| Download URL | pystan-2.11.0.0-cp35-cp35m-manylinux1_x86_64.whl |
|---|---|
| Size | 71.0 MB |
| Tags | CPython 3.5 CPython 3.5 pymalloc Linux glibc 2.5+ x86-64 |
|
SHA-256 checksum How to use checksums |
4c8357754f0ce1d71f71f49db3a4a13871298aa5518174cdab01cebda90e17aa
|
|
BLAKE2b-256 checksum How to use checksums |
911f6ed2ea63ed80d00ca6eadf613fa0a161c27d275ae7351d174e791443a6a5
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Release files / pystan-2.11.0.0-cp35-cp35m-manylinux1_i686.whl
| Download URL | pystan-2.11.0.0-cp35-cp35m-manylinux1_i686.whl |
|---|---|
| Size | 70.7 MB |
| Tags | CPython 3.5 CPython 3.5 pymalloc Linux glibc 2.5+ x86-32 |
|
SHA-256 checksum How to use checksums |
7a2c0f4a21a2e6f9190afbd1da99e413fae3aae935718978f19a59517dec19d5
|
|
BLAKE2b-256 checksum How to use checksums |
3e2cba4daefa2388f6cef2460ac932647587d6fb1b8483d26051c954751fd0fa
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Release files / pystan-2.11.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.11.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 | 51.7 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 |
6f95949e48f150b11382a3964a5605e0190a4409c9379bd062abf195b1ba5195
|
|
BLAKE2b-256 checksum How to use checksums |
03eb879ea4c6fa9d8620adf99d6cd3ff4149aa195a0bf0bf317c477e529eaf1b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Release files / pystan-2.11.0.0-cp34-cp34m-manylinux1_x86_64.whl
| Download URL | pystan-2.11.0.0-cp34-cp34m-manylinux1_x86_64.whl |
|---|---|
| Size | 71.0 MB |
| Tags | CPython 3.4 CPython 3.4 pymalloc Linux glibc 2.5+ x86-64 |
|
SHA-256 checksum How to use checksums |
0a14a2b367a09fb26f27c62f2eafaeea37077b678fc492fd42cb2c34403be67e
|
|
BLAKE2b-256 checksum How to use checksums |
18c04b339b4eaa7aadef3119d6de3bc0eaafed01dd0dfbcec07a22f7285ea7bf
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Release files / pystan-2.11.0.0-cp34-cp34m-manylinux1_i686.whl
| Download URL | pystan-2.11.0.0-cp34-cp34m-manylinux1_i686.whl |
|---|---|
| Size | 70.7 MB |
| Tags | CPython 3.4 CPython 3.4 pymalloc Linux glibc 2.5+ x86-32 |
|
SHA-256 checksum How to use checksums |
e7d86d7462bff837306c90d44d66cba448d363c23c46b54fb999562dc392c1ec
|
|
BLAKE2b-256 checksum How to use checksums |
b559a0cf0fb92aebbcfd89f44614ce3ea7317a4dc91074a5653b7d6ece70f3b1
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Release files / pystan-2.11.0.0-cp34-cp34m-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.11.0.0-cp34-cp34m-macosx_10_6_intel.macosx_10_9_intel.macosx_10_9_x86_64.macosx_10_10_intel.macosx_10_10_x86_64.whl |
|---|---|
| Size | 51.7 MB |
| Tags | CPython 3.4 CPython 3.4 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 |
8ef83c6102746405da5125368c4bf8d50a384251765ffa8ebf744a189941c849
|
|
BLAKE2b-256 checksum How to use checksums |
516a168803304283fddac03233bc0891f752332fbcbc7327aac13f85e20aa111
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Release files / pystan-2.11.0.0-cp27-cp27mu-manylinux1_x86_64.whl
| Download URL | pystan-2.11.0.0-cp27-cp27mu-manylinux1_x86_64.whl |
|---|---|
| Size | 71.0 MB |
| Tags | CPython 2.7 CPython 2.7 pymalloc wide-unicode Linux glibc 2.5+ x86-64 |
|
SHA-256 checksum How to use checksums |
ce61ec5c59af5ce0f373dc0eb633e42684a3c09dd9d6efa2e85c19a10c679e84
|
|
BLAKE2b-256 checksum How to use checksums |
98033e63433081823407fe523e210ece2b04f675f57fbea24671cb7c68d7e550
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Release files / pystan-2.11.0.0-cp27-cp27mu-manylinux1_i686.whl
| Download URL | pystan-2.11.0.0-cp27-cp27mu-manylinux1_i686.whl |
|---|---|
| Size | 70.7 MB |
| Tags | CPython 2.7 CPython 2.7 pymalloc wide-unicode Linux glibc 2.5+ x86-32 |
|
SHA-256 checksum How to use checksums |
0829661d609699989316eb638001dfaf279ecd725655dc8590f8cc4e1f4f39d1
|
|
BLAKE2b-256 checksum How to use checksums |
873fa9ee7563105dedef4ae5c8ab682903870e429e6750651a2b5066ff596e1a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Release files / pystan-2.11.0.0-cp27-cp27m-manylinux1_x86_64.whl
| Download URL | pystan-2.11.0.0-cp27-cp27m-manylinux1_x86_64.whl |
|---|---|
| Size | 71.0 MB |
| Tags | CPython 2.7 CPython 2.7 pymalloc Linux glibc 2.5+ x86-64 |
|
SHA-256 checksum How to use checksums |
d140f44f56a51547a3baa471258ce2f40a9de7741b962e72d25c9256f2b4694d
|
|
BLAKE2b-256 checksum How to use checksums |
b71f9185f2c570fbea3a701dbba5d9b38ca3ed7dd3737ab32cc3f91e686debf2
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Release files / pystan-2.11.0.0-cp27-cp27m-manylinux1_i686.whl
| Download URL | pystan-2.11.0.0-cp27-cp27m-manylinux1_i686.whl |
|---|---|
| Size | 70.7 MB |
| Tags | CPython 2.7 CPython 2.7 pymalloc Linux glibc 2.5+ x86-32 |
|
SHA-256 checksum How to use checksums |
a42a44fed306b6eeb37da7c1609d6cc905eab8b65331f8ab5a80dc6552e9631a
|
|
BLAKE2b-256 checksum How to use checksums |
15314e6e9daa5e06b0d1c2848e7f14c46703882d47343fc32aa952124fecd52c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Release files / pystan-2.11.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.11.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 | 51.7 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 |
743694ea0269ecd6f96481085e38f6ec5a3a248ed2ec24221e093f79ae62de8d
|
|
BLAKE2b-256 checksum How to use checksums |
fa416b4580ef3acff471d2548fd0d03fc206f8c43d38b30e8236a852f0f2c691
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Security for pystan 2.11.0.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.