help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: rand("state")


From: Mike Miller
Subject: Re: rand("state")
Date: Thu, 16 Feb 2006 11:00:20 -0600 (CST)

On Thu, 16 Feb 2006, Francesco Potorti` wrote:

All you have to worry about is the probability of your seeds colliding. If you are doing 10^6 simulations, an integer seed gives you a 1 in 4000 chance of this happening. If even this is too high, you can either start at seed 0 and increment to get 10^6 independent sequences,

Unfortunately, that is not true. All you know is that the sequence is extremely long, and that you can start wherever you want by choosing an initial state. But you don't know where in the sequence a given state will bring you.

As far as I know (beware: I am not an expert) only multiplicative linear congruential random number generators allow you to compute seeds producing multiple sequences of given length which are guaranteed not to overlap.


I see your point. Luckily for me, it is only important that sequences are not identical. They can overlap because different parts of the sequence will be playing completely different roles in data generation.

I think the use of consecutive integers is a good easy way to go in my current project of only 100 replicates, but I think I'm going to use the full 624-integer seeds anyway, just to seem extra cautious and complete.

Thinking about it a little more - the entire pseudorandom sequence has a length of about 4*10^6001, so if you are making numerous sequences of length 10^9 say, the probability that two or more are overlapping is always extremely small (assuming that the starting point in the sequence is always selected at random from all possible starting points).

Mike



-------------------------------------------------------------
Octave is freely available under the terms of the GNU GPL.

Octave's home on the web:  http://www.octave.org
How to fund new projects:  http://www.octave.org/funding.html
Subscription information:  http://www.octave.org/archive.html
-------------------------------------------------------------



reply via email to

[Prev in Thread] Current Thread [Next in Thread]