-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
transforms.ordered doesn't apply to samples found with .random() #4213
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
Thanks for reporting - we need a |
Could we resort to some costly rejection sampling in here? Or mix rejection sampling and truncated sampling for those distributions we have cdf / inverse cdf methods. |
i dont think that's necessary - just need to sort the forward simulation |
That only works if the sorted distributions are identically distributed |
Random forward methods in general don't (and can't) respect transforms that change the density of a distribution (they are not even aware of them). We can create distributions that generate forward samplers that are equivalent to the transformed distribution that is sampled by MCMC, but otherwise users shouldn't expect the two forms of sampling to match when using non-default transformations. For the case of sorting we would need something like aesara-devs/aeppl#44 |
Please provide a minimal, self-contained, and reproducible example.
Modified version of example given at https://docs.pymc.io/api/distributions/discrete.html?highlight=ordered#pymc3.distributions.discrete.OrderedLogistic
Please provide the full traceback.
Expected result: c[0] is always < c[1]
However the full demo given at the URL works fine. So I guess that one of the members of the
Transform
subclass has a bug in it?Or maybe I misunderstood the API and when you call
X.random()
you are supposed to see the sample before the transform?It seems quite likely this is a bug but apologies if this is actually correct behaviour.
Here is another one where someone is sampling an ordered pair but no output.
#3680
Versions and main components
The text was updated successfully, but these errors were encountered: