News shock in Deterministic Simulation

If I specify the technology shock as a_t = rho_a*a_t(-1)+ea and simulate the responses a news in a_t using simul rather than stoch_simul, is the following the right way to do it?

var ea;
periods 1:2 ;
values 0.0 ;
var ea;
periods 3:3;
values .01 ;
var ea;
periods 4:1000;
values 0.00;


It is suppose a news with regard to the technology after two periods.

However, Dynare gives an error message:

ERROR: JR_aer_unitroot.mod:112.0-114.18: shocks: variable ea declared twice

??? Error using ==> dynare at 96
DYNARE: preprocessing failed

Judging from the manual, it should be:

shocks; var ea; periods 1:2 3 4:1000; values 0.0 .01 0.0;

I also guess that you do not need the specify the periods where the shock is 0 as this should be the case by default. Hence

shocks; var ea; periods3; values .01;

might be sufficient

Hi, jpfeifer:

Thank you for the help. The code works now. Something interesting is that I cannot replicate the result in Jaimovich and Rebelo (2009 AER) with simul, but stoch_stimul result basically can generate co-movement between macro variables. if I use simul, there is dip of consumption when the shock is realized, and furthermore, the responses before period 3 are just zeros. I guess Dynare does not recognize the shock as a “news”.

Hi! Would u be kindly willing to share your code? I’m working on a similar model and would be a great help.