I am trying to simulate 1000 replications from a model that Dynare solved, each with 300 periods. Is there a more efficient way of doing this other than putting stoch_simul in a loop?

for count = 1 : 1000
YY(:,count) = Y;

I tried “replic” in stoch_simul but that didn’t work. What I have above works but it’s highly inefficient since it solve the model everytime even though the solution do not change.

Any help is appreciated.

I have the same problem. I am using Dynare 4.1.0.

The simulation commend doesn’t work : stoch_simul(hp_filter=1600, periods=200,replic=1000,print,nograph) y pi mc;

it gives me the following error:

??? Index exceeds matrix dimensions.

Error in ==> dyn2vec at 49

Error in ==> stoch_simul at 82

Error in ==> lagexp_RR_TL at 960
info = stoch_simul(var_list_);

Error in ==> dynare at 132
evalin(‘base’,fname) ;

Could anyone help me too?




Please post your MOD file. It’s impossible to help you debug this without that file.


Thanks for replying.

I think the problem lies in my model, which has a lot of dummies for expectations. When I specify “periods=***”, simulation commend can not generate sample moments. it maybe reveals a bug in the program.

P.S. my mode file and the steady state file

A reply to my original question is also appreciated (which is distinct from rockyyao’s problem).