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

Consider using a better Uniform sampler #1936

Open
LilithHafner opened this issue Jan 7, 2025 · 1 comment
Open

Consider using a better Uniform sampler #1936

LilithHafner opened this issue Jan 7, 2025 · 1 comment

Comments

@LilithHafner
Copy link
Contributor

We currently use an affine transformation from [0,1):

rand(rng::AbstractRNG, d::Uniform) = d.a + (d.b - d.a) * rand(rng)

Perhaps this approach would be better: https://hal.science/hal-03282794 (pdf)

Originally posted by @Tortar in LilithHafner/DynamicDiscreteSamplers.jl#35 (comment)

@quildtide
Copy link
Contributor

It's rather convenient that the author, @goualard-f , even provided a naive Julia implementation that assumes that Distributions,jl is loaded.

It looks to me like all of the overhead of this method can be precomputed in a Sampler, except one of the if-branches.

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