Changed the initialization of the persistent variables in perfect_foresight_simulation.
parent
83521c384f
commit
913ef20078
|
@ -86,6 +86,8 @@ verbose = 0;
|
|||
t = 0;
|
||||
new_draw = 1;
|
||||
|
||||
perfect_foresight_simulation([],[],[]);
|
||||
|
||||
while (t<=sample_size)
|
||||
t = t+1;
|
||||
if new_draw
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
function info = perfect_foresight_simulation(compute_linear_solution,steady_state)
|
||||
function info = perfect_foresight_simulation(compute_linear_solution,steady_state, init_flag)
|
||||
% Performs deterministic simulations with lead or lag on one period
|
||||
%
|
||||
% INPUTS
|
||||
|
@ -37,13 +37,9 @@ function info = perfect_foresight_simulation(compute_linear_solution,steady_stat
|
|||
|
||||
global M_ options_ it_ oo_
|
||||
|
||||
persistent flag_init
|
||||
persistent lead_lag_incidence dynamic_model ny nyp nyf nrs nrc iyf iyp isp is isf isf1 iz icf
|
||||
persistent ghx
|
||||
persistent lead_lag_incidence dynamic_model ny nyp nyf nrs nrc iyf iyp isp is isf isf1 iz icf ghx
|
||||
|
||||
initial_endo_simul = oo_.endo_simul;
|
||||
|
||||
if isempty(flag_init)
|
||||
if nargin==3% Initialization of the persistent variables.
|
||||
lead_lag_incidence = M_.lead_lag_incidence;
|
||||
dynamic_model = [M_.fname '_dynamic'];
|
||||
ny = size(oo_.endo_simul,1);
|
||||
|
@ -59,9 +55,12 @@ if isempty(flag_init)
|
|||
isf1 = (nyp+ny+1):(nyf+nyp+ny+1);
|
||||
iz = 1:(ny+nyp+nyf);
|
||||
icf = 1:size(iyf,2);
|
||||
flag_init = 1;
|
||||
info = [];
|
||||
return
|
||||
end
|
||||
|
||||
initial_endo_simul = oo_.endo_simul;
|
||||
|
||||
warning off all
|
||||
|
||||
if nargin<1
|
||||
|
|
Loading…
Reference in New Issue