help-octave
[Top][All Lists]
Advanced

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

Re: sampling from two instances of a random number generator


From: Leo Razoumov
Subject: Re: sampling from two instances of a random number generator
Date: Sun, 25 May 2008 14:32:01 -0400

On 5/25/08, Jaroslav Hajek <address@hidden> wrote:
>
> Yes, primarily it is a Matlab heritage. (Octave is FIRST open source,
>  THEN Matlab compatible, THEN object oriented :). Also, I think that
>  the underlying code in libcruft uses global states as well, so it
>  would have to be modified or replaced.
>
>  Why do you need a million of independent RNGs? Perhaps there is some
>  other way to solve the problem.

I need millions of samples, not millions of RNGs. Sorry, if my
language was not precise enough.

Relying on one global RNG state makes working with Octave (or Matlab
for this matter) very difficult for serious Monte Carlo simulations. A
single pseudo-random state completely breaks debugging and
verification in a dynamically control systems with non-trivial logic
by making simulation non-reproducible. For example, in this scenario
in a wireless network simulation random packet arrival, random channel
state, stochastic scheduler all draw samples from the same sequence
(same global RNG state). If I change my fading channel algorithm or my
scheduler, all of a sudden my packets are generated at different
instances. Verification/debugging becomes difficult and
non-deterministic due to lack of reproducibility.
To summarize, the processes that are independent in nature should not
be dependent in a simulation even if this dependence comes through
sharing a RNG state.

Additionally, single global RNG state does not play well with
multi-core processors so popular in modern hardware.

I understand that for the sake of backward compatibility existing
"rand" API has to be stable and cannot be changed. But how difficult
would it be to create an alternative RNG mechanism that properly
handles RNG state within RNG object?? Even "plain C" GSL handles RNG
states in a proper object oriented way.

--Leo--
AT&T Shannon Labs,
Florham Park, NJ, USA


reply via email to

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