# Bayesian Regression in Bambi and PyMC for car example

**URL:** <https://community.intuitivebayes.com/t/bayesian-regression-in-bambi-and-pymc-for-car-example/283>\
**Category:** Probability and Regression Review\
**Created:** [June 25, 2022, 3:14am UTC](https://community.intuitivebayes.com/t/bayesian-regression-in-bambi-and-pymc-for-car-example/283 "2022-06-25T03:14:29Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![RavinKumar](https://yyz1.discourse-cdn.com/flex007/user_avatar/community.intuitivebayes.com/ravinkumar/32/13_2.png) [@RavinKumar](https://community.intuitivebayes.com/u/RavinKumar)\
**Post date:** [June 25, 2022, 3:14am UTC](https://community.intuitivebayes.com/t/bayesian-regression-in-bambi-and-pymc-for-car-example/283/1 "2022-06-25T03:14:29Z")

</div>

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!

> <https://github.com/canyon289/causal_inf_bookclub/blob/main/chapters/02_prob_regression/BambiRegression.ipynb>

---

<div class="post-metadata">

**Author:** ![Nforde](https://yyz1.discourse-cdn.com/flex007/user_avatar/community.intuitivebayes.com/nforde/32/44_2.png) [@Nforde](https://community.intuitivebayes.com/u/Nforde)\
**Post date:** [June 25, 2022, 12:25pm UTC](https://community.intuitivebayes.com/t/bayesian-regression-in-bambi-and-pymc-for-car-example/283/2 "2022-06-25T12:25:30Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![RavinKumar](https://yyz1.discourse-cdn.com/flex007/user_avatar/community.intuitivebayes.com/ravinkumar/32/13_2.png) [@RavinKumar](https://community.intuitivebayes.com/u/RavinKumar)\
**Post date:** [June 25, 2022, 1:58pm UTC](https://community.intuitivebayes.com/t/bayesian-regression-in-bambi-and-pymc-for-car-example/283/3 "2022-06-25T13:58:11Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Nforde](https://yyz1.discourse-cdn.com/flex007/user_avatar/community.intuitivebayes.com/nforde/32/44_2.png) [@Nforde](https://community.intuitivebayes.com/u/Nforde)\
**Post date:** [June 27, 2022, 10:12am UTC](https://community.intuitivebayes.com/t/bayesian-regression-in-bambi-and-pymc-for-car-example/283/4 "2022-06-27T10:12:42Z")

</div>

Great, will try later today.

EDIT: This config works for me:

```auto
[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"

```

 ![image](https://canada1.discourse-cdn.com/flex007/uploads/intuitivebayes/original/1X/acd00df34bdec28ddaef5b7cacf4c82190aa2437.png)
