-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
BUG: LKJCorr default transform raises error #7002
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
Comments
We disabled univariate transforms for multivariate RVs (see discussion: #6903 (comment)) It looks fine for this variable however (so much that it is a default... although not tested anywhere xD), so maybe we can remove that restriction. It was more to prevent users from shooting themselves in the foot, but I think it's better to allow that than not. CC @lucianopaz |
Thanks for the info! I agree we should allow it exactly because what motivates this model (I love this blogpost @tomicapretto !). Is this something a newbie like me can help with without going into your black magic 😅? |
Just have to remove the check added in that PR and sum the jacobian. Then tweak the tests and perhaps add one for the LKJCorr RV since it didn't complaint when we put the restriction in place |
ok! I might try it out! 😅 |
@ricardoV94 Do you mean remove the condition https://github.com/pymc-devs/pymc/blob/main/pymc/logprob/transform_value.py#L124 ? elif log_jac_det.ndim > logp.ndim: # <- This one?
...
Where precisely? Sorry, I do not get this one 🙈 |
When we apply a univariate transform to a multivariate rv the jacobian comes out larger than the logp (vector vs scalar). We need to reduce the jacobian before adding it to the logp, otherwise it would broadcast the logp and count the same thing multiple times. That's why we thought about just forbidding it. The reduction has to to be done exactly there where the error is now raised. |
Uh oh!
There was an error while loading. Please reload this page.
Describe the issue:
I am trying to run the model 4 from https://tomicapretto.github.io/posts/2022-06-12_lkj-prior/#model-4-correlated-priors-with-lkjcorr.-replicate-rstanarm-prior and I am getting the following error
Reproduceable code example:
Error message:
PyMC version information:
Context for the issue:
No response
The text was updated successfully, but these errors were encountered: