Hi! I have the following question:

It concerns stochastically simulating a standard linear 3 equation NK model which I would like to extend with an endogenous switching mechanism for expectations (which is highly nonlinear, hence I would simulate at a higher order) where a share of agents switches between rational expectations and some non-rational (simplistic) expectations (e.g. simply assuming past period’s realisation) depending on which forecasting heuristic has a smaller forecast error.

In particular, I am interested in calculating the squared forecast error between rational expectations and the realisation:

FEt=(Et-1πt – πt)^2

My problem is how could this line be written in the syntax of Dynare wrt the timing notation, if I want the rational expectations, i.e. “π(+1)”, but from the period before?

Best,

Daniel