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

Unexpected behavior of truncated for zero variance distributions at the lower bound #1867

Open
HakanBrian opened this issue Jun 1, 2024 · 2 comments · May be fixed by #1721
Open

Unexpected behavior of truncated for zero variance distributions at the lower bound #1867

HakanBrian opened this issue Jun 1, 2024 · 2 comments · May be fixed by #1721

Comments

@HakanBrian
Copy link

When truncating a Normal distribution with zero variance and mean equal to the lower bound of the truncated, evaluating rand will result in infinite compilation time. An equivalent operation with the upper bound of the truncated will return the value for the upper bound as expected.

Example:

using Distributions

rand(truncated(Normal(1, 0), 0, 1))  # Expected output: 1
rand(truncated(Normal(0, 0), 0, 1))  # Expected output: 0

# Note that when the expected output is 0 we get infinite compilation time.
@quildtide
Copy link
Contributor

At a surface level, this sounds closely related to #1264 and #1712 to me.

#1721 should help resolve this, I think.

@HakanBrian
Copy link
Author

Yes, you are right. #1721 will resolve this issue.

@HakanBrian HakanBrian linked a pull request Aug 15, 2024 that will close this issue
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

Successfully merging a pull request may close this issue.

2 participants