setting 'seed' for replicating estimation results

This forum is closed. You can read the posts but cannot write. We have migrated the forum to a new location where you will have to reset your password.
Forum rules
This forum is closed. You can read the posts but cannot write. We have migrated the forum to a new location (https://forum.dynare.org) where you will have to reset your password.

setting 'seed' for replicating estimation results

Postby danielleigh76 » Mon Mar 30, 2009 7:26 pm

Each time I run my estimation .mod file, I get slightly different results even though I do not change any of the code, and I was wondering if there's some way of ensuring that I always get the same results. For example, is there a way of setting a "seed" as part of the estimation command? So far, I found that DYNARE has a function called "simul_seed," but that doesn't seem to apply to estimation (only to simulation). I also found that increasing mh_replic doesn't solve the problem. The command I am using is:

estimation(datafile=datapullcggjpn,conf_sig=.95,filtered_vars,smoother,first_obs=1,nobs=66,mode_check,mode_compute=1,mh_replic=1000,mh_jscale=0.5,mh_nblocks=1) piestar rstar;

Thanks in advance for any help!

Daniel
danielleigh76
 
Posts: 5
Joined: Mon Mar 30, 2009 7:13 pm

Re: setting 'seed' for replicating estimation results

Postby StephaneAdjemian » Tue Mar 31, 2009 7:17 am

Hi Daniel,

You can set the seed using matlab functions, just before the estimation command. You need to set a seed for the uniform random number generator and another for the gaussian random number generator (the seeds are different, look at the matlab documentation).

Best, Stéphane.
Stéphane Adjemian
Université du Maine, GAINS and DynareTeam
https://stepan.adjemian.eu
StephaneAdjemian
 
Posts: 429
Joined: Wed Jan 05, 2005 4:24 pm
Location: Paris, France.

Re: setting 'seed' for replicating estimation results

Postby danielleigh76 » Tue Mar 31, 2009 9:10 pm

Thanks! It worked, I put the following in front of the estimation command:

rand('seed',122); randn('seed',123);
danielleigh76
 
Posts: 5
Joined: Mon Mar 30, 2009 7:13 pm


Return to Dynare help

Who is online

Users browsing this forum: Google [Bot] and 11 guests