pymc-devs / pymc-examples

Examples of PyMC models, including a library of Jupyter notebooks.
https://www.pymc.io/projects/examples/en/latest/
MIT License
259 stars 212 forks source link

Add Besag-York-Mollie notebook #566

Closed daniel-saunders-phil closed 10 months ago

daniel-saunders-phil commented 10 months ago

I've been working on a notebook that demonstrates how to build and interpret the Besag-York-Mollie model. The BYM model is a popular choice for spatial data, especially in epidemiology. PyMC just gained an ICAR distribution, which is a key ingredient in the BYM model. There is a well-developed literature on Bayesian approaches to BYM, written largely by folks in the Stan and r-INLA community:

By contrast, there is very little tutorial material written for Python users who want to do Bayesian spatial modeling. So this notebook would help rectify that and maybe make PyMC appealing to a new segment of the data science community.

To do:


:books: Documentation preview :books:: https://pymc-examples--566.org.readthedocs.build/en/566/

review-notebook-app[bot] commented 10 months ago

Check out this pull request on  ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB

review-notebook-app[bot] commented 10 months ago

View / edit / reply to this conversation on ReviewNB

fonnesbeck commented on 2023-08-21T19:00:01Z ----------------------------------------------------------------

Line #10.    from icardist import ICAR

Can we change this to a PyMC import now that it's merged?


_daniel-saunders-phil commented on 2023-08-22T00:38:37Z_ ----------------------------------------------------------------

I was going to just wait until the next release. Do you know if it's possible to install versions directly from github without them being released? I searched a bit for instructions but came up empty handed.

_bwengals commented on 2023-08-24T18:39:51Z_ ----------------------------------------------------------------

assuming you have a conda env that you're working out of where you've already installed pymc, you can pip install from a specific git repo branch. Add --no-deps at the end though, this will make pip only install the pymc code and not try and mess with dependencies.