Replication of sensitivity check

Hi everyone,

I am trying to repeat some sensitivity checks for many possible values of parameters in my calibration.

Now, I am manually doing that taking quite a long time. Could anyone give me a tip so that in this DYNARE I can practice something like DO LOOP in GAUSS code?

Always thanks in advance

Song from Korea

See [Loop over parameters)

Hi everyone,

Bt only modifying the mod file name for my own, I wrote the following M.file in the below.
rho_a is structural parameter that indicates the AR(1) parameter for tech. shock in my mod file.

rhos = 0.8:0.05:1.05;
first_time = 1;
for i=1:length(rhos)
if first_time
dynare RS_A2.mod noclearall;
first_time = 0;
info = stoch_simul(irf);
if info;
disp('Computation fails for rho = ’ num2str(rho_a)]);

The error message in Korean contains

"set_param_value (line 22)
i = strmatch(pname,M_.param_names,‘exact’); "

What is wrong with my M.file?

Please provide the full files.

Sorry for my late reply.

My mod file and m files are attached to this post.

RS_A2.mod (8.13 KB)

sensit.m (386 Bytes)

Many thanks to you for your kind help.

Song from Korea

You cannot use

if first_time set_param_value('rho_a',rhos(i)); dynare RS_A2.mod noclearall;
as you are trying to set rho_a before you run Dynare for the first time where rho_a is then finally defined. Use the mod-file itself to set the first value.

Dear Prof. Pfeifer,

As you suggested, I have run my dynare mod file, RS_A2.mod first and then have executed the sensit.m file.

But, it seemed to me that RS_A2.mod has been run only one time, not the number of rhos vector, that is, 3.

Song from Korea

Your second call to stoch_simul is wrong and should be

info = stoch_simul(var_list_);
Moreover, you are not saving any results.