Taking averages of multiple dynare_simul runs?

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.

Taking averages of multiple dynare_simul runs?

Postby hewei2004 » Mon Apr 16, 2012 5:12 am

Hi,

Suppose I want to use dynare_simul() of the dynare++ package to simulate along a zero shock path in order to calculate some custom statistics such as correlation or some other non standard statistics, say the cube of correlation, of between two variables.

Everytime dynare_simul seems to give me different output, if I run dynare_simul multiple times ; sometimes the output is somewhat close to other runs , but sometimes the output are wildly different across runs.

Can I just take the average of the output of multiple runs of dynare_simul [across different simulation runs]? It seems the answer is no in a highly nonlinear system of equations with order=3

Or should I calculate the statistic first(eg. correlation), then average the correlation coefficient, instead of averaging the output path first then calculate the correlation between two averaged variables, say X and Y [whose output path has been averaged already across runs].
hewei2004
 
Posts: 40
Joined: Thu Feb 09, 2012 1:07 am

Re: Taking averages of multiple dynare_simul runs?

Postby kyri82 » Wed Apr 18, 2012 11:51 am

The second method is better, calculate a statistic for each simulation attempt. That would also give you standard errors of the statistics you are interested in (eg correlation).
It is normal that the variables differ in each attempt, that's the essense of simulation. However, they should not be hugely different. If you get large discrepancies often, check for possible mistakes.

Kyriacos
kyri82
 
Posts: 141
Joined: Thu Feb 10, 2011 6:14 pm
Location: Toulouse - France

Re: Taking averages of multiple dynare_simul runs?

Postby bkjecn » Wed Apr 18, 2012 2:03 pm

Kyriacos' suggestion makes sense to me. dynare_simul will give you a stochastic simulation, even when you specify zero shocks, so the results should not be the same. Some of this is explained in the help ('help dynare_simul'). Also, be careful that you don't get a path that is divergent. This can happen relatively easily in some models. There is a literature on 'pruning' that discusses this problem.
bkjecn
 
Posts: 35
Joined: Thu Oct 13, 2011 3:02 am

Re: Taking averages of multiple dynare_simul runs?

Postby hscbsc » Sun Apr 24, 2016 6:53 pm

Hi all,

I know this post is somewhat old, but I have a follow up question.

dynare_simul does stochastic simulations, but why it gives different results even when same shock series is provided ?

Thanks,
hscbsc
 
Posts: 25
Joined: Mon Jan 11, 2016 5:35 am

Re: Taking averages of multiple dynare_simul runs?

Postby jpfeifer » Mon Apr 25, 2016 8:32 am

I presume there is some simulated burnin phase, but this is hard to tell. In any case, if you dislike this feature, change the part
Code: Select all
% set seed
seed = ceil(10000*rand(1,1));

in dynare_simul.m
------------
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: Taking averages of multiple dynare_simul runs?

Postby hscbsc » Mon Apr 25, 2016 12:49 pm

Thank you !
hscbsc
 
Posts: 25
Joined: Mon Jan 11, 2016 5:35 am


Return to Dynare help

Who is online

Users browsing this forum: No registered users and 15 guests