mode_compute=6

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.

mode_compute=6

Postby George » Fri Apr 16, 2010 12:46 pm

Dear all,

You may have noticed that using the posterior mode optimization routine mode_compute=6 seems to produce different mode parameter estimates every time it is run.

Is anyone aware of what should be changed in Dynare in order to ensure that mode_compute=6 produces mode values which are replicable?

Thank you very much in advance for any feedback ot comment on this issue!

George
George
 
Posts: 25
Joined: Thu Aug 14, 2008 11:36 am

Re: mode_compute=6

Postby jpfeifer » Fri Apr 16, 2010 2:16 pm

As mode_compute=6 is based on Monte Carlo methods and thus involves drawing random numbers, you would have to fix the seed of the random number generator in Matlab, I guess.
------------
Johannes Pfeifer
University of Cologne
https://sites.google.com/site/pfeiferecon/
jpfeifer
 
Posts: 6940
Joined: Sun Feb 21, 2010 4:02 pm
Location: Cologne, Germany

Re: mode_compute=6

Postby George » Fri Apr 16, 2010 3:46 pm

Thanks a lot for your reply. Do you know exactly where in the Dynare files one should fix the seed?
And more generally, is it not a huge drawback of mode_compute=6 if its results depend so crucially on the particular random nature of the Monte Carlo draws?

Thanks in advance!
George
 
Posts: 25
Joined: Thu Aug 14, 2008 11:36 am

Re: mode_compute=6

Postby jpfeifer » Sat Apr 17, 2010 8:14 am

Hi,

try putting

Code: Select all
s = RandStream('mt19937ar','seed',1);
RandStream.setDefaultStream(s);


before the estimation command. This should set the seed to 1.

I am no expert on this issue, but I do not really see a need to fix the seed. The mode_compute=6 algorithm works like the Metropolis-Hastings algorithm used in Bayesian estimation. Everytime you run the Random Walk Metropolis-Hastings algorithm with not exactly the same seed you will get different results for your posterior as the draws from the prior distribution will differ. However, irregardless of the starting values and the seed of the random number generator, the estimation should converge to the true posterior with the correct mode. Hence, mode_compute=6 should give you approximately the same results every time you run it. If it does not, the estimation may not have converged to the mode yet.
------------
Johannes Pfeifer
University of Cologne
https://sites.google.com/site/pfeiferecon/
jpfeifer
 
Posts: 6940
Joined: Sun Feb 21, 2010 4:02 pm
Location: Cologne, Germany

Re: mode_compute=6

Postby p.gelain » Sun Apr 18, 2010 7:25 pm

I guess that if you set a reasonably high number of iterations your modes should not be too different.

Paolo
p.gelain
 
Posts: 61
Joined: Wed Jul 11, 2007 9:13 pm
Location: Norges Bank

Re: mode_compute=6

Postby George » Mon Apr 19, 2010 6:45 am

Do you actually refer to the number of draws in the Metropolis-Hastings? I am asking because as far as I can see one is not really able to control "iterations" during the mode_compute=6 mode optimization stage. Correct me if I have misunderstood.
George
 
Posts: 25
Joined: Thu Aug 14, 2008 11:36 am

Re: mode_compute=6

Postby p.gelain » Mon Apr 19, 2010 9:04 am

I refer to the iteration of the optimization procedure. You can set them with the following command putting it right before the estimation one

options_.Opt6Numb= NUMBER OF ITERATIONS;

Paolo
p.gelain
 
Posts: 61
Joined: Wed Jul 11, 2007 9:13 pm
Location: Norges Bank

Re: mode_compute=6

Postby George » Mon Apr 19, 2010 9:47 am

Dear Paolo,

Thanks a lot for this. Just two additional clarification questions:
1. Does this refer to the number of iterations in the "climbing the hill" stage of the mode optimization?
2. What is the default value of this option? I was trying to find it to have some reference but was not successful in doing so.

Thanks in advance!
George
 
Posts: 25
Joined: Thu Aug 14, 2008 11:36 am

Re: mode_compute=6

Postby p.gelain » Mon Apr 19, 2010 9:55 am

Yes, it refers to the "climbing the hill".
You can find all the relevant info here

http://www.dynare.org/DynareWiki/MonteCarloOptimization

Paolo
p.gelain
 
Posts: 61
Joined: Wed Jul 11, 2007 9:13 pm
Location: Norges Bank

Re: mode_compute=6

Postby George » Mon Apr 19, 2010 7:10 pm

Hi Paolo,

I tried your suggestion and my experience shows that this option controls the number of iterations in the "Looking for the posterior covariance" stage while "Climbing the hil" (which is supposed to be the optimization stage) seems unaffected. Is this in your opinion a step towards making the modes come closer to each other in different estimation rounds?
George
 
Posts: 25
Joined: Thu Aug 14, 2008 11:36 am

Re: mode_compute=6

Postby p.gelain » Mon Apr 19, 2010 7:42 pm

I am sorry George, I misunderstood you previous question. You are right, the options_.Opt6Numb= ...; command controls the "Looking for the posterior covariance". Anyway, to go back to your original problem, as it is explained also in DynareWiki, this is not an optimization procedure. This routine just helps you to find a good starting point for the MH algorithm (the one for the parameters posterior distributions) and a good covariance matrix for the jumping distribution. That’s it.
To be honest I have never checked if modes change every time you run the routine. I will try and I will let you know.

Paolo
p.gelain
 
Posts: 61
Joined: Wed Jul 11, 2007 9:13 pm
Location: Norges Bank

Re: mode_compute=6

Postby George » Tue Apr 20, 2010 8:00 am

Hi Paolo,

That will definitely be appreciated! What is most interesting for me is if mode_compute=6 can be forced to produce the same (or at least very similar) posterior modes which then are used to initialize the MH and how this can be achieved.

George
George
 
Posts: 25
Joined: Thu Aug 14, 2008 11:36 am

Re: mode_compute=6

Postby p.gelain » Tue Apr 20, 2010 10:55 am

Dear George

I tried and it gives exactly the same modes (up to the last decimal digit) for all the parameters.
Anyway, also the Sims algorithm is stochastic when it perturbs the search direction. So if you try with that you should encounter the same problem, namely ending up with different modes every time. If that is the case it may mean that your priors may be not that nice, because the set of parameters drawn along the iterations give to much cliffs (their values provide wither an indeterminacy or non--equilibrium solution). So you may want to try to redefine your priors in order to constraint the domain of your parameters more properly.

Paolo
p.gelain
 
Posts: 61
Joined: Wed Jul 11, 2007 9:13 pm
Location: Norges Bank


Return to Dynare help

Who is online

Users browsing this forum: No registered users and 8 guests