If I may follow up from this post, I am actually doing the same as kipfilet. But I gotta get the impulse response functions from the newly resolved steady state.
Previously, when I executed the “dynare” command, I simply could use oo_.irfs in my m file. But now, I don’t know where the IRFs are stored after I run the command “[dr_,~,M_,~,oo_] = resol(0,M1_,options1_,oo1_);”.
May I know how I can plot the impulse response functions thereafter?
The parameters I want to loop over will change the steady state. Is there an efficient way to do this? Essentially I need to find a solution to the steady state each time I loop over the values of one parameter?
I am trying to loop over 3 parameters. Say, I want to get the simulated variance of output under different combinations of parameters. Just to illustrate, I used the NK_baseline.mod you wrote. In my code (dynare_loop.m), I looped over the Taylor rule parameters (gammmaR, gammmay, and gammmaPI) then stored the simulated variance in a mat file. For what I want to get, is my code correct? Thank you. dynare_loop.m (846 Bytes) NK_baseline_steadystate.m (3.85 KB) NK_baseline.mod (9.84 KB)
HI, everyone, I wonder if there is now a more convenient way to loop over parameters using dynare 4.5(unstable).
If there is , I am so honored if you let me know.
and I am learning about the code above, and have some questions?
first_time = 1;
for i=1:length(rhos)
if first_time
set_param_value(‘rho’,rhos(i));
dynare your_mod_file_here noclearall;
first_time = 0;
else
set_param_value(‘rho’,rhos(i));
info = stoch_simul(var_list_);
if info;
disp('Computation fails for rho = ’ num2str(rho)]);
end;
end
end
1, why should “info=1” be judged? so when info=1, the model is wrong?
2, " info = stoch_simul(var_list_);" Since the “var_list_” is sometime empty,how should I do?
info is the error code from stoch_simul. If info is not 0, the model could not be solved (for various possible reasons). It’s not necessarily the case that the model is wrong, but rather that the particular parameter draw in the loop is problematic.
var_list_
will typically be created by Dynare in the first run and you do not need to set it in this case. If in your application you need to set it manually, you should be able to set it to an empty character array
var_list_ = char();
That depends on what you want to save. To put the results from different runs into a cell array, you could add
I am simulating a very simple RBC model and would like to let the constant tax rate vary. I can do this manually by just resetting the paramter every time I run the code. However, is it possible to perform this automatically? Say, I want the tax rate to increase by 0.1 every time (from 0 to 0.5).
Can I do this in my mod-file or do I have to write a m-file?
This is an indicator to check whether you call the first iteration of the loop. In that case, you need to run Dynare once to initialize everything. Only after that happened, you can call set_param_value to change individual parameters.
This is the function call to stoch_simul that the Dynare preprocessor usually creates when you have a stoch_simul-command in your mod-file. Here, I call the function directly. info is the error code returned by stoch_simul. If it’s not 0, then there was a problem. var_list_ is a character array containing the variable names for which you requested moments etc (the ones listed after the stoch_simul-command in your mod-file). Usually, it is already defined from the first iteration of the loop when you called Dynare as a whole.