Page 1 of 1
Replication of sensitivity check
Posted:
Sun May 17, 2015 11:40 am
by songjeo1
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
Re: Replication of sensitivity check
Posted:
Sun May 17, 2015 4:49 pm
by jpfeifer
Re: Replication of sensitivity check
Posted:
Fri May 22, 2015 8:23 am
by songjeo1
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
set_param_value('rho_a',rhos(i));
dynare RS_A2.mod noclearall;
first_time = 0;
else
set_param_value('rho_a',rhos(i));
info = stoch_simul(irf);
if info;
disp(['Computation fails for rho = ' num2str(rho_a)]);
end;
end
end
=======================================
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?
Re: Replication of sensitivity check
Posted:
Sat May 23, 2015 1:36 pm
by jpfeifer
Please provide the full files.
Re: Replication of sensitivity check
Posted:
Mon May 25, 2015 1:29 am
by songjeo1
Sorry for my late reply.
My mod file and m files are attached to this post.
- RS_A2.mod
- This is my MOD file
- (8.13 KiB) Downloaded 37 times
- sensit.m
- This is the M.file
- (386 Bytes) Downloaded 39 times
Many thanks to you for your kind help.
Song from Korea
Re: Replication of sensitivity check
Posted:
Tue May 26, 2015 5:59 pm
by jpfeifer
You cannot use
- Code: Select all
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.
Re: Replication of sensitivity check
Posted:
Wed May 27, 2015 4:38 am
by songjeo1
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
Re: Replication of sensitivity check
Posted:
Wed May 27, 2015 4:26 pm
by jpfeifer
Your second call to stoch_simul is wrong and should be
- Code: Select all
info = stoch_simul(var_list_);
Moreover, you are not saving any results.