# Perfect foresight simulation with different perspectives

Dear Professor Jpfeifer,
Is it possible to run a perfect foresight simulation with different perspectives? i.e. we are now in 2020, and we know that at the beginning of 2015 it is announced that parameter X will be = 1 for whole 2015, then at the beginning of 2016 it is announced that X=2, … until 2020. I would like to start the simulation with ss 2015 so at t=1, I can run a deterministic simulation and a shock which changes X=0 to X=1, but if at t=5 I define a shock which change X=1 to 2, from the model perspective , it means that all agents have already knew about this change from the beginning of 2015, which is not the case here. So I was wondering if there is a possibility to model this situation?
Kind regards,
Leo

1 Like

I am not entirely following. If I understand you correctly, you want to simulate a series of surprise MIT shocks, where people in each period are surprised by the shock realization and never consider that another shock may happen.

Thank you for your reply. An example of my question is the ECB’s pepp : at the beginning of 2020 we all know what’s the package (so a deterministic shock) but still there is no plan for 2021. Just imagine at the beginning of 2021, the ECB announce another package, so this new package can be considered as a deterministic shock if the simulation starts at 2021. The question is how to simulate this system starting from 2020?
Kind regards,
Leo

You start a perfect foresight simulation in 2020 with an appropriate terminal condition and simulate it for one year. At that point in time, the new information realizes. Based on the state of the previous simulation at this point in time, you now start a new simulation with this initial condition an the new shock sequence that people are now expecting.

Thank you so much for your answer. So this means : start a new simulation by simply define initval; with variables = oo._endo_simul of the previous simulation at this point in time? or there is another more standard way to code this?

Yes, that would be the way to go. But usually, it’s easier to directly set the first period entry of `oo_.endo_simul` instead of having an `initval`-block that Dynare then translates into this field.

Thank you so much. So to be clear : I should delete the initval black and feed the mod file with:

end; %% model
shocks;

end;
oo_.endo_simul(:,1)=temp.oo_.endo_simul(:,10); %% if I need to start at period 9 of the last simulation
perfect_foresight_setup(periods=250);
options_.simul.robust_lin_solve=2;
perfect_foresight_solver(stack_solve_algo =0);
Is it correct?
Kind regards
Leo

No,

``````perfect_foresight_setup(periods=250);
``````

will overwrite

``````oo_.endo_simul(:,1)=temp.oo_.endo_simul(:,10); %% if I need to start at period 9 of the last simulation
``````

So change the order.

Thank you so much. The problem is if I delete initval; black the model cannot find the steady state. I am wondering if I keep the initval; to help steady; find the steady state and then replace oo_endo_simul, it also works? similar to :

model;

end; %% model
initval;

end;
resid(1);
check;
shocks;

end;
perfect_foresight_setup(periods=250);
oo_.endo_simul(:,1)=temp.oo_.endo_simul(:,10); %% if I need to start at period 9 of the last simulation
options_.simul.robust_lin_solve=2;
perfect_foresight_solver(stack_solve_algo =0);

Which steady state do you mean? The terminal one? In this case, yes.

I think I got it: endval; to feed the model with the initial SS guess for the steady state and start the simulation at the end of the previous simulation by oo_.endo_simul(:,1)=temp.oo_.endo_simul(:,10);

Is this correct?

Kind regard,
Leo