Bayesian Regression in Bambi and PyMC for car example

As part of this chapter’s reading I redid the linear regression using Bayesian parameter estimation using PyMC, Bambi, and JAX. I’ve always thought Bayesian estimation is cool, but its the first time I’ve used the latest versions of these libraries and the new tools are incredible.

Take a look and feel free to ask any questions!

Great! I’m keen to do the same. How do you normally set up your env? Conda? I normally use poetry and I was hoping the latest release of pymc can be integrated with that tool via the pip release?

Depending on the situation I use docker, pip+vm, or conda. Poetry should as well.

I just pushed a (messy) requirements file but I’ll list out what you need here. If you get these installed it should work!

  • PyMC 4.0.1
  • Bambi from github main
  • Blackjax
  • Jax
2 Likes

Great, will try later today.

EDIT: This config works for me:

[tool.poetry]
name = "async_research"
version = "0.1.0"
description = ""

[tool.poetry.dependencies]
python = ">=3.9,<3.11"
scikit-learn = "^1.0.2"
pandas = "^1.4.2"
jupyter = "^1.0.0"
matplotlib = "^3.5.1"
seaborn = "^0.11.2"
statsmodels = "^0.13.2"
pymc = "4.0.0"
bambi = {git = "https://github.com/bambinos/bambi.git", rev = "main"}
blackjax = "^0.8.2"
jax = "^0.3.13"
jaxlib = "^0.3.10"
jaxopt = "^0.4.2"

[tool.poetry.dev-dependencies]

[build-system]
requires = ["poetry-core>=1.0.0"]
build-backend = "poetry.core.masonry.api"

1 Like