I would like to simulate a deterministic shock from values which are not a steady state.
First, I launch a simulation from a steady state to an other.
- Code: Select all
initval;
@#include "steady_state1.mod"
end;
steady;
endval;
@#include "steady_state2.mod"
end;
steady;
simul(periods=400);
Where "steady_state1.mod" and "steady_state2.mod" are the two steady state saved from a program which calculate an approximate steady state.
Then, I extract values which are not steady state from the path in the vector "path1" and I try to save an other .mod (steady_state_TEST.mod) file like this:
- Code: Select all
list_var = cellstr(M_.endo_names);
fid = fopen('steady_state_TEST.mod', 'w');
for i=1:length(list_var)
fprintf(fid, '%s = %.16g;\n',list_var{i}, path1(i));
end
list_var_exo = cellstr(M_.exo_names);
for i=1:length(list_var_exo)
fprintf(fid, '%s = %.16g;\n',list_var_exo{i}, oo_.exo_steady_state(i));
end
fclose(fid);
But the program does not execute fid, loops for...etc
And finally, I would like to launch an other simulation with "steady_state_TEST.mod" in initval and a steady state in endval.
But, since the program does not execute fid..etc it does not find steady_state_TEST.mod.
Is there anyone who can help me?
Perhap's my problem comes from loops "for"?
Best Regards.
L.