Page 1 of 1

Which subroutine generates ghx and ghu?

PostPosted: Sun Jun 12, 2016 5:26 am
by Nick
Hi, How can I generate decision-rule matrix (ghx and ghu) by giving a set of parameters (My model is linear)?
Since I'd like to make it in a loop, it is convenient for me to use a subroutine that takes parameters as input and generates ghx and ghu as outputs. In version 3, dr1.m could be used on this purpose but I am now using version 4.3.3...
Any advice would be appreciated.

Re: Which subroutine generates ghx and ghu?

PostPosted: Sun Jun 12, 2016 2:55 pm
by jpfeifer
By iterating over set_param_value and resol.m. See e.g. the replication codes to Born/Pfeifer (2014): Risk matters: Comment at the AER. In smm_diff_function.m, we loop over something like this:
Code: Select all
%% set parameter for use in Dynare
set_param_value('sigma_x',xopt(1)); % TFP volatility

[oo_.dr,info,M_,options_,oo_] = resol(0,M_,options_,oo_); %run model solution in Dynare

if info %solution was not successful
    fval=Inf; %return with penalty
else
    % compute what you want here 
end


See also http://www.dynare.org/phpBB3/viewtopic.php?f=1&t=4891

Re: Which subroutine generates ghx and ghu?

PostPosted: Mon Jun 13, 2016 6:36 am
by Nick
Johannes, I appreciate your support! It is really valuable.