Page 1 of 1

simulation

PostPosted: Wed May 14, 2008 10:37 am
by Hoyd
Dear Prof. Juillard,

Am wondering here what could be the possible reasons that Dynare does not give any results for simulation? I have attached the mod file...

Another thing is, does dynare allow "2 states for an economy in each period", which means within the same period there are some agents who make decisions before shock happens and some make decisions after the shock is realized?

Thanks in advance!

Re: simulation

PostPosted: Thu May 15, 2008 10:12 am
by StephaneAdjemian
Hi,

By defaults Dynare computes a second order approximation. At the end of your mod file you write:

Code: Select all
stoch_simul(periods=2100);


so Dynare tries to compute the simulated moments with a second order approximation. The problem is that the stochastic simulation is diverging in your case (because the size of the shocks is too important, it's a well known issue with stochastic simulation of order k approximations when k>1). Consequently the simulated moments given by Dynare are NaNs (I used dynare version 4). You should try to reduce the variance of eh and ef or to reduce the number of simulations. You may also implement the prunning algorithm advocated by Chris Sims (you will find a matlab implementation on the home page of Martin Uribe, or you can look at the following post). You can also compute theoretical moments instead of simulated moments by replacing the last line by :

Code: Select all
stoch_simul;


But the second order moments of the second order approximation will be identical to the second order moments associated to the first order approximation.


Best,
Stéphane.


Hoyd wrote:Dear Prof. Juillard,

Am wondering here what could be the possible reasons that Dynare does not give any results for simulation? I have attached the mod file...

Another thing is, does dynare allow "2 states for an economy in each period", which means within the same period there are some agents who make decisions before shock happens and some make decisions after the shock is realized?

Thanks in advance!