Deterministic simulation sim1.m
Posted: Tue Feb 04, 2014 12:06 pm
Dear all,
I am trying to understand the simul command in dynare. In sim1.m there is the following code which I do not understand at all:
model_dynamic = str2func([M_.fname,'_dynamic']);
z = Y(find(lead_lag_incidence'));
[d1,jacobian] = model_dynamic(z,oo_.exo_simul, params, ...
steady_state,2);
The Y is the stacked vector of all variables (to be determined) at all times of the simulation. At that point it is Y=[Y0,Y1,Y1,...Y1]', thus the initial points and then the end points times the time of simulation.
The lead_lag_incidence determines the characteristc of each variable (backward looking, forward looking or present).
So far correct?
I do not understand what model_dynamic is (except that it is a function...but what does it do?).
I also do not understand the z variable since it stores values of initial steady states and future steady states.
Last but not least, I do not get the model_dynamic() and what it does. I tried
[d1,jacobian111] = model_dynamic(z,oo_.exo_simul, params, ...
steady_state,2)
AAA=model_dynamic(z,oo_.exo_simul, params, ...
steady_state,2)
[d2,jacobian1] = AAA
The first command works, for the second and third together I get "Too many output arguments."
Any help is very much appreciated!
Best
I am trying to understand the simul command in dynare. In sim1.m there is the following code which I do not understand at all:
model_dynamic = str2func([M_.fname,'_dynamic']);
z = Y(find(lead_lag_incidence'));
[d1,jacobian] = model_dynamic(z,oo_.exo_simul, params, ...
steady_state,2);
The Y is the stacked vector of all variables (to be determined) at all times of the simulation. At that point it is Y=[Y0,Y1,Y1,...Y1]', thus the initial points and then the end points times the time of simulation.
The lead_lag_incidence determines the characteristc of each variable (backward looking, forward looking or present).
So far correct?
I do not understand what model_dynamic is (except that it is a function...but what does it do?).
I also do not understand the z variable since it stores values of initial steady states and future steady states.
Last but not least, I do not get the model_dynamic() and what it does. I tried
[d1,jacobian111] = model_dynamic(z,oo_.exo_simul, params, ...
steady_state,2)
AAA=model_dynamic(z,oo_.exo_simul, params, ...
steady_state,2)
[d2,jacobian1] = AAA
The first command works, for the second and third together I get "Too many output arguments."
Any help is very much appreciated!
Best