Looping over parameter values and time horizons

Hi Everyone,

I am trying to loop over a (calibrated) parameter in the simulation (stoch_simul) of my model. I want to see impact on variables of interest by varying this parameter and over a few time horizons (for example, on impact, in the medium term and in the (very) long run, that is, t = 0, t = 40, t = 10000). So I want to run a loop over this parameter over 3 time horizons. I need to save and tabulate the results. Can you please advise how to do this? I looked at previous questions on looping over parameters but could not figure out how to do this over several time horizons and then save the results. Probably a second loop for different time horizons has to be added. Will appreciate any suggestion.

Which object are you trying to extract? IRFs? If yes, then simply set the maximum horizon, loop over the parameter and extract the three entries you are interested in.

1 Like

Thank you so much, @jpfeifer. Yes, I am trying to calculate IRFs. Can I kindly ask what is wrong with my parameter loop? I created a .m file for loop, as suggested by you on this forum and placed it in the same folder as my .mod file. I tried to run the .m file but it does not do anything. I must be making a mistake. Can you please advise? I attach the relevant files.
loop2.m (425 Bytes)
testmodel.mod (5.8 KB)
findsteady_RL.m (160 Bytes)

You are not handling parameter dependence correctly.