Random generator in Dynare
We have two problems with random generators: 1) catched by Marco: we used the same seed for the random numbers of each Metropolis chain (easy to fix) 2) the calls to rand('state',...) in various part of the code, inadvertently forces back the random generator of Matlab to the oldest random generator mechanims: legacy random stream (current global stream) RAND algorithm: V5 (Subtract-with-Borrow), RANDN algorithm: V5 (Ziggurat) I will write functions get_dynare_random_generator_state() and set_dynare_random_generator_state() that controls for the random generator algorithm as in set_dynare_seed() and use them wherever there is currently rand('state',...) I think that we should consider the current state as a bug and port back the changes in 4.3. Tell me if you disagree. Older versions of Matlab kept a different number generator for uniform numbers and for normally distributed numbers. Now there is a single generator of uniform numbers and all other generators are based on it. For the older versions, it will be necessary to keep two separate states. Best Michel
Michel Juillard <michel.juillard@mjui.fr> writes:
I think that we should consider the current state as a bug and port back the changes in 4.3. Tell me if you disagree.
I agree. Also, please don't forget Octave in the refactoring process. -- Sébastien Villemot Researcher in Economics http://www.dynare.org/sebastien Phone: +33-1-40-77-84-04
On 08/29/2012 02:22 PM, Sébastien Villemot wrote:
Michel Juillard<michel.juillard@mjui.fr> writes:
I think that we should consider the current state as a bug and port back the changes in 4.3. Tell me if you disagree. I agree.
Also, please don't forget Octave in the refactoring process. Sure. My understanding is that Octave uses the old Matlab interface with a rangom generator equivalent to Matlab's current default, but I will check.
Best Michel
_______________________________________________ Dev mailing list Dev@dynare.org https://www.dynare.org/cgi-bin/mailman/listinfo/dev
participants (2)
-
Michel Juillard -
Sébastien Villemot