-
-
Notifications
You must be signed in to change notification settings - Fork 447
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
Add Bernoulli distribution #300
Comments
We went with |
After some discussion (#347) we probably still want a |
I'm working on a PR. What is the reasoning behind |
@vks. Good that you want to make a PR! As you have been following this repro pretty closely, I think I can ask you this. Making the PR for this distribution is trivial. Before that, can you provide links to the relevant discussions there have been on this issue, and summarize the concerns and possible implementations? |
AFAIK the only advantage of the lower precision variant using "only" 32 bits is that more optimisation can be done when |
Add a Bernoulli distribution (i.e. boolean with probability p).
This is basically just
rng.gen() < p
, but the uniform distribution used to generate a float has precision limited toε
(smallest representable number above 1); we can do better.We may decide not to implement this as a distribution but with a simple function calling
rng.sample(HighPrecision01) < p
or similar.See also #293: add
Rng::gen_bool
or similarThe text was updated successfully, but these errors were encountered: