{"id":17723737,"url":"https://github.com/junpenglao/functionalbayes","last_synced_at":"2025-09-19T12:33:34.620Z","repository":{"id":176935553,"uuid":"606056560","full_name":"junpenglao/functionalbayes","owner":"junpenglao","description":"A Functional Programming Approach to Composable Bayesian Workflow","archived":false,"fork":false,"pushed_at":"2024-08-01T10:20:59.000Z","size":27702,"stargazers_count":7,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"main","last_synced_at":"2024-08-01T11:50:01.426Z","etag":null,"topics":[],"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/junpenglao.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-02-24T13:57:30.000Z","updated_at":"2024-08-01T10:21:03.000Z","dependencies_parsed_at":null,"dependency_job_id":"87a32436-a6b1-4069-b0cc-853fd74140b6","html_url":"https://github.com/junpenglao/functionalbayes","commit_stats":null,"previous_names":["junpenglao/functionalbayes"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/junpenglao%2Ffunctionalbayes","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/junpenglao%2Ffunctionalbayes/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/junpenglao%2Ffunctionalbayes/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/junpenglao%2Ffunctionalbayes/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/junpenglao","download_url":"https://codeload.github.com/junpenglao/functionalbayes/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253822868,"owners_count":21969833,"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":[],"created_at":"2024-10-25T15:43:50.325Z","updated_at":"2025-09-19T12:33:34.553Z","avatar_url":"https://github.com/junpenglao.png","language":"Jupyter Notebook","readme":"# A Functional Programming Approach to Composable Bayesian Workflow\n\nContributed talk at [Bayes Comp 2023](https://bayescomp2023.com/)\n\n_Abstract_:\nBayesian modeling in practice is an iterative process, in which a practitioner implicitly or explicitly follows the [Bayesian workflow](https://arxiv.org/abs/2011.01808) (Gelman et al 2020) to build models and inferences that are closest to the “reality” within the computational constraints. A composable model building capability is often desired as it makes developing bigger and more complex Bayesian models easier: for example, changing the priors of a collection of random variables. Moreover, a composable approach could enable more flexibility in constructing inferences that optimize for local model structure, thus have the opportunity to improve inference quality compared to using a general inference methods statistical packages offer (e.g., NUTS with different schemes of adaptation). In this talk, I will explain how adopting a functional programming perspective benefits the development of composable Bayesian modeling and programmable inference, with example using [TensorFlow Probability on JAX](https://www.tensorflow.org/probability/examples/TensorFlow_Probability_on_JAX) (for the modeling part) and [Blackjax](https://blackjax-devs.github.io/blackjax/) (for the inference part).\n\n## Set up\n```shell\nconda create -n bayescomp23 python=3.10\nconda activate bayescomp23\npip install -r requirements.txt\n```\n\n## Slides\n[Google Slides link](https://docs.google.com/presentation/d/1Fa2QEeFTo22AatybSiu9MeA6bF1kRq5JGVsF4W6BHa4/edit?usp=sharing\u0026resourcekey=0-8DO5WGkp59q-K9RW7YUwSw)\n\n## Materials\n\n- [golf_putting.ipynb](https://github.com/junpenglao/functionalbayes/blob/main/golf_putting.ipynb): a notebook that demonstrates the iterative process of model building in a Bayesian workflow, with a functional programming princple to achieve composablity.\n\n- [sparse_regression.ipynb](https://github.com/junpenglao/functionalbayes/blob/main/sparse_regression.ipynb): a simulation study with a sparse regression model, with a similar functional programming approch.\n\n- [blackjax_deepdive.ipynb](https://github.com/junpenglao/functionalbayes/blob/main/blackjax_deepdive.ipynb): a notebook that demonstrates the use of low level Blackjax to diagnose the performance of sampling routine.","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjunpenglao%2Ffunctionalbayes","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjunpenglao%2Ffunctionalbayes","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjunpenglao%2Ffunctionalbayes/lists"}