Looping Over Parameters - Problem in Steady State File

I am trying to loop over parameter a value. I tried following this post, but it does not seem to work: Loop over parameters

I am trying to loop over ‘h’ paramtere in NK_Baseline.mod as an example, but I get the error message:

Here is the outside loop I am calling:

[code]params = 0:0.05:0.95;
for lpPar=1:length(params)

    dynare NK_baseline noclearall;  



Somehow it does not seem to recognize the value assignment I do when calling set_param_value (although I am able to call this function just fine).


That’s because the call to

dynare NK_baseline
will overwrite the initial statement setting h. That’s why the post you refer to only calls resol/stoch_simul within the loop, but not full Dynare.

Is there anyway to work around that? Should I call the loop from inside dynare mod file?

Please provide the files

I am working on posting some sample files, but if I just need to simulate new data with new parameter values, all I need is to follow the post I referred to? I am asking this because I wondering if just calling stoch_simul again with the new paramter would calculate the steady states again, since the changing parameters could potentiall y affect steady state.

Yes, stoch_simul will recalculate the steady state (as does resol.m)

Great thanks. Managed to work around it.