Dear all,

 

I agree with Marco and would prefer setting a different but reproducible seed.

 

Best,

 

Johannes

--------

Johannes Pfeifer

Haußerstr. 29

72076 Tübingen

Tel.: +49-(0)7071-6396184

Mobil: +49-(0)170-6936820

jpfeifer@gmx.de

 

Von: dev-bounces@dynare.org [mailto:dev-bounces@dynare.org] Im Auftrag von Marco Ratto
Gesendet: Mittwoch, 29. August 2012 09:58
An: dev@dynare.org
Betreff: Re: [DynareDev] random seeds in metropolis

 

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
  



-- 
Marco Ratto,
Joint Research Centre
The European Commission,
TP 361, 21027 ISPRA(VA), ITALY
Tel: +39 0332 78 9217
Fax: +39 0332 78 5733
marco.ratto@jrc.ec.europa.eu