pymc-devs / pymc

Bayesian Modeling and Probabilistic Programming in Python
https://docs.pymc.io/
Other
8.66k stars 2k forks source link

Fix bug with `compute_p` for partially observed OrderedLogistic and OrderedProbit variables #7349

Closed ricardoV94 closed 3 months ago

ricardoV94 commented 3 months ago

This fixes a bug when auto-imputation takes place, in which case the logic to retrieve p wasn't valid. This will also show p as an input of the underlying Categorical in the graphviz.

Description

This PR fixes a bug when setting compute_p=True for partially observed OrderedLogistic/Probit. The logic of retrieving p from the third input does not work in this case, because when there is imputation a different kind of variable is returned (the joined vector of imputed and observed variables)

Checklist

Type of change


📚 Documentation preview 📚: https://pymc--7349.org.readthedocs.build/en/7349/