Monte Carlo exercise

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.

Monte Carlo exercise

Postby James.c007 » Sat Aug 21, 2010 2:02 am

Hello,

I am using a simple 3 equation hybrid NK model and I want to simulate the model 10,000 times to obtain 10,000 sample of 500 observations of my endogenous variables. I am new to Dynare and has tried many things but I don't see to be able to figure out how to do this. I was wondering whether it is possible to do this within Dynare and how I would save the results of each loops?. My .mod file is attached. Thank you.
Attachments
nkm2.mod
(885 Bytes) Downloaded 143 times
James.c007
 
Posts: 2
Joined: Sat Aug 21, 2010 1:54 am

Re: Monte Carlo exercise

Postby jpfeifer » Sat Aug 21, 2010 7:08 am

Hi, you could do the following:
Code: Select all
for ii=1:10000
stoch_simul(order=1,replic = 50,drop=0,periods=500,irf=0,nomoments) y p r;
simseries{ii,1}=oo_.endo_simul;
simseries{ii,2}=oo_.exo_simul;
end
save simseries simseries;

Each row of the resulting cell array simseries contains in the first column the simulated series for the endogenous variablese and in the second column the exogenous variables. You could replace or add any other variables to the cell array.
------------
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


Return to Dynare help

Who is online

Users browsing this forum: No registered users and 5 guests