Skip to content
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

Dependent uniform variables not working correctly #2245

Closed
evolbeginner opened this issue Jun 1, 2024 · 2 comments
Closed

Dependent uniform variables not working correctly #2245

evolbeginner opened this issue Jun 1, 2024 · 2 comments

Comments

@evolbeginner
Copy link

evolbeginner commented Jun 1, 2024

In the following code I want to sample two variables, X1 ~ Uniform(0,1) and X2 ~ Uniform(0,X1)

using Turing
@model function model()
X1 ~ Uniform(1e-5, 1)
X2 ~ Uniform(0, X1)
end
my_model = model(); sample(my_model, NUTS(), 10000)

The mean of X2 should be 0.25 but I got it varying a lot each time. I believe X2 is not sampled correctly. I don't see the problem if X2 ~ Normal(X1,1) or X2 ~ Exponential(X1). Does anyone know why this issue happens and why it's specific to uniform distribution? Thanks in advance.

image
image

@evolbeginner
Copy link
Author

I think it's fixed in v0.32.3. Thanks!

@yebai
Copy link
Member

yebai commented Jun 3, 2024

related PR: #2202

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants