I want perfect foresight simulation not to return to steady state, is that possible?

In perfect foresight papers, the simulation of the endogenous variables do not return to steady-state given a sequence of pre-announced shocks…like in the figure below.
Screenshot from 2021-09-01 23-24-11

In dynare, however, the simulation always returns to the steady-state as shown below.
Screenshot from 2021-09-02 00-51-00
I guess I should manually plot the simulation so that it ends at period 10? I have the following code - a toy example that assumes I have 10 periods of population forecast from steady-state.

shocks;
var POP;
periods 1 2 3 4 5 6 7 8 9 10;
values 1 0.9 0.8 0.7 0.6 0.5 0.4 0.3 0.2 0.1;
end;

perfect_foresight_setup(periods=10);
perfect_foresight_solver;

This usually indicates a mistake in your setup. If there is a jump in the last period, it often indicates that your simulation did either not have sufficient time to converge to the terminal steady state or that the terminal condition is wrong.

Thanks, Prof Pfeifer for the reply. May I kindly clarify…I have a sequence of shocks. How can I combine that with endval block. The following code, for example, does not work, but produces steady state errors for the exogenous equation in the model block: efficiency = rho*efficiency(-1) + EfficiencyInnovation;. Thus, its residual is not zero.

shocks;
var EfficiencyInnovation;
periods 4, 5:31;
values 0.04, 0.08;
end;
endval;
EfficiencyInnovation = 0.08;
end;
steady;

Is it possible to start the simulation with a predefined sequence of shocks, and then after the last element of the sequence, do a permanent shock to a new steady state using the endval command? How may I modify the model above if that is possible…

Please provide the full file where you tried this. endval followed by steady is the right way to go.

Hi Prof Pfeifer, here is the full file.
rbc_det3.mod (2.3 KB)

You need to compute the steady state in that case. Start with

efficiency=EfficiencyInnovation/(1-rho);
Efficiency=effstar*exp(efficiency);

Hi Prof Pfeifer, many thanks for the reply. I started the steady-state with,


efficiency = EfficiencyInnovation/(1-rho);
Efficiency = effstar*exp(efficiency);

but I still have not been able to combine the shocks; block and endval; block in one mod file.

With this code, there is an error: Perfect foresight simulation failed

shocks;
var EfficiencyInnovation;
periods 4, 5:100;
values 0.04, 0.08;
end;
endval;
EfficiencyInnovation = 0.08;
end;
steady;

If I put steady; between shocks; and endval; commands,

shocks;
var EfficiencyInnovation;
periods 4, 5:100;
values 0.04, 0.08;
end;

steady;

endval;
EfficiencyInnovation = 0.08;
end;
steady;

I get the following results; the sequence of EfficiencyInnovation = {0, 0.08, 0.08, 0.08, 0.04, 0.08, 0.08...0.08}
Screenshot from 2021-09-08 12-56-00
But what I want is EfficiencyInnovation = {0, 0, 0, 0, 0.04, 0.08, 0.08...0.08}

If I remove the endval; block entirely, I get EfficiencyInnovation = {0, 0, 0, 0, 0.04, 0.08, 0.08...0.08, 0}. That is EfficiencyInnovation goes back to zero, but I want it to stop at 0.08.

rbc_det4.mod (2.4 KB)

It seems rbc_det4.mod (2.5 KB) is the right way to go.

Thank you. efficiency and Efficiency behave as I wanted.

  efficiency = rho*efficiency(-1) + EfficiencyInnovation;
  Efficiency = effstar*exp(efficiency);

The associated evolution of EfficiencyInnovation is in the left panel of the plot below. I guess it is impossible to get it to behave like in the right panel. But generally, efficiency and Efficiency behave as I wanted, so I guess it does not matter much whether EfficiencyInnovation evolves according to the right or left panel below.

Use

shocks;
var EfficiencyInnovation;
periods 1:3, 4, 5:100;
values 0, 0.04, 0.08;
end;
1 Like