Support PyMC 5.13 and fix bayeux related issues #803
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
PyMCModel._clean_results()
topm.compute_deterministics()
function when a bayeux based sampler is used.pt.specify_broadcastable
with group-specific effects when the expression side is a factor variable of two levels. It's a very specific case, but we support it and it was failing with PyMC 5.13 as all coords started to be mutable with this PyMC version.This PR closes #800
Why I modified how we rename dims with bayeux. See the following example:
With the old implementation, it would have failed. Look at
bambi/bambi/backend/pymc.py
Lines 275 to 281 in 5c00663
what happened in that case was that
pymc_model_dims
andbayeux_dims
where of different lengths and thus the dictionary created was mixing things.This new approach
exploits the fact that we know we can only rename dims passed to the model, they can't finish with
_obs
and they have to be in the posterior. And most importantly, the "bad" bayeux names are like the original names with an extra_0
(e.g.party_id_dim
original andparty_id_dim_0
as result in bayeux).