{"id":15976844,"url":"https://github.com/tallamjr/bap-numpyro","last_synced_at":"2026-06-23T20:32:01.983Z","repository":{"id":71656936,"uuid":"406737830","full_name":"tallamjr/bap-numpyro","owner":"tallamjr","description":"Bayesian Analysis in Python (2nd ed.) with Numpyro","archived":false,"fork":false,"pushed_at":"2026-06-23T00:32:25.000Z","size":66703,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2026-06-23T02:15:21.669Z","etag":null,"topics":["bayesian-data-analysis","bayesian-inference","laplace-approximation","markov-chain-monte-carlo","numpyro","variational-inference"],"latest_commit_sha":null,"homepage":"https://tallamjr.github.io/bap-numpyro/","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/tallamjr.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":"2021-09-15T11:37:47.000Z","updated_at":"2026-06-22T22:42:19.000Z","dependencies_parsed_at":null,"dependency_job_id":"ac5ec512-d496-43e4-a9e9-a87a013da397","html_url":"https://github.com/tallamjr/bap-numpyro","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/tallamjr/bap-numpyro","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tallamjr%2Fbap-numpyro","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tallamjr%2Fbap-numpyro/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tallamjr%2Fbap-numpyro/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tallamjr%2Fbap-numpyro/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tallamjr","download_url":"https://codeload.github.com/tallamjr/bap-numpyro/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tallamjr%2Fbap-numpyro/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34706579,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-23T02:00:07.161Z","response_time":65,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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-data-analysis","bayesian-inference","laplace-approximation","markov-chain-monte-carlo","numpyro","variational-inference"],"created_at":"2024-10-07T22:41:20.126Z","updated_at":"2026-06-23T20:32:01.978Z","avatar_url":"https://github.com/tallamjr.png","language":"Jupyter Notebook","funding_links":[],"categories":[],"sub_categories":[],"readme":"![](https://github.com/tallamjr/bap-numpyro/workflows/CI/badge.svg)\n\n# Bayesian Analysis in Python (2nd ed.) with Numpyro\n\n\u003cimg src=\"https://static.packt-cdn.com/products/9781789341652/cover/9781789341652-original.png\" width=\"150\"\u003e\n\nAfter discovering the fantastic\n[`rethinking-numpyro`](https://fehiepsi.github.io/rethinking-numpyro/) project by\n[@fehiepsi](https://github.com/fehiepsi), I was inspired to try and do something like that myself.\nPrimarily as a learning activity, this is my attempt at porting\n[@aloctavodia](https://github.com/aloctavodia)'s \"Bayesian Analysis in Python\" [example PyMC3\ncode](https://github.com/aloctavodia/BAP) to [NumPyro](https://github.com/pyro-ppl/numpyro).\n\nThe port is now complete and modernised for 2026: all chapters (1-8) and exercises are ported, including newly-authored exercises for chapters 5-8 that do not exist in the original BAP repository.\n\n## Setup\n\nThe project is managed with [uv](https://docs.astral.sh/uv/) and targets the following stack:\n\n| Tool    | Version |\n|---------|---------|\n| Python  | 3.13    |\n| NumPyro | 0.21    |\n| JAX     | 0.10    |\n| ArviZ   | 0.23    |\n\nCreate the environment:\n\n```bash\nuv sync --group dev\n```\n\nRun all notebooks as tests:\n\n```bash\nuv run pytest --nbmake notebooks/\n```\n\nBuild the book locally:\n\n```bash\nuv run jupyter-book build .\n```\n\n### Running interactively in Jupyter Lab\n\nThe notebooks are configured to use a dedicated `bap-numpyro` kernel that points at the project's `.venv` interpreter. Register it once:\n\n```bash\nuv run python -m ipykernel install --user --name bap-numpyro --display-name \"Python (bap-numpyro)\"\n```\n\nThen launch Jupyter from the project environment and open any notebook:\n\n```bash\nuv run jupyter lab\n```\n\nEach notebook already selects the \"Python (bap-numpyro)\" kernel. Do not run them with a generic \"Python 3\" kernel: that may resolve to a different environment that lacks the pinned NumPyro/ArviZ stack and will raise import errors. If you see `ModuleNotFoundError: No module named 'numpyro'` (or `arviz`), the wrong kernel is selected: switch to \"Python (bap-numpyro)\" via Kernel \u003e Change Kernel.\n\n**Graphviz:** the model-rendering cell in the Chapter 2 exercises requires the `graphviz` system package. Install it with `brew install graphviz` (macOS) or `apt-get install graphviz` (Debian/Ubuntu).\n\n**Float64:** the Gaussian Process chapter and its exercises call `numpyro.enable_x64()` for numerical stability. Ensure JAX float64 is not disabled in your environment.\n\n## Acknowledgements\n\nMany many thanks to [Du Phan](https://github.com/fehiepsi) for the foundations of which I have built\nthis from and [Osvaldo Martin](https://github.com/aloctavodia) for the amazing book: Bayesian Data\nAnalysis in Python\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftallamjr%2Fbap-numpyro","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftallamjr%2Fbap-numpyro","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftallamjr%2Fbap-numpyro/lists"}