-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
LKJ priors influence sampling of unconnected RVs #3641
Comments
That's because our transformation for LKJ is incorrect (#3473 exactly). In pure forward sampling, this will gives invalid correlation matrix, that interact with the other RVs in unexpected way (recall that all RVs are sampled in the same augmented auxiliary space, and if some RVs are in a geometric space that is difficult/incorrect, it will make NUTS terminated too early and affect the correctness of other RVs) |
LKJCholeskyCov should give you correct result, if you are not using half cauchy in this case. |
What is the issue with the half Cauchy? The same thing happens with other choices of |
How can you tell there is problem? There is not divergent sample. |
Note that eyeballing the trace is usually not a good way to diagnose problem |
Perhaps not in general, but there is clearly a pathology at ~1500 samples and ~2 in the posterior density of
Just ran it for a second time:
And a third:
There is not always a divergence but there is always a problem. There are usually more of them with smaller chains and less tuning. Here is the figure from the third run. Again, clearly, a massive pathology. |
Usually the prior distribution is in a much larger range, which makes the tail area much more pathological. For this reason we usually recommend using prior_sample for sampling from model with no observed. |
Closing this for now but feel free to keep discussing it here. |
Both
LKJCorr
andLKJCholeskyCov
influence the sampling of random variables they are not connected to. This is not expected behavior, right?The following code produces several figures to illustrate this:
Here they are, in order of creation:
What is causing the obvious pathologies when sampling
a
in the latter two models ifa
andM
are not connected in any way?Also, why is the LKJ prior on the correlation matrix in
test_1.png
not flat? Is it related to https://github.com/pymc-devs/pymc3/issues/3473#issue-442041528?The text was updated successfully, but these errors were encountered: