Deterministic simulation from "non steady-state" values

This forum is closed. You can read the posts but cannot write. We have migrated the forum to a new location where you will have to reset your password.
Forum rules
This forum is closed. You can read the posts but cannot write. We have migrated the forum to a new location (https://forum.dynare.org) where you will have to reset your password.

Deterministic simulation from "non steady-state" values

Postby ludog » Tue Dec 14, 2010 2:07 pm

Hi all,

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.
ludog
 
Posts: 17
Joined: Wed Nov 18, 2009 12:03 pm

Re: Deterministic simulation from "non steady-state" values

Postby SébastienVillemot » Tue Jan 11, 2011 11:20 am

You cannot do everything that you describe from within Dynare, but I think you can do it by alternating runs of Dynare and of MATLAB programs.

You can run Dynare for getting the first path, then run a MATLAB program which creates the steady_state_TEST.mod file, and then run Dynare a second time (on another MOD file which includes the steady_state_TEST.mod).
Sébastien Villemot
Economist at OFCE – Sciences Po
SébastienVillemot
 
Posts: 706
Joined: Fri Dec 07, 2007 2:29 pm
Location: Paris, France


Return to Dynare help

Who is online

Users browsing this forum: No registered users and 8 guests