Quick question, I am using the following adjusted code from above:
OMEGARS = 1:1:5; %specifies the different values I want to loop over
first_time = 1;
for i = 1:length(OMEGARS)
if first_time
dynare mymodfile noclearall;
first_time = 0;
else
set_param_value('OMEGAR',OMEGARS(i));
info = stoch_simul(M_, options_, oo_, var_list_);
%results_cell{i} = oo_ ;
plot(oo_.irfs.variable_eps_j);
hold on;
%disp('I am plotting');
end
if info
disp(['Computation fails for OMEGAR = ' num2str(OMEGARS)]);
end
end
Inside the mod file I call the ‘load parameter_file’ where all parameters are set, including the parameter of interest OMEGAR. The mod file also contains the steady state which was derived by hand. As OMEGAR changes, the steady state changes but this doesn’t seem to be a problem when we loop over stoch_simul.
So, here is the problem. When I loop over dynare (which we shouldn’t do), I get different irfs for the different OMEGARs. However, when I use the code in the m.file above, it seems the irfs get overwritten as I end up with five times the same values. Has anyone got an idea what I am doing wrong? Thanks for your help!
For Dynare 5, you forgot to output the results from stoch_simul:
clear all;
OMEGARS = 1:1:5;
first_time = 1;
for i = 1:length(OMEGARS)
if first_time
dynare rentalhousing noclearall;
first_time = 0;
else
set_param_value('OMEGAR',OMEGARS(i));
[info, oo_] = stoch_simul(M_, options_, oo_, var_list_);
if info
disp(['Computation fails for rho = ' num2str(OMEGARS)]);
else
%results_cell{i} = oo_ ;
plot(oo_.irfs.data_QQ_eps_j);
hold on;
disp('I am plotting');
oo_.irfs.data_QQ_eps_j
end
end
end
Sorry to reopen this thread, but I have a very similar problem which I believe is the result of a stupid mistake I am making, but that I cannot manage to solve it.
I am trying to loop multiple parameters in my model to conduct sensitivity analysis. As in the case above, changes in the parameters will affect the steady state. I am stuck with the no steady state error:
Error using [print_info](matlab:matlab.lang.internal.introspective.errorDocCallback(‘print_info’, ‘/Applications/Dynare/6.2-arm64/matlab/print_info.m’, 33)) ([line 33](matlab: opentoline(‘/Applications/Dynare/6.2-arm64/matlab/print_info.m’,33,0)))
The steadystate file did not compute the steady state
I am sure the model reaches the steady state with all values of taur in the sequence, but it seems that the steady state does not update when taur changes.
I am attaching both the Matlab function and the .mod file (in which the problem most likely lies). Could you please clarify what I am getting wrong and how to solve this?