Page 1 of 1

Properties of the transition function and oo_.dr.Gy

PostPosted: Wed Oct 05, 2016 7:54 am
by piya_uci
I am working towards interpreting the stability properties of the transition function and wanted to confirm what is the output that is stored as oo_.dr.Gy? Also, is there a way to recover, the transition function from the output of the model obtained using the stoch_simul option? It would be great if you could please help me out with this.

Re: Properties of the transition function and oo_.dr.Gy

PostPosted: Wed Oct 05, 2016 8:39 am
by jpfeifer
What do you mean with transition function? Are you looking for the quadratic matrix mapping states today into states tomorrow?

Re: Properties of the transition function and oo_.dr.Gy

PostPosted: Wed Oct 05, 2016 3:16 pm
by piya_uci
Hi Johannes,

Yes. The solution that dynare provides on using the stoch_simul option as policy and transition functions is the nxm dimensional matrix (where m is the number of endogenous variables and n is the number of state variables in the model). I wanted to recover the nxn dimensional matrix that gives me the mapping of states today into states tomorrow.

Thank you for your help.

Re: Properties of the transition function and oo_.dr.Gy

PostPosted: Wed Oct 05, 2016 4:20 pm
by jpfeifer
Please have a look at https://github.com/JohannesPfeifer/DSGE_mod/tree/master/FV_et_al_2007 and the included ABCD_test.m.
Essentially, you need
Code: Select all
%get state indices
ipred = M_.nstatic+(1:M_.nspred)';
%get state transition matrices
[A,B] = kalman_transition_matrix(oo_.dr,ipred,1:M_.nspred,M_.exo_nbr);

Re: Properties of the transition function and oo_.dr.Gy

PostPosted: Wed Oct 05, 2016 6:51 pm
by piya_uci
Hi Johannes,

Thank you for sharing this. I am trying to work through the code you had shared. The code requires me to specify the following:

%get observable position in decision rules
obs_var=oo_.dr.inv_order_var(options_.varobs_id);

Unfortunately, I am not able to recover, varobs_id from the output files that are generated from running dynare. It would be great if you could please help me out with this.

Many thanks for your help.

Re: Properties of the transition function and oo_.dr.Gy

PostPosted: Wed Oct 05, 2016 7:13 pm
by jpfeifer
You only need the first part. You don't have observables. The part I pasted into the post is what you need. It will give you the state transition equation. What you are looking at is the observation equation mapping states into observables. For that to work, you need to have a
Code: Select all
varobs

statement in your model.

Re: Properties of the transition function and oo_.dr.Gy

PostPosted: Wed Oct 05, 2016 7:36 pm
by piya_uci
Hi Johannes,

Thank you for pointing this out. It turns out that the eigenvalues of the matrix A from:

[A,B] = kalman_transition_matrix(oo_.dr,ipred,1:M_.nspred,M_.exo_nbr);

is same as the output stored in oo_.dr.Gy.

This was very helpful.

Re: Properties of the transition function and oo_.dr.Gy

PostPosted: Wed Oct 05, 2016 8:58 pm
by jpfeifer
Indeed. I just saw that in
Code: Select all
dyn_first_order_solver.m
the last lines are
Code: Select all
%predetermined (endogenous state) variables, square transition matrix
dr.Gy = hx;