{"id":13471465,"url":"https://github.com/storopoli/Turing-Workshop","last_synced_at":"2025-03-26T13:31:10.526Z","repository":{"id":48199315,"uuid":"373971345","full_name":"storopoli/Turing-Workshop","owner":"storopoli","description":"DEPRECATED IN FAVOR OF TuringLang/Turing-Workshop","archived":true,"fork":false,"pushed_at":"2021-08-19T11:22:27.000Z","size":43984,"stargazers_count":34,"open_issues_count":0,"forks_count":9,"subscribers_count":5,"default_branch":"master","last_synced_at":"2024-10-30T02:59:41.884Z","etag":null,"topics":["bayesian-statistics","epidemiological-models","julia","turing","tutorials"],"latest_commit_sha":null,"homepage":"https://storopoli.github.io/Turing-Workshop/","language":"HTML","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"cc-by-sa-4.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/storopoli.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":"CITATION.cff","codeowners":null,"security":null,"support":null}},"created_at":"2021-06-04T22:20:36.000Z","updated_at":"2024-06-24T15:05:52.000Z","dependencies_parsed_at":"2022-09-15T22:51:39.185Z","dependency_job_id":null,"html_url":"https://github.com/storopoli/Turing-Workshop","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/storopoli%2FTuring-Workshop","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/storopoli%2FTuring-Workshop/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/storopoli%2FTuring-Workshop/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/storopoli%2FTuring-Workshop/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/storopoli","download_url":"https://codeload.github.com/storopoli/Turing-Workshop/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245662824,"owners_count":20652087,"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","epidemiological-models","julia","turing","tutorials"],"created_at":"2024-07-31T16:00:45.399Z","updated_at":"2025-03-26T13:31:08.613Z","avatar_url":"https://github.com/storopoli.png","language":"HTML","funding_links":[],"categories":["HTML"],"sub_categories":[],"readme":"Workshop of Bayesian Statistics with Julia and Turing\n================\n\n[![CC BY-SA\n4.0](https://img.shields.io/badge/License-CC%20BY--SA%204.0-lightgrey.svg)](http://creativecommons.org/licenses/by-sa/4.0/)\n\n\u003cdiv class=\"figure\" style=\"text-align: center\"\u003e\n\n\u003cimg src=\"images/bayes-meme.jpg\" alt=\"Bayesian for Everyone!\" width=\"500\" /\u003e\n\u003cp class=\"caption\"\u003e\nBayesian for Everyone!\n\u003c/p\u003e\n\n\u003c/div\u003e\n\nThis is a [**Turing**](http://turing.ml/) Workshop on how to do **Bayesian Statistics**. The Workshop is heavily based on tutorials available at [storopoli.io/Bayesian-Julia](https://storopoli.io/Bayesian-Julia). If you want you can see the [YouTube video](https://youtu.be/CKSxxJ7RdAU) from the recorded workshop at [Stuttgart Julia Programming Language Meetup Group](https://www.meetup.com/stuttgart-julia-programming-language-meetup-gruppe/).\n\n**Bayesian statistics** is an approach to inferential statistics based on Bayes' theorem, where available knowledge about parameters in a statistical model is updated with the information in observed data. The background knowledge is expressed as a prior distribution and combined with observational data in the form of a likelihood function to determine the posterior distribution. The posterior can also be used for making predictions about future events.\n\n**Bayesian statistics** is a departure from classical inferential statistics that prohibits probability statements about parameters and is based on asymptotically sampling infinite samples from a theoretical population and finding parameter values that maximize the likelihood function. Mostly notorious is null-hypothesis significance testing (NHST) based on *p*-values. Bayesian statistics **incorporate uncertainty** (and prior knowledge) by allowing probability statements about parameters, and the process of parameter value inference is a direct result of the **Bayes' theorem**.\n\n$$\\underbrace{P(\\theta \\mid y)}_{\\text{Posterior}} = \\frac{\\overbrace{P(y \\mid  \\theta)}^{\\text{Likelihood}} \\cdot \\overbrace{P(\\theta)}^{\\text{Prior}}}{\\underbrace{P(y)}_{\\text{Normalizing Costant}}}$$\n\n## Table of Contents\n\n   * [Julia](#julia)\n   * [Turing](#turing)\n   * [Author](#author)\n   * [How to use the content?](#how-to-use-the-content)\n   * [What about other Turing tutorials?](#what-about-other-turing-tutorials)\n   * [How to cite](#how-to-cite)\n   * [Books](#recommended-books)\n   * [License](#license)\n\n## Julia\n\n[**Julia**](https://www.julialang.org) is a fast dynamic-typed language that just-in-time (JIT) compiles into native code using LLVM. It [\"runs like C but reads like Python\"](https://www.nature.com/articles/d41586-019-02310-3), meaning that is *blazing* fast, easy to prototype and read/write code. It is multi-paradigm, combining features of imperative, functional, and object-oriented programming. I won't cover Julia basics and any sort of data manipulation using Julia in the tutorials, instead please take a look into the following resources which cover most of the introduction to Julia and how to work with tabular data in Julia:\n\n* [**Julia Documentation**](https://docs.julialang.org/): Julia documentation is a very friendly and well-written resource that explains the basic design and functionality of the language.\n* [**Thinking Julia**](https://benlauwens.github.io/ThinkJulia.jl/latest/book.html): introductory beginner-friendly book that explains the main concepts and functionality behind the Julia language.\n* [**Julia High Performance**](https://www.amazon.com/Julia-High-Performance-Avik-Sengupta/dp/178829811X): book by two of the creators of the Julia Language ([Avik Sengupta](https://www.linkedin.com/in/aviks) and [Alan Edelman](http://www-math.mit.edu/~edelman/)), it covers how to make Julia even faster with some principles and tricks of the trade.\n* [**An Introduction DataFrames**](https://github.com/bkamins/Julia-DataFrames-Tutorial): the package [`DataFrames.jl`](https://dataframes.juliadata.org/stable/) provides a set of tools for working with tabular data in Julia. Its design and functionality are similar to those of `pandas` (in Python) and `data.frame`, `data.table` and `dplyr` (in R), making it a great general purpose data science tool, especially for those coming to Julia from R or Python.This is a collection of notebooks that introduces `DataFrames.jl` made by one of its core contributors [Bogumił Kamiński](https://github.com/bkamins).\n\n## Turing\n\n[**Turing**](http://turing.ml/) is a ecosystem of Julia packages for Bayesian Inference using [probabilistic programming](https://en.wikipedia.org/wiki/Probabilistic_programming). Models specified using Turing are easy to read and write — models work the way you write them. Like everything in Julia, Turing is [fast](https://arxiv.org/abs/2002.02702).\n\n## Author\n\nJosé Eduardo Storopoli, PhD - [*Lattes* CV](http://lattes.cnpq.br/2281909649311607) - [ORCID](https://orcid.org/0000-0002-0559-5176) - \u003chttps://storopoli.io\u003e\n\n\u003cjosees@uni9.pro.br\u003e\n\nI would like to thank [Stuttgart Julia Programming Language Meetup Group](https://www.meetup.com/stuttgart-julia-programming-language-meetup-gruppe/) and [Juliane Weilbach](https://www.linkedin.com/in/juliane-weilbach-47946117a/) for the opportunity to present the first version of this Workshop.\n\n## How to use the content?\n\nThe content is licensed under a very permissive Creative Commons license (CC BY-SA). You are mostly welcome to contribute with [issues](https://www.github.com/storopoli/Turing-Workshop/issues) and [pull requests](https://github.com/storopoli/Turing-Workshop/pulls). My hope is to have **more people into Bayesian statistics**. The content is aimed towards social scientists and PhD candidates in social sciences. I chose to provide an **intuitive approach** rather than focusing on rigorous mathematical formulations. I've made it to be how I would have liked to be introduced to Bayesian statistics.\n\nJust access [storopoli.io/Turing-Workshop](https://storopoli.io/Turing-Workshop) and click on `Edit or run this notebook` and then click on `binder`!\n\nTo configure a local environment:\n\n1. Download and install [Julia](https://www.julialang.org/downloads/)\n2.  Clone the repository from GitHub:\n    `git clone https://github.com/storopoli/Turing-Workshop.git`\n3.  Access the directory: `cd Turing-Workshop`\n4.  Run the Pluto Notebook by typing in the Julia REPL:\n    ```julia\n    using Pluto\n    Pluto.run(notebook=\"Turing_Workshop.jl\")\n    ```\n\n## What about other Turing tutorials?\n\nDespite not being the only Turing tutorial that exists, this workshop aims to introduce Bayesian inference along with how to use Julia and Turing. Here is a (not complete) list of other Turing tutorials:\n\n1. [**Official Turing Tutorials**](https://turing.ml/dev/tutorials/): tutorials on how to implement common models in Turing\n2. [**Statistical Rethinking - Turing Models**](https://statisticalrethinkingjulia.github.io/TuringModels.jl/): Julia versions of the Bayesian models described in *Statistical Rethinking* Edition 1 (McElreath, 2016) and Edition 2 (McElreath, 2020)\n3. [**Håkan Kjellerstrand Turing Tutorials**](http://hakank.org/julia/turing/): a collection of Julia Turing models\n\n## How to cite\n\nTo cite these tutorials, please use:\n\n    Storopoli (2021). Workshop of Bayesian Statistics with Julia and Turing. https://storopoli.io/Turing-Workshop.\n\nOr in BibTeX format (LaTeX):\n\n    @misc{storopoli2021turingworkshop,\n      author = {Storopoli, Jose},\n      title = {Workshop of Bayesian Statistics with Julia Turing},\n      url = {https://storopoli.io/Turing-Workshop},\n      year = {2021}\n    }\n\n## Recommended Books\n\n* [Gelman, A., Carlin, J. B., Stern, H. S., Dunson, D. B., Vehtari, A., \u0026 Rubin, D. B. (2013). *Bayesian Data Analysis*. Chapman and Hall/CRC.](https://www.routledge.com/Bayesian-Data-Analysis/Gelman-Carlin-Stern-Dunson-Vehtari-Rubin/p/book/9781439840955)\n\u003cdiv class=\"figure\" style=\"text-align: center\"\u003e\n\u003cimg src=\"images/BDA_book.jpg\" alt=\"Bayesian Data Analysis\" width=\"100\" /\u003e\n\u003c/div\u003e\n\n* [McElreath, R. (2020). *Statistical rethinking: A Bayesian course with examples in R and Stan*. CRC press.](https://www.routledge.com/Statistical-Rethinking-A-Bayesian-Course-with-Examples-in-R-and-STAN/McElreath/p/book/9780367139919)\n\u003cdiv class=\"figure\" style=\"text-align: center\"\u003e\n\u003cimg src=\"images/SR_book.jpg\" alt=\"Bayesian Data Analysis\" width=\"100\" /\u003e\n\u003c/div\u003e\n\n* [Gelman, A., Hill, J., \u0026 Vehtari, A. (2020). *Regression and other stories*. Cambridge University Press.](https://www.cambridge.org/fi/academic/subjects/statistics-probability/statistical-theory-and-methods/regression-and-other-stories)\n\u003cdiv class=\"figure\" style=\"text-align: center\"\u003e\n\u003cimg src=\"images/ROS_book.jpg\" alt=\"Bayesian Data Analysis\" width=\"100\" /\u003e\n\u003c/div\u003e\n\n* [McGrayne, S.B (2012). *The Theory That Would Not Die: How Bayes' Rule Cracked the Enigma Code, Hunted Down Russian Submarines, and Emerged Triumphant from Two Centuries of Controversy* Yale University Press.](https://www.amazon.com/Theory-That-Would-Not-Die/dp/0300188226/)\n\u003cdiv class=\"figure\" style=\"text-align: center\"\u003e\n\u003cimg src=\"images/Bayes_book.jpg\" alt=\"Bayesian Data Analysis\" width=\"100\" /\u003e\n\u003c/div\u003e\n\n\n## License\n\nThis content is licensed under [Creative Commons Attribution-ShareAlike 4.0 Internacional](http://creativecommons.org/licenses/by-sa/4.0/).\n\n[![CC BY-SA 4.0](https://licensebuttons.net/l/by-sa/4.0/88x31.png)](http://creativecommons.org/licenses/by-sa/4.0/)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstoropoli%2FTuring-Workshop","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fstoropoli%2FTuring-Workshop","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstoropoli%2FTuring-Workshop/lists"}