Thank you so much for you reply.
jpfeifer wrote:That depends on how you compute the steady state. In principle, you can just change the first and last entry
of - Code: Select all
oo_.endo_simul
and then loop over
- Code: Select all
perfect_foresight_solver
As you point out, I think it depends on how to compute the steady state. My code is like the following. I should:
(1) loop over "perfect_foresight_solver" rather than "simul", and
(2) compute the steady-state for the initial and end point, and replace the initial and end value
of "oo_.endo_simul" by these new steady state values, before running "perfect_foresight_solver",
I am sorry to ask such a primitive question, but how do I compute the steady-state for both the initial point and the end point outside the mod-file? If I use "steady" after setting a new parameter value, it computes the steady state only at the end point.
Thank you in advance.
-------------- m-file --------------------
%% start iteration
% run dynare
dynare taxpolicy noclearall;
resit_tx = zeros(ntrial,1); % residual
for jj = 1:ntrial
load level0workspace
set_param_value('tau_rate',params_tr(jj));
simul;
resit_tx(jj) ...
= (y_data(mt,1)-oo_.endo_simul(1,mt)')'/(y_data_sd^2)...
*(y_data(mt,1)-oo_.endo_simul(1,mt)') ;
end
----------------------------------
---------- mod-file: taxpolicy.mod--------------
...
<model part>
...
initval;
z_x = 1.0 ;
end;
steady;
check;
endval;
z_x = 0.95 ;
end;
steady;
check;
shocks;
var z_x ;
periods 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 ;
values 1 0.997438621 0.994883803 0.992335529 0.989793782 0.987258545 0.984729802 0.982207536 0.97969173 0.977182369 0.974679434 0.972182911 0.969692783 0.967209032 0.964731643 0.9622606 0.959795886 0.957337486 0.954885382 0.952439558 0.95;
end;
simul(periods=1000);
evalin('base','save level0workspace oo_ M_ options_')
--------------------------------------------------------------------