Page 1 of 1

Taking averages of multiple dynare_simul runs?

PostPosted: Mon Apr 16, 2012 5:12 am
by hewei2004
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].

Re: Taking averages of multiple dynare_simul runs?

PostPosted: Wed Apr 18, 2012 11:51 am
by kyri82
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

Re: Taking averages of multiple dynare_simul runs?

PostPosted: Wed Apr 18, 2012 2:03 pm
by bkjecn
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.

Re: Taking averages of multiple dynare_simul runs?

PostPosted: Sun Apr 24, 2016 6:53 pm
by hscbsc
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,

Re: Taking averages of multiple dynare_simul runs?

PostPosted: Mon Apr 25, 2016 8:32 am
by jpfeifer
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

Re: Taking averages of multiple dynare_simul runs?

PostPosted: Mon Apr 25, 2016 12:49 pm
by hscbsc
Thank you !