Dear Professor Pfeifer,
Thank you again for your kind and quick answer. It is helping me a lot.
I encountered another problem when trying loop over parameters using
- Code: Select all
info = stoch_simul(var_list_);
The following is how I conducted my dynare looping over parameters. When I run the following code, I got some error messages saying "Maxit has been reached" for some of parameter sets.
- Code: Select all
eval('S02_parameter_set');
save param_set.mat param_set;
for cases=1:144
load('param_set.mat');
if cases==1
param_for_dynare = param_set(cases,:)';
save param_mat.mat param_for_dynare;
dynare simul_final -DIRF=1 noclearall
else
param_for_dynare = param_set(cases,:)';
set_param_value('DZBar',param_for_dynare(1));
set_param_value('eta',param_for_dynare(2));
set_param_value('theta',param_for_dynare(3));
set_param_value('xi',param_for_dynare(4));
set_param_value('IES',param_for_dynare(5));
set_param_value('betatilde',param_for_dynare(6));
set_param_value('delta',param_for_dynare(7));
set_param_value('LMax',param_for_dynare(8));
set_param_value('Frisch',param_for_dynare(9));
set_param_value('CRRA',param_for_dynare(10));
set_param_value('taylrho',param_for_dynare(11));
set_param_value('taylpi',param_for_dynare(12));
set_param_value('tayly',param_for_dynare(13));
set_param_value('piBar',param_for_dynare(14));
set_param_value('rhoa',param_for_dynare(15));
set_param_value('rhog',param_for_dynare(16));
set_param_value('rhoinflavg',param_for_dynare(17));
set_param_value('rhoz',param_for_dynare(18));
set_param_value('rhopistar',param_for_dynare(19));
set_param_value('sigmaa',param_for_dynare(20));
set_param_value('sigmag',param_for_dynare(21));
set_param_value('sigmai',param_for_dynare(22));
set_param_value('sigmaz',param_for_dynare(23));
set_param_value('sigmapistar',param_for_dynare(24));
set_param_value('gssload',param_for_dynare(25));
set_param_value('zeta',param_for_dynare(26));
set_param_value('omegaG',param_for_dynare(27));
set_param_value('DoYss',param_for_dynare(28));
set_param_value('Gamma1',param_for_dynare(29));
set_param_value('Gamma2',param_for_dynare(30));
info = stoch_simul(var_list_);
if info;
str = ['Computation fails for Case ' num2str(cases)];
disp(str);
end;
end
end
What I cannot understand is, however, when I run dynare in each loop rather than just using
- Code: Select all
info = stoch_simul(var_list_);
command from the 2nd iteration and on, It doesn't give me any error message.
For example, case#144 gives "Maxit has been reached" from the code above. But, when I run
- Code: Select all
param_for_dynare = param_set(144,:)';
save param_mat.mat param_for_dynare;
dynare simul_final -DIRF=1 noclearall
It doesn't give me any error message.
Could you help me how should I understand this problem?
Attached are my mod file (which is replicating and sort of modifying Rudebusch and Swanson 2012), and sets of parameters (m.file)
Best,
Leo