From: Bart Braem Date: 2009-01-24T00:53:14+09:00 Subject: Re: Separate random number generators? On Jan 23, 3:59 pm, Bart Braem wrote: > On Jan 23, 3:34 pm, Lars Christensen wrote: > > > > > On Jan 23, 3:07 pm, Bart Braem wrote: > > > > On Jan 22, 2:20 pm, James Gray wrote: > > > > > On Jan 22, 2009, at 5:39 AM, Bart Braem wrote: > > > > > > On Jan 22, 12:13 pm, Lars Christensen wrote: > > > > >> On Jan 22, 11:38 am, Bart Braem wrote: > > > > > >>> For simulation work, I want to use multiple, independent random   > > > > >>> number > > > > >>> generators. Does anyone know up to date implementations? > > > > > >> What do you mean by independent RNG? Numbers drawn from a single RNG > > > > >> are usually independent enough. > > > > > >> Do you mean separate deterministic PRNGs with fixed seeds for > > > > >> reproducible sequences? Then take a look at this Ruby Quiz: > > > > > >>http://www.splatbang.com/rubyquiz/quiz.rhtml?id=173_Not_So_Random > > > > > > I indeed mean separate deterministic PRNGs with fixed seeds for > > > > > reproducible sequences. Interesting to see this was a Ruby Quiz! Are > > > > > there solutions without the use of DRb and other libraries? > > > > > Sure.  See the first solution link on that page (also shown in the   > > > > quiz write-up). > > > > > James Edward Gray II > > > > The first solution is of course not that efficient, I will be > > > generating lots of random numbers. I'm going to take a look at ruby- > > > gsl, the ISAAC library gives strange results... > > > > Thanks for your help! > > > I do think that my own solution (last on the page) is efficient, but i > > can't vouch for the statistical properties (it reseeds the Mersenne > > Twister in Ruby every time a number is drawn, although randomly). > > I've tested this setup, with just one RNG. Running my unit tests is > about 5 times slower, unfortunately. I am calling the random number > very often, more than 10.000 times in 10 seconds in a simulation that > uses the standard kernel rand. > I can't afford this slowdown, but it seems as though there are no > other solutions that do not use a pure-ruby library? To follow up: using the Slave library results in quite unstable behaviour on OSX, sometimes the slave processes can not be found. Chmodding /tmp does change a bit, but it still causes an overloaded system in long tests. I can't share code as it is part of ongoing research, but doing something seemingly easy like integrating separate RNGs is causing headaches...