|
| 1 | +PyMC3 |
| 2 | +===== |
| 3 | + |
| 4 | +|Gitter| |
| 5 | + |
| 6 | +|Build Status| |
| 7 | + |
| 8 | +PyMC3 is a python module for Bayesian statistical modeling and model |
| 9 | +fitting which focuses on advanced Markov chain Monte Carlo fitting |
| 10 | +algorithms. Its flexibility and extensibility make it applicable to a |
| 11 | +large suite of problems. |
| 12 | + |
| 13 | +Check out the `getting started |
| 14 | +guide <http://pymc-devs.github.io/pymc3/notebooks/getting_started.html>`__! |
| 15 | + |
| 16 | +PyMC3 is beta software. Users should consider using `PyMC 2 |
| 17 | +repository <https://github.com/pymc-devs/pymc>`__. |
| 18 | + |
| 19 | +Features |
| 20 | +-------- |
| 21 | + |
| 22 | +- Intuitive model specification syntax, for example, ``x ~ N(0,1)`` |
| 23 | + translates to ``x = Normal(0,1)`` |
| 24 | +- **Powerful sampling algorithms**, such as the `No U-Turn |
| 25 | + Sampler <http://arxiv.org/abs/1111.4246>`__, allow complex models |
| 26 | + with thousands of parameters with little specialized knowledge of |
| 27 | + fitting algorithms. |
| 28 | +- **Variational inference**: `ADVI <http://arxiv.org/abs/1506.03431>`__ |
| 29 | + for fast approximate posterior estimation as well as mini-batch ADVI |
| 30 | + for large data sets. |
| 31 | +- Easy optimization for finding the *maximum a posteriori* (MAP) point |
| 32 | +- `Theano <http://deeplearning.net/software/theano/>`__ features |
| 33 | +- Numpy broadcasting and advanced indexing |
| 34 | +- Linear algebra operators |
| 35 | +- Computation optimization and dynamic C compilation |
| 36 | +- Simple extensibility |
| 37 | +- Transparent support for missing value imputation |
| 38 | + |
| 39 | +Getting started |
| 40 | +--------------- |
| 41 | + |
| 42 | +- The `PyMC3 |
| 43 | + tutorial <http://pymc-devs.github.io/pymc3/notebooks/getting_started.html>`__ or |
| 44 | + `journal publication <https://peerj.com/articles/cs-55/>`__ |
| 45 | +- `PyMC3 examples <http://pymc-devs.github.io/pymc3/examples.html>`__ |
| 46 | + and the `API reference <http://pymc-devs.github.io/pymc3/api.html>`__ |
| 47 | +- `Bayesian Modelling in Python -- tutorials on Bayesian statistics and |
| 48 | + PyMC3 as Jupyter Notebooks by Mark |
| 49 | + Dregan <https://github.com/markdregan/Bayesian-Modelling-in-Python>`__ |
| 50 | +- `Talk at PyData London 2016 on |
| 51 | + PyMC3 <https://www.youtube.com/watch?v=LlzVlqVzeD8>`__ |
| 52 | +- `PyMC3 port of the models presented in the book "Doing Bayesian Data |
| 53 | + Analysis" by John |
| 54 | + Kruschke <https://github.com/aloctavodia/Doing_bayesian_data_analysis>`__ |
| 55 | +- Coal Mining Disasters model in `PyMC |
| 56 | + 2 <https://github.com/pymc-devs/pymc/blob/master/pymc/examples/disaster_model.py>`__ |
| 57 | + and `PyMC |
| 58 | + 3 <https://github.com/pymc-devs/pymc3/blob/master/pymc3/examples/disaster_model.py>`__ |
| 59 | + |
| 60 | +Installation |
| 61 | +------------ |
| 62 | + |
| 63 | +The latest version of PyMC3 can be installed from the master branch |
| 64 | +using pip: |
| 65 | + |
| 66 | +:: |
| 67 | + |
| 68 | + pip install git+https://github.com/pymc-devs/pymc3 |
| 69 | + |
| 70 | +To ensure the development branch of Theano is installed alongside PyMC3 |
| 71 | +(recommended), you can install PyMC3 using the ``requirements.txt`` |
| 72 | +file. This requires cloning the repository to your computer: |
| 73 | + |
| 74 | +:: |
| 75 | + |
| 76 | + git clone https://github.com/pymc-devs/pymc3 |
| 77 | + cd pymc3 |
| 78 | + pip install -r requirements.txt |
| 79 | + |
| 80 | +However, if a recent version of Theano has already been installed on |
| 81 | +your system, you can install PyMC3 directly from GitHub. |
| 82 | + |
| 83 | +Another option is to clone the repository and install PyMC3 using |
| 84 | +``python setup.py install`` or ``python setup.py develop``. |
| 85 | + |
| 86 | +**Note:** Running ``pip install pymc`` will install PyMC 2.3, not PyMC3, |
| 87 | +from PyPI. |
| 88 | + |
| 89 | +Dependencies |
| 90 | +------------ |
| 91 | + |
| 92 | +PyMC3 is tested on Python 2.7 and 3.3 and depends on Theano, NumPy, |
| 93 | +SciPy, Pandas, and Matplotlib (see ``requirements.txt`` for version |
| 94 | +information). |
| 95 | + |
| 96 | +Optional |
| 97 | +~~~~~~~~ |
| 98 | + |
| 99 | +In addtion to the above dependencies, the GLM submodule relies on |
| 100 | +``Patsy``\ [http://patsy.readthedocs.io/en/latest/]. |
| 101 | + |
| 102 | +```scikits.sparse`` <https://github.com/njsmith/scikits-sparse>`__ |
| 103 | +enables sparse scaling matrices which are useful for large problems. |
| 104 | +Installation on Ubuntu is easy: |
| 105 | + |
| 106 | +:: |
| 107 | + |
| 108 | + sudo apt-get install libsuitesparse-dev |
| 109 | + pip install git+https://github.com/njsmith/scikits-sparse.git |
| 110 | + |
| 111 | +On Mac OS X you can install libsuitesparse 4.2.1 via homebrew (see |
| 112 | +http://brew.sh/ to install homebrew), manually add a link so the include |
| 113 | +files are where scikits-sparse expects them, and then install |
| 114 | +scikits-sparse: |
| 115 | + |
| 116 | +:: |
| 117 | + |
| 118 | + brew install suite-sparse |
| 119 | + ln -s /usr/local/Cellar/suite-sparse/4.2.1/include/ /usr/local/include/suitesparse |
| 120 | + pip install git+https://github.com/njsmith/scikits-sparse.git |
| 121 | + |
| 122 | +Citing PyMC3 |
| 123 | +------------ |
| 124 | + |
| 125 | +Salvatier J, Wiecki TV, Fonnesbeck C. (2016) Probabilistic programming |
| 126 | +in Python using PyMC3. PeerJ Computer Science 2:e55 |
| 127 | +https://doi.org/10.7717/peerj-cs.55 |
| 128 | + |
| 129 | +License |
| 130 | +------- |
| 131 | + |
| 132 | +`Apache License, Version |
| 133 | +2.0 <https://github.com/pymc-devs/pymc3/blob/master/LICENSE>`__ |
| 134 | + |
| 135 | +Contributors |
| 136 | +------------ |
| 137 | + |
| 138 | +See the `GitHub contributor |
| 139 | +page <https://github.com/pymc-devs/pymc3/graphs/contributors>`__ |
| 140 | + |
| 141 | +.. |Gitter| image:: https://badges.gitter.im/Join%20Chat.svg |
| 142 | + :target: https://gitter.im/pymc-devs/pymc?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge |
| 143 | +.. |Build Status| image:: https://travis-ci.org/pymc-devs/pymc3.png?branch=master |
| 144 | + :target: https://travis-ci.org/pymc-devs/pymc3 |
0 commit comments