How to store the constant term in policy and transition func

Hi all,

I want to run a loop in my mod file and for certain parameters in my model I want to be able to save the constant term in the policy and transition output of the variable of interest. I do a second order approximation to the welfare in my model and every time I run the dynare it gives me the policy and transition functions output in the command window. Since I want to save this each time I run my mod file, I am wondering where the following output is stored in dynare.

Constant 42.708791
(correction) 0.097825
dg (-1) 0.045723
dgm (-1) 0.312067
DM (-1) 0.189854
pm (-1) -0.141491
zf (-1) -15.838252
zm (-1) -8.021038
epsf -16.671844
epsm -8.443198
DM (-1),dg (-1) -0.010713
DM (-1),dgm (-1) 0.145147
DM (-1),DM (-1) 0.040526
pm (-1),dg (-1) 1.010847
pm (-1),DM (-1) 0.546090
pm (-1),pm (-1) 10.073796
zf (-1),epsf 17.377550
zf (-1),epsm -8.389466
zm (-1),epsf -8.389466
zm (-1),epsm 4.288687

I looked into forum, I found the coefficients of policy and transition functions are stored in dr_.ghx and dr_.ghu in dynaver v3. I only need the constant term and it is neither in dr_.ghx nor dr.ghu. I am using dynare v3.

I greatly appreciate any help you may suggest.


Hi all,

I know that oo_.dr.ghx gives the coefficients of the policy and transition functions for the model variables. But this matrix does not provide the constant given in the dynare policy and transition functions output. If the output includes this constant term it should be stored in somewhere in dynare, right?
I desperately need to find where this is stored becuase I am supposed to do a loop on some of the parameters.

Any help is greatly appreciated.


See the part “Second order approximation” on:

So the correction is oo_.dr.ghs2 divided by 2 (since oo_.dr.ghs2 corresponds to the square of delta). Also note that the line “Constant” in the “Policy and transition function” displayed by stoch_simul is equal to the steady state + the correction.


Thank you very much Sebastien.
This helps a lot.

This sounds great. I would like to create a serie of y, put in an index form, like base=100, and compare with the real GDP. Knowing where the coefficients of policy function is essential to do that. Someone know how the best way to do that? By Matlab or Dynare? And how would be?


You need to be more explicit. Is y a model variable? If yes, use the simult_ function to generate the data within a loop. For looping, see [Loop over parameters)