Perfect foresight simulation always failed

The problem is the equation
Lam(1)*(R(1) + 1 - del) = 1;
All variables here are dated t+1. Thus, in the last period, the derivative with respect to all variables will be 0. This is no problem for stochastic simulation. For deterministic ones, do not rely on auxiliary definitions. Use

beta*C/C(+1)/G*(R(1) + 1 - del) = 1;

and the file will work.

1 Like