pymc-examples icon indicating copy to clipboard operation
pymc-examples copied to clipboard

Examples of PyMC models, including a library of Jupyter notebooks.

.. image:: https://cdn.rawgit.com/pymc-devs/pymc/main/docs/logos/svg/PyMC_banner.svg :height: 100px :alt: PyMC logo :align: center

PyMC Examples

Supporting examples and tutorials for PyMC, the Python package for Bayesian statistical modeling and Probabilistic Machine Learning!

Check out the getting started guide <https://docs.pymc.io/en/latest/learning.html#learning>, or interact with live examples using Binder! Each notebook in PyMC examples gallery <https://pymc-examples.readthedocs.io> has a binder badge. For questions on PyMC, head on over to our PyMC Discourse <https://discourse.pymc.io/>__ forum.

Contributing

If you are interested in contributing to the example notebooks hosted here, please read the contributing guide <https://github.com/pymc-devs/pymc-examples/blob/main/CONTRIBUTING.md>__ Also read our Code of Conduct <https://github.com/pymc-devs/pymc-examples/blob/main/CODE_OF_CONDUCT.md>__ guidelines for a better contributing experience.

Contact

We are using discourse.pymc.io <https://discourse.pymc.io/>__ as our main communication channel. You can also follow us on Twitter @pymc_devs <https://twitter.com/pymc_devs>__ for updates and other announcements.

To ask a question regarding modeling or usage of PyMC we encourage posting to our Discourse forum under the “Questions” Category <https://discourse.pymc.io/c/questions>. You can also suggest feature in the “Development” Category <https://discourse.pymc.io/c/development>.

To report an issue, please use the following:

  • PyMC Examples - Issue Tracker <https://github.com/pymc-devs/pymc-examples/issues>__. For issues about the example notebooks, errors in the example codes, outdated information, improvement suggestions...
  • PyMC - Issue Tracker <https://github.com/pymc-devs/pymc/issues>__. For issues, bugs or feature requests related to the PyMC library itself.

Finally, if you need to get in touch for non-technical information about the project, send us an e-mail <[email protected]>__.

Getting started

If you already know about Bayesian statistics:

  • API quickstart guide <http://docs.pymc.io/notebooks/api_quickstart>__
  • The PyMC tutorial <http://docs.pymc.io/notebooks/getting_started>__
  • PyMC examples <https://docs.pymc.io/nb_examples/index.html>__ and the API reference <http://docs.pymc.io/api>__

Learn Bayesian statistics with a book together with PyMC:

  • Probabilistic Programming and Bayesian Methods for Hackers <https://github.com/CamDavidsonPilon/Probabilistic-Programming-and-Bayesian-Methods-for-Hackers>__ by Cameron Davidson-Pilon: Fantastic book with many applied code examples.
  • Doing Bayesian Data Analysis <https://github.com/aloctavodia/Doing_bayesian_data_analysis>__ by John Kruschke, as well as the second edition <https://github.com/JWarmenhoven/DBDA-python>__: Principled introduction to Bayesian data analysis.
  • Statistical Rethinking: A Bayesian Course with Examples in R and Stan <https://github.com/pymc-devs/resources/tree/master/Rethinking>__ by Richard McElreath: Comprehensive text on modeling choices and interpretations.
  • Bayesian Cognitive Modeling <https://github.com/pymc-devs/resources/tree/master/BCM>__ by Michael Lee and EJ Wagenmakers: Focused on using Bayesian statistics in cognitive modeling.
  • Bayesian Analysis with Python <https://www.packtpub.com/big-data-and-business-intelligence/bayesian-analysis-python-second-edition>__ (second edition) by Osvaldo Martin: Great introductory book. (code <https://github.com/aloctavodia/BAP>__ and errata).

PyMC talks

There are also several talks on PyMC which are gathered in this YouTube playlist <https://www.youtube.com/playlist?list=PL1Ma_1DBbE82OVW8Fz_6Ts1oOeyOAiovy>__ and as part of PyMCon 2020 <https://discourse.pymc.io/c/pymcon/2020talks/15>__

Installation

To install PyMC on your system, see its installation section here <https://docs.pymc.io/en/stable/>__

Citing PyMC

  • To cite the PyMC software, use:

    Salvatier J., Wiecki T.V., Fonnesbeck C. (2016) Probabilistic programming in Python using PyMC3. PeerJ Computer Science 2:e55 DOI: 10.7717/peerj-cs.55 <https://doi.org/10.7717/peerj-cs.55>__.

  • To cite specific guides from this collection, use |zenodo|. You'll find page specific citation instructions at the bottom of each page.

Papers citing PyMC

See Google Scholar <https://scholar.google.de/scholar?oi=bibs&hl=en&authuser=1&cites=6936955228135731011>__ for a continuously updated list.

Support

PyMC is a non-profit project under NumFOCUS umbrella. If you want to support PyMC financially, you can donate here <https://numfocus.salsalabs.org/donate-to-pymc3/index.html>__.

PyMC for enterprise

PyMC is now available as part of the Tidelift Subscription!

Tidelift is working with PyMC and the maintainers of thousands of other open source projects to deliver commercial support and maintenance for the open source dependencies you use to build your applications. Save time, reduce risk, and improve code health, while contributing financially to PyMC -- making it even more robust, reliable and, let's face it, amazing!

|tidelift_learn| |tidelift_demo|

Sponsors

|NumFOCUS|

|PyMCLabs|

.. |zenodo| image:: https://zenodo.org/badge/321449673.svg :target: https://zenodo.org/badge/latestdoi/321449673 .. |NumFOCUS| image:: https://www.numfocus.org/wp-content/uploads/2017/03/1457562110.png :target: http://www.numfocus.org/ .. |PyMCLabs| image:: https://raw.githubusercontent.com/pymc-devs/pymc/main/docs/logos/sponsors/pymc-labs.png :target: https://pymc-labs.io .. |tidelift_learn| image:: https://img.shields.io/badge/-learn%20more-2dd160.svg?color=orange&labelColor=58595b&style=flat&logo=data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABEAAAAOCAYAAADJ7fe0AAAAAXNSR0IArs4c6QAAAAlwSFlzAAAWJQAAFiUBSVIk8AAAAVlpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IlhNUCBDb3JlIDUuNC4wIj4KICAgPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4KICAgICAgPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIKICAgICAgICAgICAgeG1sbnM6dGlmZj0iaHR0cDovL25zLmFkb2JlLmNvbS90aWZmLzEuMC8iPgogICAgICAgICA8dGlmZjpPcmllbnRhdGlvbj4xPC90aWZmOk9yaWVudGF0aW9uPgogICAgICA8L3JkZjpEZXNjcmlwdGlvbj4KICAgPC9yZGY6UkRGPgo8L3g6eG1wbWV0YT4KTMInWQAAAVhJREFUKBV1kj0vBFEUhmd2sdZHh2IlGhKFQuOviEYiNlFodCqtUqPxA%2FwCjUTnDygkGoVERFQaZFlE9nreO%2BdM5u5wkifvuee892Pu3CyEcA0DeIc%2B9IwftJsR6Cko3uCjguZdjuBZhhwmYDjGrOC96WED41UtsgEdGEAPlmAfpuAbFF%2BFZLfoMfRBGzThDtLgePPwBIpdddGzOArhPHUXowbNptE2www6a%2Fm96Y3pHN7oQ1s%2B13pxt1ENaKzBFWyWzaJ%2BRO0C9Jny6VPSoKjLVbMDC5bn5OPuJF%2BBSe95PVEMuugY5AegS9fCh7BedP45hRnj8TC34QQUe9bTZyh2KgvFk2vc8GIlXyTfsvqr6bPpNgv52ynnlomZJNpB70Xhl%2Bf6Sa02p1bApEfnETwxVa%2Faj%2BW%2FFtHltmxS%2FO3krvpTtTnVgu%2F6gvHRFvG78Ef3kOe5PimJXycY74blT5R%2BAAAAAElFTkSuQmCC :target: https://tidelift.com/subscription/pkg/pypi-pymc3?utm_source=pypi-pymc3&utm_medium=referral&utm_campaign=enterprise .. |tidelift_demo| image:: https://img.shields.io/badge/-request%20a%20demo-2dd160.svg?color=orange&labelColor=58595b&style=flat&logo=data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABEAAAAOCAYAAADJ7fe0AAAAAXNSR0IArs4c6QAAAAlwSFlzAAAWJQAAFiUBSVIk8AAAAVlpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IlhNUCBDb3JlIDUuNC4wIj4KICAgPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4KICAgICAgPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIKICAgICAgICAgICAgeG1sbnM6dGlmZj0iaHR0cDovL25zLmFkb2JlLmNvbS90aWZmLzEuMC8iPgogICAgICAgICA8dGlmZjpPcmllbnRhdGlvbj4xPC90aWZmOk9yaWVudGF0aW9uPgogICAgICA8L3JkZjpEZXNjcmlwdGlvbj4KICAgPC9yZGY6UkRGPgo8L3g6eG1wbWV0YT4KTMInWQAAAVhJREFUKBV1kj0vBFEUhmd2sdZHh2IlGhKFQuOviEYiNlFodCqtUqPxA%2FwCjUTnDygkGoVERFQaZFlE9nreO%2BdM5u5wkifvuee892Pu3CyEcA0DeIc%2B9IwftJsR6Cko3uCjguZdjuBZhhwmYDjGrOC96WED41UtsgEdGEAPlmAfpuAbFF%2BFZLfoMfRBGzThDtLgePPwBIpdddGzOArhPHUXowbNptE2www6a%2Fm96Y3pHN7oQ1s%2B13pxt1ENaKzBFWyWzaJ%2BRO0C9Jny6VPSoKjLVbMDC5bn5OPuJF%2BBSe95PVEMuugY5AegS9fCh7BedP45hRnj8TC34QQUe9bTZyh2KgvFk2vc8GIlXyTfsvqr6bPpNgv52ynnlomZJNpB70Xhl%2Bf6Sa02p1bApEfnETwxVa%2Faj%2BW%2FFtHltmxS%2FO3krvpTtTnVgu%2F6gvHRFvG78Ef3kOe5PimJXycY74blT5R%2BAAAAAElFTkSuQmCC :target: https://tidelift.com/subscription/request-a-demo?utm_source=pypi-pymc3&utm_medium=referral&utm_campaign=enterprise