├── .gitignore ├── All that likelihood.key ├── All that likelihood.pdf ├── Demo ├── like_gaussian.png ├── likelihood1.mov ├── likelihood2.mov ├── pmf1.mov └── pmf2.mov ├── LICENSE.md ├── Notebooks ├── Likelihood_visual_demo.ipynb ├── Neals_funnel.ipynb ├── Normal_mixture_logp.ipynb ├── Regression with a twist.ipynb └── Timeserie_model.ipynb └── README.md /.gitignore: -------------------------------------------------------------------------------- 1 | .ipynb_checkpoints 2 | .DS_Store 3 | .gitignore~ 4 | .Rhistory 5 | *.swp 6 | __pycache__/ 7 | trash/ 8 | .R_history 9 | \.idea/ 10 | 11 | Kaggle/input/ 12 | 13 | Kaggle/code/baseline\.csv 14 | 15 | Kaggle/code/weights_base\.best\.hdf5 16 | -------------------------------------------------------------------------------- /All that likelihood.key: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/junpenglao/All-that-likelihood-with-PyMC3/f0e0b21c22a85981ab8709380aa3b8994287eec6/All that likelihood.key -------------------------------------------------------------------------------- /All that likelihood.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/junpenglao/All-that-likelihood-with-PyMC3/f0e0b21c22a85981ab8709380aa3b8994287eec6/All that likelihood.pdf -------------------------------------------------------------------------------- /Demo/like_gaussian.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/junpenglao/All-that-likelihood-with-PyMC3/f0e0b21c22a85981ab8709380aa3b8994287eec6/Demo/like_gaussian.png -------------------------------------------------------------------------------- /Demo/likelihood1.mov: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/junpenglao/All-that-likelihood-with-PyMC3/f0e0b21c22a85981ab8709380aa3b8994287eec6/Demo/likelihood1.mov -------------------------------------------------------------------------------- /Demo/likelihood2.mov: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/junpenglao/All-that-likelihood-with-PyMC3/f0e0b21c22a85981ab8709380aa3b8994287eec6/Demo/likelihood2.mov -------------------------------------------------------------------------------- /Demo/pmf1.mov: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/junpenglao/All-that-likelihood-with-PyMC3/f0e0b21c22a85981ab8709380aa3b8994287eec6/Demo/pmf1.mov -------------------------------------------------------------------------------- /Demo/pmf2.mov: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/junpenglao/All-that-likelihood-with-PyMC3/f0e0b21c22a85981ab8709380aa3b8994287eec6/Demo/pmf2.mov -------------------------------------------------------------------------------- /LICENSE.md: -------------------------------------------------------------------------------- 1 | 2 | The MIT License (MIT) 3 | 4 | Copyright (c) 2018 5 | 6 | Permission is hereby granted, free of charge, to any person obtaining a copy 7 | of this software and associated documentation files (the "Software"), to deal 8 | in the Software without restriction, including without limitation the rights 9 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | copies of the Software, and to permit persons to whom the Software is 11 | furnished to do so, subject to the following conditions: 12 | 13 | The above copyright notice and this permission notice shall be included in all 14 | copies or substantial portions of the Software. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | SOFTWARE. 23 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | [Video link](https://www.youtube.com/watch?v=0_oonRc7Sn8) of my talk @pydataberlin, you can switch to pydata berlin branch to see the snapshot of the repository. 2 | 3 | # All that likelihood with PyMC3 4 | The likelihood function is a central concept in Bayesian computation. In this tutorial, we will learn about what is the likelihood function and how do we use it for inference. Using PyMC3, I will demonstrate how to get the likelihood from a model, how does it connect to inference using MCMC sampling or approximation, and some practical usage of the model likelihood to perform model comparisons. 5 | 6 | In the past years, we see a growing interested in probabilistic programming and Bayesian statistics. While modern probabilistic library such as PyMC3 and Stan provide flexibility to the user to write down complex model easily, it is not always intuitive how inference is done. More specifically, what is the sampler "seeing"? Learning about likelihood is central to the understanding of how inference is performed. In this tutorial, I would like to give some introduction to likelihood function and why they are important, what does mean to put constraints in the likelihood, how to get likelihood from PyMC3 and what is the correspondent input. 7 | --------------------------------------------------------------------------------