# Negative shocks

How is one to generate negative shocks in Dynare? Thanks.

In which context? Simulations or IRFs?

IRFs predominantly and both secondly.

For simulations, Dynare randomly draws from the shock distribution and some shocks are negative, of course. If you use the simult_ function for generating your own simulations, you can select any shock you like.
For IRFs, Dynare by default draws a positive one standard deviation shocks. If you have an AR(1) process like

``z=rho*z(-1)+eps_z;``

and you want an IRF to a negative shock, write the process as

``z=rho*z(-1)-eps_z;``

Due to symmetry of the normal distribution, this change does not affect anything in your model.

2 Likes

Thatâ€™s right; thank you, sir. By oneâ€™s own simulations do you mean typing up oneâ€™s own code? For instance, how could I get this one (attached) to generate IRFs to more than one of the three shocks present within the model? - As in, getting it to reproduce IRFs to the three shocks like in the Dynare code. Thanks.

Take a look at DSGE_mod/RBC_news_shock_model.mod at master Â· JohannesPfeifer/DSGE_mod Â· GitHub. It shows how to use the simult_ function in Dynare to build any shock sequence for IRFs you like.

Thank you; I shall. Yet, I beg your pardon, what I was mainly asking was how to modify the second code, in the â€śSolutionsâ€ť section, so as to generate IRFs to more than just one shock, like in Dynare. Iâ€™d really appreciate your assistance thereat. I am attaching the notes just for clarity. Gratitude.

``````% Solutions

w_solution = NaN(10,T);
x_solution = NaN(10,T);

w_solution(:,1) = [0.1; 0.1; 0.1; 0.1; 0.1; 0.1; 0.1; 0.1; 0.1; 0.1];
x_solution(:,1) = inv(Pi_t_11) * w_solution(:,1);

for t = 2:T
x_solution(:,t) = inv(Upsilon_11)*Psi_11*x_solution(:,t-1);
w_solution(:,t) = Pi_t_11*x_solution(:,t);
end``````

I am not familiar with your code and what you are trying to achieve and thus cannot provide support.

I was trying to reproduce IRFs to the 3 shocks and not just the first one. Thank you, anyways.