Skip to content
Prev 336829 / 398513 Next

geneation

I am baffled why you have gone so far down this road, Ted. Considerable effort has gone into making prediction of value N of the RNG sequence unrelated to value N-1 of the sequence as long as you don't know the internal state of the RNG. This is true for both the R internal RNG and the platform-dependent /dev/urandom ("similarity" of successive reads from /dev/urandom is only true by a very subtle definition of similarity... most users would not see any relationship between them because of the hidden state information). There is no benefit to dipping into the clock again mid-stream if your  subsequent analysis is truly unrelated to the previous analysis, and if it is related then you should not be breaking the sequence.

In any case where you need multiple sets of random y values while keeping the same set of x values, just keep the first set of x values in memory while you continue to generate new sets of y values. Many decades of users have found the existing RNG functional interface sufficient in multiple analysis environments. If you are dissatisfied with the randomness supplied to you by the standard functions then you should be using custom RNGs and/or hardware/OS-specific entropy sources, not mucking around with set.seed() or expecting set.seed() to do something it was not designed to do.

To the OP: Often people say that you only need to call set.seed() once per session, but I think it it is better to think of it as a group of reproducible simulations. I often re-run set.seed() several times during the same R session to maintain consistency as I get a set of simulations working, but there is simply no need to call it as a way to introduce more randomness into the RNG sequence within a single set of related randomly-generated data.
---------------------------------------------------------------------------
Jeff Newmiller                        The     .....       .....  Go Live...
DCN:<jdnewmil at dcn.davis.ca.us>        Basics: ##.#.       ##.#.  Live Go...
                                      Live:   OO#.. Dead: OO#..  Playing
Research Engineer (Solar/Batteries            O.O#.       #.O#.  with
/Software/Embedded Controllers)               .OO#.       .OO#.  rocks...1k
--------------------------------------------------------------------------- 
Sent from my phone. Please excuse my brevity.
On February 20, 2014 4:00:10 AM PST, Ted.Harding at wlandres.net wrote: