%... or if there are no more shocks we collect the whole path
yy=[yy,oo_.endo_simul(:,2:end)];
end
ooexosaved=oo_.exo_simul;
firstsimul=1;
end
else
%currentperiod is larger than one: we first perform perfect foresight simulation with initial period 1 conditions
iffirstsimul==0
%Initializing the first simulation
options_.periods=jm.simperiods;
yy=oo_.steady_state;
perfect_foresight_setup;
[rowexo,colexo]=size(oo_.exo_simul);
perfect_foresight_solver;
%In this because there is at least one shock we did not consider yet in the first period, we only save the path from the beginning up the period just before the current