pymc-examples
pymc-examples copied to clipboard
updating priors
File: https://github.com/pymc-devs/pymc-examples/blob/main/examples/pymc3_howto/updating_priors.ipynb Reviewers:
The sections below may still be pending. If so, the issue is still available, it simply doesn't have specific guidance yet. Please refer to this overview of updates
Known changes needed
Changes listed in this section should all be done at some point in order to get this notebook to a "Best Practices" state. However, these are probably not enough! Make sure to thoroughly review the notebook and search for other updates.
General updates
ArviZ related
Changes for discussion
Changes listed in this section are up for discussion, these are ideas on how to improve the notebook but may not have a clear implementation, or fix some know issue only partially.
General updates
ArviZ related
Notes
Exotic dependencies
Computing requirements
I would like to work on this issue 🙋🏽♀️
@symeneses moving the discussion from https://github.com/pymc-devs/pymc-examples/issues/394#issuecomment-1192300850 to here.
The approach used in the updating priors notebook has multiple problems, the most critical one being that it uses univariate priors, which is generally not the case and can't be extended or used in other cases. I wrote a bit on this in one of my blogposts: https://oriolabrilpla.cat/python/arviz/pymc/xarray/xarray-einstats/2022/05/25/too-eager-reduction.html#Univariate-priors.
I'd recommend rewriting it not from scratch but nearly so that it uses prior_from_idata from the pymc-experimental library. It won't depend on pm.Interpolated anymore and should not be blocked until the issues with this are fixed. Let me know how it sounds. If you prefer it we could also leave this for another future PR.
I think we can update this notebook using pm.Interpolated
if this is a good example
of how to use pm.Interpolated
, and create after a similar one using the approach you suggested. Otherwise, we can update the notebook as you suggested.
I don't think it is a good example of using pm.Interpolated
as its use is intertwined with the prior updating. At least that is the impression I got from Discourse and some other issues, users don't really understand how Interpolated works and is being used here and they generally struggle updating the code to their own models due to this (which is problematic because they probably should not be adapting this to their own model and because they are also not even understanding what is going on either).
If we want an example of using Interpolated, maybe it could be to generate priors out of literature reviews or other more empirical knowledge. @aloctavodia do you maybe know an example of something like this?
Nothing from the top of my head... but I will try to think about an example.