Simulation using Policy functions

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.

Simulation using Policy functions

Postby lm280299 » Mon Nov 07, 2016 7:14 pm

Hi everyone,

I ask for the following help:

I attempted to understand how the second-order approximation worked in Dynare. I specified a value for periods, provided the initial value close enough to the steady state and typed "steady", so I generated a stochastic simulation starting from the steady state. Then I found the results of policy functions. Following the reference manual, I set down the following lines in Matlab:

periods=1000;
Variablenumber=24;
y_sim=zeros(Variablenumber,periods);
y_sim(:,1)=oo_.dr.ys+0.5*oo_.dr.ghs2+oo_.dr.ghx*zeros(5,1)+oo_.dr.ghu*oo_.exo_simul(1,:)'+0.5*oo_.dr.ghxx*zeros(25,1)+0.5*oo_.dr.ghuu*
kron(oo_.exo_simul(1,:)',oo_.exo_simul(1,:)')+oo_.dr.ghxu*kron(zeros(5,1),oo_.exo_simul(1,:)');

Here zeros(5,1) means that I have 5 endogeneous state variables and that the difference of them compared to the steady state is zero since I simulate from the steady state. But the result of the simulation in the first period differs from the simulation conducted by Dynare, which was correct. I wonder where I made a mistake.
lm280299
 
Posts: 25
Joined: Thu Feb 06, 2014 5:58 pm

Re: Simulation using Policy functions

Postby jpfeifer » Wed Nov 09, 2016 7:10 pm

I am not entirely sure what you are doing, but
1.)
Code: Select all
oo_.exo_simul
is supposed to be for perfect foresight simulations.
2.) There is a difference between the declaration order of oo_.dr.ys and the declaration order of the gh-matrices. See simult_.m for the way Dynare conducts simulations.
------------
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 7 guests