Quick question about simulation

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.

Quick question about simulation

Postby macroresearch123 » Mon Dec 23, 2013 5:07 pm

Hi,

My model is working properly (thankfully), albeit with a simplification relative to my initial hopes, but my next objective is to see how well the model predictions matche observed empirical regularities. How would I do this? While the share of labor is normalized to one so that the steady state prediction can be readily compared to the real world, what about other model variables, such as consumption and capital? Put more compactly, how can I simulate an economy starting at some given time period with the given corresponding variable values and see how it evolves for some T years?

I have checked extensively online, but I cannot find any other documentation other than the stoch_simul command that I am already using. (Code attached)

Thank you as always for your insight and time!
Attachments
benchmarkcb.mod
(1.4 KiB) Downloaded 62 times
macroresearch123
 
Posts: 90
Joined: Wed Nov 06, 2013 3:28 pm

Re: Quick question about simulation

Postby jpfeifer » Fri Dec 27, 2013 10:43 am

Normally, you would compare business cycle moments to the ones in the data. This can be done by using the theoretical moments based on the state-space representation. If you want to simulate a time series, you can use the simult_ - command. An example can be found at https://sites.google.com/site/pfeiferecon/RBC_news_shock_model.mod?attredirects=0
------------
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: Quick question about simulation

Postby macroresearch123 » Sat Dec 28, 2013 1:53 am

Hi Johannes,

This is very helpful. Is there further documentation on the use of "simult"? What you built in your file is great, but there are some terms that I am unfamiliar with. In particular, where in the following code do you call for the specific endogenous variable you want to simulate? I was looking in the "y2=simult_" command, but that just looks like you're simulating all variables. Regarding the shock matrix that you created, we would just rename that with whatever name our specific shock has, i.e. "eps", and then remove the second "surprise" shock?


--
initial_condition_states = repmat(oo_.dr.ys,1,M_.maximum_lag);
shock_matrix = zeros(options_.irf,M_.exo_nbr); %create shock matrix with number of time periods in colums

// set shocks for pure news
shock_matrix(1,strmatch('eps_z_news',M_.exo_names,'exact')) = 1; %set news shock to 1 (use any shock size you want)
shock_matrix(1+8,strmatch('eps_z_surprise',M_.exo_names,'exact')) = -1; %8 periods later use counteracting shock of -1

y2 = simult_(initial_condition_states,oo_.dr,shock_matrix,1);
y_IRF = y2(:,M_.maximum_lag+1:end)-repmat(oo_.dr.ys,1,options_.irf); %deviation from steady state

// manually select variables for figure
figure
subplot(2,1,1)
plot(y_IRF(strmatch('y',M_.endo_names,'exact'),:)); % use strmatch to select values
title('Output');
subplot(2,1,2)
plot(y_IRF(strmatch('z',M_.endo_names,'exact'),:));
title('TFP');
macroresearch123
 
Posts: 90
Joined: Wed Nov 06, 2013 3:28 pm

Re: Quick question about simulation

Postby jpfeifer » Sun Dec 29, 2013 8:04 am

No, there is no further documentation yet apart from the information in the header

You have to simulate all variables when using simult_. There is currently no other way. The y_IRF(strmatch('y',M_.endo_names,'exact'),:) then selects e.g. the variable named 'y' for the plot.

You can specify the shock matrix anyway you want. The procedure you describe would be correct.
------------
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: Google [Bot] and 5 guests