Hi Stephane,
indeed the initialization of the seed loops over the chains, but the problem there is that in the loop from 1 to nblocks, the command randn('state') rand('state')
always provide the same state (at least under R2009a and unless there is a difference between such version and more recent ones).
One strategy to set states in metropolis which keeps reproducibility (with which I agree with Michel), may be the following:
assume we take N replicas for npar estimated params, then the loop to initialize seeds may be modified as:
for b=1:nblocks, Seeds(b).Normal=randn('state'); tmp = randn(N, npar); Seeds(b).Uniform=rand('state'); tmp = rand(N, 1); end clear tmp
In this way, we would increase the state of the seeds by a fixed reproducible (and proper?) amount before initializing the seeds for the next block?
best Marco
On 8/29/2012 9:44 AM, Stéphane Adjemian wrote:
Hi Marco,
This is obviously a bug. If we have to set seeds in the metropolis (I am still not convinced by that but Michel is) we should have a seed specific to each chain.
Best, Stéphane.
On 29/08/2012 09:38, Marco Ratto wrote:
Dear All,
I am doing some work with metropolis and I noted that the seeds for parallel chains are initialized at the same status, so that the chains only differ by the first point, but the random sequences are the same: this implies that sequences for each parameter from different chains are correlated (just compare the values from different blocks stored in files _mhxx_blck1.mat _mhxx_blck2.mat). I am wandering if this is on purpose or this behavior is not desirable.
best Marco
Dev mailing list Dev@dynare.org https://www.dynare.org/cgi-bin/mailman/listinfo/dev