# Which subroutine generates ghx and ghu?

**URL:** <https://forum.dynare.org/t/which-subroutine-generates-ghx-and-ghu/5577>\
**Category:** Dynare help (legacy posts)\
**Created:** [12 June 2016 05:26 UTC](https://forum.dynare.org/t/which-subroutine-generates-ghx-and-ghu/5577 "2016-06-12T05:26:31Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![jpfeifer](https://forum.dynare.org/user_avatar/forum.dynare.org/jpfeifer/32/5044_2.png) [@jpfeifer](https://forum.dynare.org/u/jpfeifer)\
**Post date:** [12 June 2016 14:55 UTC](https://forum.dynare.org/t/which-subroutine-generates-ghx-and-ghu/5577/2 "2016-06-12T14:55:34Z")

</div>

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]%% 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  
[/code]

See also [[Loop over parameters](https://forum.dynare.org/t/loop-over-parameters/3335/1))

---

_[View the full topic](https://forum.dynare.org/t/which-subroutine-generates-ghx-and-ghu/5577)._
