Is there any way to use a distribution from Distributions.jl with a custom RNG?
I know how to sample in a reproducible manner from a uniform distribution (see x1 and x2 in the code below).
But Distrubutions.jl seems to rely on Base.Random.GLOBAL_RNG which I do not want to use
I read this post, but was unable to solve my issue
I found a Julia implementation for Binomial (in LightGraphs), which I might just use, but I would prefer to have this working for any distribution.
using RandomNumbers, Distributions const RNG_XOR=Xorshifts.Xorshift1024Plus(0x1234567890abcdef) const RNG_MERSENNE=MersenneTwister(2001) const RNG_SELECTED=RNG_MERSENNE x1=rand(RNG_XOR) #this works fine, x1 is reproducible each time I initialize my seed & custom RNG, I get the same value for x1 x2=rand(RNG_MERSENNE) #this works fine as well # this line throws an error (I was hoping this would solve my problem...) # Base.Random.GLOBAL_RNG=RNG_SELECTED some_distr=Binomial(200,0.1) rand(some_distr) #this 'value' is only reproducible if i run srand(some_seed) beforehand, but I want to use a different RNG