# Controlled shocks in a stochastic framework

Hi everybody, I’m a new Dynare user. I’m trying to introduce a specific pre-determined sequence of monetary shocks in a log-linearized DSGE model to see how the economy reacts to a specific timing of the shock. In other words, I want to feed the model with a shock vector that is known to me but not to the agent. Can this be done in Dynare? The “deterministic case” of the user’s manual is not what I want, because using the command “simul” makes the agent anticipate the shocks, while shocks should remain unanticipated in my model.

Does some one know how to do that?

Thanks!!

Matías

Well I’m doing it with excel and it seems to work fine. Some day I may become a matlab expert too Thanks anyway!

I suppose a (not very straightforward) way to do that is to run the dynare program and collect the impulse response functions for the shock you are interested in. Then you construct your impulse response function by adding up. Thus say your shock is e and you want to see what happens to price §. You get p_e from the simulation and in the first period it is just p_e(1). The second period will be pe_(2)+a1pe_(1), where a is the relative amplitude of the second shock. In period 3 it will be pe_(3)+a1pe_(2)+a2pe_(1) and so on and so forth.

Hi,

The solution is indeed to use the first (or second) order stochastic approximation computed by Dynare (with the command “stoch_simul”), and then use the decision rules (also known as the policy function) to simulate the economy facing a given sequence of shocks. In this case all shocks are unanticipated by the agent (even though the agent is supposed to know the unconditional variance of the considered shocks).

The function for that is “simult_” (note the underscore at the end), located in the matlab/ subdirectory. It is documented at the top of the M-file. The decision rules that you need to pass are in the “oo_.dr” structure created by “stoch_simul”.

Best,