{"id":17167959,"url":"https://github.com/ericmjl/bayesian-stats-modelling-tutorial","last_synced_at":"2025-04-04T02:09:21.619Z","repository":{"id":43308710,"uuid":"119832858","full_name":"ericmjl/bayesian-stats-modelling-tutorial","owner":"ericmjl","description":"How to do Bayesian statistical modelling using numpy and PyMC3","archived":false,"fork":false,"pushed_at":"2022-07-11T18:43:03.000Z","size":101322,"stargazers_count":663,"open_issues_count":16,"forks_count":279,"subscribers_count":26,"default_branch":"master","last_synced_at":"2025-03-28T01:11:59.761Z","etag":null,"topics":["bayesian","bayesian-data-analysis","bayesian-data-science","bayesian-inference","bayesian-statistics","pymc"],"latest_commit_sha":null,"homepage":null,"language":"Jupyter Notebook","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ericmjl.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-02-01T12:27:37.000Z","updated_at":"2025-03-21T04:31:16.000Z","dependencies_parsed_at":"2022-09-24T14:00:44.166Z","dependency_job_id":null,"html_url":"https://github.com/ericmjl/bayesian-stats-modelling-tutorial","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ericmjl%2Fbayesian-stats-modelling-tutorial","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ericmjl%2Fbayesian-stats-modelling-tutorial/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ericmjl%2Fbayesian-stats-modelling-tutorial/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ericmjl%2Fbayesian-stats-modelling-tutorial/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ericmjl","download_url":"https://codeload.github.com/ericmjl/bayesian-stats-modelling-tutorial/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247107829,"owners_count":20884797,"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","bayesian-data-analysis","bayesian-data-science","bayesian-inference","bayesian-statistics","pymc"],"created_at":"2024-10-14T23:10:36.228Z","updated_at":"2025-04-04T02:09:21.598Z","avatar_url":"https://github.com/ericmjl.png","language":"Jupyter Notebook","readme":"If you're taking this tutorial at SciPy 2022, please pull the repository 9am CT the day of the tutorial to make sure that you have the most recent version!\n\n# bayesian-stats-modelling-tutorial\n\n[![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/ericmjl/bayesian-stats-modelling-tutorial/master)\n\nHow to do Bayesian statistical modelling using numpy and PyMC3.\n\n# for conference tutorial attendees\n\nIf you're looking for the material for a specific conference tutorial, navigate to the notebooks directory and look for a subdirectory for the conference you're interested. For example, `notebooks/ODSC-East-2020-04-14` contains the material for [Hugo's ODSC East tutorial on April 14, 2020](https://odsc.com/speakers/bayesian-data-science-probabilistic-programming/).\n\n# getting started\n\nTo get started, first identify whether you:\n\n- Would like to run the tutorial material on servers hosted elsewhere, to avoid installation,\n- Prefer to use the `conda` package manager (which ships with the Anaconda distribution of Python),\n- Prefer to use `pipenv`, which is a package authored by Kenneth Reitz for package management with `pip` and `virtualenv`, or\n- Only want to view the website version of the notebooks.\n\n\n## To run the tutorial material on servers elsewhere\n\n[![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/ericmjl/bayesian-stats-modelling-tutorial/master)\n\nTo do this, click on the [Binder](https://mybinder.readthedocs.io/en/latest/) badge above. This will spin up the necessary computational environment for you so you can write and execute Python code from the comfort of your browser. It is a free service. Due to this, the resources are not guaranteed, though they usually work well. If you want as close to a guarantee as possible, follow the instructions below to set up your computational environment locally (that is, on your own computer).\n\n## 1. Clone the repository locally\n\nIn your terminal, use `git` to clone the repository locally.\n\n```bash\ngit clone https://github.com/ericmjl/bayesian-stats-modelling-tutorial\n```\n\nAlternatively, you can download the zip file of the repository at the top of the main page of the repository.\nIf you prefer not to use git or don't have experience with it, this a good option.\n\n## 2. Download Anaconda (if you haven't already)\n\nIf you do not already have the [Anaconda distribution](https://www.anaconda.com/download/) of Python 3,\ngo get it\n(note: you can also set up your project environment w/out Anaconda using `pip` to install the required packages;\nhowever Anaconda is great for Data Science and we encourage you to use it).\n\n## 3. Set up your environment\n\n### 3a. `conda` users\n\nIf this is the first time you're setting up your compute environment,\nuse the `conda` package manager\nto **install all the necessary packages**\nfrom the provided `environment.yml` file.\n\n```bash\nconda env create -f binder/environment.yml\n```\n\nTo **activate the environment**, use the `conda activate` command.\n\n```bash\nconda activate bayesian-modelling-tutorial\n```\n\n**If you get an error activating the environment**, use the older `source activate` command.\n\n```bash\nsource activate bayesian-modelling-tutorial\n```\n\nTo **update the environment** based on the `environment.yml` specification file, use the `conda update` command.\n\n```bash\nconda env update -f binder/environment.yml\n```\n\n### 3b. `pip` users\n\nPlease install all of the packages listed in the `environment.yml` file manually.\nAn example command would be:\n\n```bash\npip install networkx scipy ...\n```\n\n### 3c. don't want to mess with dev-ops\n\nIf you don't want to mess around with dev-ops, click the following badge to get a Binder session on which you can compute and write code.\n\n[![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/ericmjl/bayesian-stats-modelling-tutorial/master)\n\n\n### 4a. Open your Jupyter notebook\n\n1. You will have to install a new IPython kernelspec if you created a new conda environment with `binder/environment.yml`.\n\n    python -m ipykernel install --user --name bayesian-modelling-tutorial --display-name \"Python (bayesian-modelling-tutorial)\"\n\nYou can change the `--display-name` to anything you want, though if you leave it out, the kernel's display name will default to the value passed to the `--name` flag.\n\n2. In the terminal, execute `jupyter notebook`.\n\nNavigate to the notebooks directory\nand open the notebook `01-Student-Probability_a_simulated_introduction.ipynb`.\n\n### 4b. Open your Jupyter notebook in Jupyter Lab!\n\n\nIn the terminal, execute `jupyter lab`.\n\nNavigate to the notebooks directory\nand open the notebook `01-Student-Probability_a_simulated_introduction.ipynb`.\n\nNow, if you're using Jupyter lab, for Notebook 2, you'll need to get ipywidgets working.\nThe documentation is [here](https://ipywidgets.readthedocs.io/en/latest/user_install.html#installing-the-jupyterlab-extension).\n\nIn short, you'll need node installed \u0026 you'll need to run the following in your terminal:\n\n`jupyter labextension install @jupyter-widgets/jupyterlab-manager`\n\n### 4c. Open your Jupyter notebook using Binder.\n\nLaunch Binder using the button at the top of this README.md. Voila!\n\n### 4d. Want to view static HTML notebooks\n\nIf you're interested in only viewing the static HTML versions of the notebooks,\nthe links are provided below:\n\nPart 1: Bayesian Data Science by Simulation\n\n- [Introduction to Probability](https://ericmjl.github.io/bayesian-stats-modelling-tutorial/notebooks/01-Instructor-Probability_a_simulated_introduction.html)\n- [Parameter Estimation and Hypothesis Testing](https://ericmjl.github.io/bayesian-stats-modelling-tutorial/notebooks/02-Instructor-Parameter_estimation_hypothesis_testing.html)\n\nPart 2: Bayesian Data Science by Probabilistic Programming\n\n- [Two Group Comparisons: Drug effect on IQ](https://ericmjl.github.io/bayesian-stats-modelling-tutorial/notebooks/03-instructor-two-group-iq.html)\n- [Multi-Group Comparisons: Multiple ways of sterilizing phones](https://ericmjl.github.io/bayesian-stats-modelling-tutorial/notebooks/04-instructor-multi-group-comparsion-sterilization.html)\n- [Two Group Comparisons: Darwin's Finches](https://ericmjl.github.io/bayesian-stats-modelling-tutorial/notebooks/05-instructor-two-group-comparison-finches.html)\n- [Hierarchical Modelling: Baseball](https://ericmjl.github.io/bayesian-stats-modelling-tutorial/notebooks/06-instructor-hierarchical-baseball.html)\n- [Hierarchical Modelling: Darwin's Finches](https://ericmjl.github.io/bayesian-stats-modelling-tutorial/notebooks/07-instructor-hierarchical-finches.html)\n- [Bayesian Curve Regression: Identifying Radioactive Element](https://ericmjl.github.io/bayesian-stats-modelling-tutorial/notebooks/08-bayesian-curve-regression.html)\n\n\n# Acknowledgements\n\nDevelopment of this type of material is almost always a result of years of discussions between members of a community.\nWe'd like to thank the community and to mention several people who have played pivotal roles in our understanding the the material:\nMichael Betancourt,\nJustin Bois,\nAllen Downey,\nChris Fonnesbeck,\nJake VanderPlas.\nAlso, Andrew Gelman rocks!\n\n\n# Feedback\n\nPlease leave feedback for us [here](https://ericma1.typeform.com/to/j88n8P)!\nWe'll use this information to help improve the teaching and delivery of the material.\n\n# data credits\n\nPlease see individual notebooks for dataset attribution.\n\n# Further Reading \u0026 Resources\n\nFurther reading resources that are not specifically tied to any notebooks.\n\n- [Visualization in Bayesian workflow](https://arxiv.org/abs/1709.01449)\n- [PyMC3 examples gallery](https://docs.pymc.io/nb_examples/index.html)\n- [Bayesian Analysis Recipes](https://github.com/ericmjl/bayesian-analysis-recipes)\n- [Communicating uncertainty about facts, numbers and science](https://royalsocietypublishing.org/doi/full/10.1098/rsos.181870)\n- [Bernoulli's Fallacy by Aubrey Clayton](https://cup.columbia.edu/book/bernoullis-fallacy/9780231199940)\n","funding_links":[],"categories":["A01_机器学习教程"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fericmjl%2Fbayesian-stats-modelling-tutorial","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fericmjl%2Fbayesian-stats-modelling-tutorial","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fericmjl%2Fbayesian-stats-modelling-tutorial/lists"}