Figure loop parameters

Hello,

I want to plot IRF of different parameter values in the same figure. In my loop file, beta takes four different values and I would like to show the IRF of “sdf_eR” for four different beta values. Currently, it only shows the same IRF for four times.

The main problem is that in .mod file “set_param_value(‘beta’,beta);” while it is “set_param_value(‘beta’,betas(i));” in the .m file. So I think it is just taking the initial beta value rather than looping over.
I have attached .m and .mod file that includes loop.iac.m (1.2 KB) iacov.mod (3.0 KB)

Can anyone tell me where I made a mistake?
Thanks.

What you are doing is not a proper loop. The full call to Dynare will override all settings in the m-file. See

Excuse me. I noticed the ‘var eR=1’ in the shock-block in the mod file. May I ask what it means to set ‘eR=1’ here.
Also, does the parameter sR in the mod file refer to the standard deviation of the shock.
I have just learned the DSGE model and hope for more guidance. Thank you!

The shocks block sets the variance of the shock eR to 1. The parameter sR then scales this shock, i.e. it is the standard deviation.

1 Like

Thank you for your answer and reply!