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

use non-global rng #436

Closed
CarloLucibello opened this issue Nov 26, 2015 · 3 comments
Closed

use non-global rng #436

CarloLucibello opened this issue Nov 26, 2015 · 3 comments

Comments

@CarloLucibello
Copy link

I would like to have the opportunity to do something like this

d= Binomial(10,0.1)
rng = MersenneTwister(17)
rand(rng, d)

Is there any way to do something similar?

@simonbyrne
Copy link
Member

Not yet: some distributions such as Binomial utilise the Rmath RNGs, which unfortunately are tied to global state. I'm hoping to fix this in the near future.

@zsunberg
Copy link
Contributor

zsunberg commented Jun 7, 2016

This would be extremely useful to us - we're developing a framework for decision making under uncertainty. We use a lot of distributions, but it is really convenient to be able to specify the rng, so using Distributions.jl doesn't work well for us yet. I hope that you can implement this soon - we would really like to enable more ease-of use and compatibility of code by using this!

@richardreeve
Copy link
Contributor

@matbesancon I think this can be closed now.

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

5 participants