Query regarding stoch_simul

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.

Query regarding stoch_simul

Postby georam11 » Wed Apr 12, 2017 9:05 am

Dear Prof Pfeifer,

I have the following note extracted from a paper on simulation.

" The model is solved using third-order perturbations around the stochastic steady state in Dynare++ 4.4.3.The moments are computed using a simulation of 3,000 economies at quarterly frequency for 304 quarters, from which the first 80 quarters are not considered for the calculation of the moments (“burn in-period”)."

To comply with the above specification, I have given the following command in dynare file
stoch_simul(drop=80, order=3, periods=304) ;

My question is how do I specify the the simulation of 3000 economies in the stoch_simul command.

Many Thanks
Ammu
georam11
 
Posts: 13
Joined: Tue Jun 07, 2016 7:02 am

Re: Query regarding stoch_simul

Postby jpfeifer » Wed Apr 12, 2017 2:01 pm

In that case, the authors used Dynare++. You would need to use the
Code: Select all
dynare_simul.m

provided with Dynare++ and feed it 3,000 different shock sequences.

In case you are using Dynare, you can use the
Code: Select all
simul_replic

See https://github.com/JohannesPfeifer/DSGE_mod/tree/master/Hansen_1985 for an example
------------
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: Query regarding stoch_simul

Postby georam11 » Tue Apr 18, 2017 5:42 am

Dear Prof Pfeiffer,

In the Dynare guide, Simul _replics is given as "Number of series to simulate when empirical moments are requested (i.e. periods > 0). Note that if this option is greater than 1, the additional series will not be used for computing the empirical moments but will simply be saved in binary form to the file ‘FILENAME_simul’. Default: 1."

When I give stoch_simul(drop=80, simul_replic=3000, order=3, periods=304), the moments of the simulated variables are same as when I give stoch_simul(drop=80, order=3, periods=304) i.e. without the simul_replic.

Is it possible to get the moments which is inclusive of the 3000 economies?

Many Thanks
Ammu
georam11
 
Posts: 13
Joined: Tue Jun 07, 2016 7:02 am

Re: Query regarding stoch_simul

Postby jpfeifer » Tue Apr 18, 2017 7:19 pm

The computed moments are always only based on one replication. The
Code: Select all
simul_replic

replications are only stored (as documented in the manual). The linked file above shows you how to read in these simulations using the
Code: Select all
get_simul_replications.m

file
------------
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: Query regarding stoch_simul

Postby georam11 » Thu Apr 20, 2017 7:25 am

Hello Prof,

If I use dynare++ and simulate using "dynare_simul", i give the following command

% Simulate variables in 'ENDO_search.mod
Ts = 304;
shocks = zeros(1,Ts)./0;
Vdyn = dynare_simul('ENDO_search.mat',shocks);


But the statement in paper gives "The moments
are computed using a simulation of 3,000 economies at quarterly frequency
for 304 quarters, from which the first 80 quarters are not considered for the
calculation of the moments (‘‘burn in-period’’)."

How do i incorporate feeding 3000 different shock sequences to the above code and how do I include the burn in period as well? I am sorry but I cannot find any examples online on this one to replicate.

Many Thanks
Ammu
georam11
 
Posts: 13
Joined: Tue Jun 07, 2016 7:02 am

Re: Query regarding stoch_simul

Postby jpfeifer » Thu Apr 20, 2017 7:38 am

You need to loop over the above commands in Matlab with different shocks in each step. The burn-in just means you drop the first 80 periods of the result. Note that you are not properly drawing random shocks in your code. You need to use
Code: Select all
randn
------------
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 8 guests