Simulated trajectory graphs

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.

Simulated trajectory graphs

Postby hoangkhieu » Sun Aug 23, 2015 11:44 pm

Hello,
I am currently working on a medium size DSGE model. When I use the rplot command I got trajectory graphs for endogenous variables, but I am not quite sure how to interpret the graphs. Can we compare the graphs with actual data to evaluate the performance of the model?
I also tried plotting policy functions with command
state_range=0.1:0.1:10;
state_name='k';
plot_var_name='c';
plot_dummy='1';
plot_policy_fun(state_name,state_range,plot_var_name,plot_dummy);
but got the error message
??? Error using ==> minus
Matrix dimensions must agree.
Error in ==> simult_ at 52
y_(:,1) = y_(:,1)-dr.ys;
Error in ==> plot_policy_fun at 84
temp=simult_(y0_temp,oo_.dr,shock_mat,options_.order);
Error in ==> simul at 279
plot_policy_fun(state_name,state_range,plot_var_name,plot_dummy);
Again, could you please show me how to interpret the policy function graphs?
I am looking forward to your reply.
Thank you
Hoang
Attachments
simul.mod
(3.29 KiB) Downloaded 97 times
hoangkhieu
 
Posts: 6
Joined: Sun Aug 23, 2015 11:20 pm

Re: Simulated trajectory graphs

Postby jpfeifer » Mon Aug 24, 2015 9:58 am

There is no real interpretation. They show a simulated trajectory following an abitrary sequence of shocks. There is no relation to actual data. What people typically do is compare the second moments of this artificial economy with stochastic shocks with the one from the data. If the model is close to the data, it should give similar moments.

Regarding the plot_policy_fun: use the updated version at https://github.com/JohannesPfeifer/DSGE_mod/tree/master/Caldara_et_al_2012 with
Code: Select all
state_range=0.1:0.1:10;
state_name='k';
plot_var_name='c';
plot_policy_fun(state_name,state_range,plot_var_name);
------------
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: Simulated trajectory graphs

Postby hoangkhieu » Mon Aug 24, 2015 10:29 am

Thanks. I used the updated file and provided code but still got this message
??? Input argument "plot_dummy" is undefined.

Error in ==> plot_policy_fun at 89
if plot_dummy

Error in ==> simul at 278
plot_policy_fun(state_name,state_range,plot_var_name);

Error in ==> dynare at 180
evalin('base',fname) ;

Could you please figure this out? Thank you
Hoang
hoangkhieu
 
Posts: 6
Joined: Sun Aug 23, 2015 11:20 pm

Re: Simulated trajectory graphs

Postby jpfeifer » Tue Aug 25, 2015 10:14 am

Did you adjust the call to the function as described? It should only take three input arguments.
------------
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: Simulated trajectory graphs

Postby hoangkhieu » Tue Aug 25, 2015 10:41 am

yes I did. But then I got the error message.
hoangkhieu
 
Posts: 6
Joined: Sun Aug 23, 2015 11:20 pm

Re: Simulated trajectory graphs

Postby jpfeifer » Wed Aug 26, 2015 3:20 pm

Then you must have done something wrong in replacing the function. Line 43 clearly sets plot_dummy when you have only 3 input arguments. Use
Code: Select all
which plot_policy_fun

to see which file is accessed and then check whether it is the updated one.
------------
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: Simulated trajectory graphs

Postby hoangkhieu » Fri Aug 28, 2015 12:01 am

I fixed the error. A further question: how to plot the policy function of one endogenous variable with all the other states? Thanks!
hoangkhieu
 
Posts: 6
Joined: Sun Aug 23, 2015 11:20 pm

Re: Simulated trajectory graphs

Postby jpfeifer » Fri Aug 28, 2015 7:51 am

What do you mean?
------------
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: Simulated trajectory graphs

Postby hoangkhieu » Fri Aug 28, 2015 9:30 am

sorry for the confusion. For example, c is a function of state variables k and a. we plotted c with k, and now I wonder how to plot c with k and a. does it make more sense now?
hoangkhieu
 
Posts: 6
Joined: Sun Aug 23, 2015 11:20 pm

Re: Simulated trajectory graphs

Postby jpfeifer » Sun Aug 30, 2015 2:28 pm

That is more complicated. You would have to follow the logic of the plot_policy_fun.m to generate a three dimensional graph.
------------
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: Simulated trajectory graphs

Postby hoangkhieu » Mon Aug 31, 2015 10:49 am

Thank you. I appreciate your help.
hoangkhieu
 
Posts: 6
Joined: Sun Aug 23, 2015 11:20 pm


Return to Dynare help

Who is online

Users browsing this forum: No registered users and 2 guests

cron