{"id":13935182,"url":"https://github.com/markdregan/Bayesian-Modelling-in-Python","last_synced_at":"2025-07-19T20:31:08.352Z","repository":{"id":44361320,"uuid":"42249497","full_name":"markdregan/Bayesian-Modelling-in-Python","owner":"markdregan","description":"A python tutorial on bayesian modeling techniques (PyMC3)","archived":false,"fork":false,"pushed_at":"2017-04-29T20:30:18.000Z","size":16437,"stargazers_count":2485,"open_issues_count":0,"forks_count":414,"subscribers_count":161,"default_branch":"master","last_synced_at":"2024-11-21T03:51:42.856Z","etag":null,"topics":["bayesian-statistics","pymc","python","tutorial"],"latest_commit_sha":null,"homepage":"","language":"Jupyter Notebook","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/markdregan.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-09-10T14:27:37.000Z","updated_at":"2024-11-11T22:55:53.000Z","dependencies_parsed_at":"2022-09-23T00:31:14.446Z","dependency_job_id":null,"html_url":"https://github.com/markdregan/Bayesian-Modelling-in-Python","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/markdregan%2FBayesian-Modelling-in-Python","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/markdregan%2FBayesian-Modelling-in-Python/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/markdregan%2FBayesian-Modelling-in-Python/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/markdregan%2FBayesian-Modelling-in-Python/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/markdregan","download_url":"https://codeload.github.com/markdregan/Bayesian-Modelling-in-Python/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":226666547,"owners_count":17665043,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["bayesian-statistics","pymc","python","tutorial"],"created_at":"2024-08-07T23:01:26.953Z","updated_at":"2025-07-19T20:31:08.338Z","avatar_url":"https://github.com/markdregan.png","language":"Jupyter Notebook","readme":"# [Bayesian Modelling in Python](https://github.com/markdregan/Bayesian-Modelling-in-Python)\n\n![Bayesian Modelling in Python](/graphics/cover.png)\n\nWelcome to \"Bayesian Modelling in Python\" - a tutorial for those interested in learning how to apply bayesian modelling techniques in python ([PYMC3](https://github.com/pymc-devs/pymc3)). This tutorial doesn't aim to be a bayesian statistics tutorial - but rather a programming cookbook for those who understand the fundamental of bayesian statistics and want to learn how to build bayesian models using python. The tutorial sections and topics can be seen below.\n\n### Contents\n- [**Introduction**](http://nbviewer.ipython.org/github/markdregan/Bayesian-Modelling-in-Python/blob/master/Section%200.%20Introduction.ipynb)\n    - Motivation for learning bayesian statistics\n    - Loading and parsing Hangout chat data\n    \n- [**Section 1: Estimating model parameters**](http://nbviewer.ipython.org/github/markdregan/Bayesian-Modelling-in-Python/blob/master/Section%201.%20Estimating%20model%20parameters.ipynb)\n    - Frequentist technique for estimating parameters of a poisson model (Optimization routine)\n    - Bayesian technique for estimating parameters of a poisson model (MCMC)\n\n- [**Section 2: Model checking \u0026 comparison**](http://nbviewer.ipython.org/github/markdregan/Bayesian-Modelling-in-Python/blob/master/Section%202.%20Model%20checking.ipynb)\n    - Posterior predictive check\n    - Bayes factor\n    \n- [**Section 3: Hierarchal modeling**](http://nbviewer.ipython.org/github/markdregan/Bayesian-Modelling-in-Python/blob/master/Section%203.%20Hierarchical%20modelling.ipynb)\n    - Model pooling (separate models)\n    - Partial pooling (hierarchal models)\n    - Shrinkage effect of partial pooling\n    \n- [**Section 4: Bayesian regression**](http://nbviewer.ipython.org/github/markdregan/Bayesian-Modelling-in-Python/blob/master/Section%204.%20Bayesian%20regression.ipynb)\n    - Bayesian fixed effects poisson regression\n    - Bayesian mixed effects poisson regression\n    \n- **Section 5: Bayesian survival analysis**\n    - Survival model theory\n    - Cox proportional hazard model\n    - Aalen's additive hazard model\n    \n- **Section 6: Bayesian A/B tests**\n    - Bayesian test of proportions\n    - Bayesian t-test (BEST)\n\n### Contributions\n- All contributions are more than welcome. They can be minor (spelling, better explanations, improved code/charts) or major (contribute a full section).\n- If you would like to contribute, please create a pull request in GitHub. Happy to discuss ideas before you begin working on the addition.\n- I would especially welcome any contributions that address: survival analysis, mixture models, time series models or A/B experiments.\n- If you're not familiar with GitHub - please email me at mark@thinkvein.com.\n\n### Motivation for learning bayesian statistics\nStatistics is a topic that never resonated with me throughout university. The frequentist techniques that we were taught (p-values etc) felt contrived and ultimately I turned my back on statistics as a topic that I wasn't interested in.\n\nThat was until I stumbled upon Bayesian statistics - a branch to statistics quite different from the traditional frequentist statistics that most universities teach. I was inspired by a number of different publications, blogs \u0026 videos that I would highly recommend any newbies to bayesian stats to begin with. They include:\n- [Doing Bayesian Data Analysis](http://www.amazon.com/Doing-Bayesian-Analysis-Second-Edition/dp/0124058884/ref=dp_ob_title_bk) by John Kruschke\n- [Python port](https://github.com/aloctavodia/Doing_bayesian_data_analysis) of John Kruschke's examples by Osvaldo Martin\n- [Bayesian Methods for Hackers](https://github.com/CamDavidsonPilon/Probabilistic-Programming-and-Bayesian-Methods-for-Hackers) provided me with a great source of inspiration to learn bayesian stats. In recognition of this influence, I've adopted the same visual styles as BMH.\n- [While My MCMC Gently Samples](http://twiecki.github.io/) blog by Thomas Wiecki\n- [Healthy Algorithms](http://healthyalgorithms.com/tag/pymc/) blog by Abraham Flaxman\n- [Scipy Tutorial 2014](https://github.com/fonnesbeck/scipy2014_tutorial) by Chris Fonnesbeck\n\nI created this tutorial in the hope that others find it useful and it helps them learn Bayesian techniques just like the above resources helped me. I hope you find it useful and I'd welcome any corrections/comments/contributions from the community.\n\n### Note\nThis tutorial is actively being worked on. I'm keen to get feedback and welcome ideas/contributions.\n","funding_links":[],"categories":["Jupyter Notebook","A01_机器学习教程","More Data Science materials"],"sub_categories":["Aside: Bayesian Statistics and Machine Learning"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmarkdregan%2FBayesian-Modelling-in-Python","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmarkdregan%2FBayesian-Modelling-in-Python","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmarkdregan%2FBayesian-Modelling-in-Python/lists"}