Don't pass dims
to the likelihood distribution
#629
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.
We are passing
dims
to the likelihood distribution. Internally, there's something like what follows happeningHowever, the
dims
aren't used and they can bring more problems in special cases. PyMC can determine the shape of the distribution from the shape of theobserved
data.For more context, I figured this out because of a collaboration with people developing a library on top of Bambi. They have a custom likelihood function where
observed.ndim
is 2, but Bambi was passing a single dimension. My first attempt was to add a function that added as many dimensions as needed (a4e3646) but it turns we can actually make it work without passing dimensions and just letting PyMC use the shape fromobserved
.