-
-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Bug in MatrixNormal.sample #3585
Comments
Should we add this to the tests, as an expected fail for now? |
Maybe it is not that hard to fix, we could just broadcast both matrices and mu to |
This issue is similar to #2848. Most, if not all, of the multivariate distributions have some shape handling defects when their distribution parameters depend on other RVs. |
I am just wondering now then, what would hypothetically need to be done, as a general fix, to get rid of this bug for the rest of the distributions? |
I sense broadcasting all the parameters just after they are drawn and then proceeding with calculations, will be a good option. That's how MvNormal.random method is fixed in #4207. |
If one of the matrix parameters is a random variable, then MatrixNormal.sample runs into shape errors because it might be passed an array of col or row matrices instead of just one.
pm.sample_prior_predictive
will fail in a case like this:In this example
rowchol
will have shape(2, 15, 15)
.https://github.com/pymc-devs/pymc3/blob/master/pymc3/distributions/multivariate.py#L1598
Originally reported by calvinm on discord:
https://discourse.pymc.io/t/reshape-error-inside-sample-prior-predictive/3715
The text was updated successfully, but these errors were encountered: