Simulating an event

Is it possible to simulate an event in dynare. For example, If I want to simulate lockdown or say the lehmann brother collapse and look at the outcome in a dsge model. How can I do this in dynare. Any reference will be very helpful.

Here is a Webinar Series on Macroeconomic Modelling and Pandemics. Two papers along these lines I guess are ( Macroeconomic Dynamics and Reallocation in an Epidemic, The Macroeconomics of Epidemics). The authors of both papers combine standard macro models with epidemiology models (SIR, for example). I’m sure if you can write down the model equations, you can simulate them in dynare. The first paper has a video presentation ( by Prof. Harald Uhlig) together with slides and the paper itself…

Thanks kofiemma! Can you refer any dynare code which does simulation of an event.I am trying to simulate an event that happened in my country in August 2018.

Code to the paper ( Macroeconomic Dynamics and Reallocation in an Epidemic) is here: GitHub - tjxie/KUX_PandemicMacro: Macroeconomic dynamics and reallocation in an epidemic in dynare. I am sure if you find time to search, you will find other examples…:slight_smile:

Thanks, just for information, I am not doing any epidemiological simulations like many others are doing for simulating covid. My problem is different. I want to know how a time based event can be simulated in dynare. Say after 5 quarters suddenly credit declines or capital flows drop. Someone told me perturbation methods cannot be used for such things. I have to simulate the event. I wanted to know if I can do that in dynare. Could not think through how I will proceed. Hence the question.

Is the sudden credit decline or capital flows drop kinda exogenous, or some known policy caused it?

It is an exogenous event.

Then I think timing of the event doesn’t matter much if you want to simulate the effect of a given exogenous shock on the economy. Macroeconomists tend to not know when a given exogenous shock will occur, but can tell you how it will affect the economy if it occurs. So whether you want, for example, a negative credit shock to occur after 5 quarters or 10 quarters or 3 quarters doesn’t matter I think. You will be looking at the impulse response functions anayways if you want to examine propagation of a particular shock of interest. And in IRF analysis, the exact timing of a shock doesn’t matter.

If you have behavioral equations describing the credit market, then I think it will be easy to simulate a negative credit shock, for example. If the behavioral equations are microfounded, great. If they are not, you can still impose them…ad hoc kind of way.

But if it is solely timing of the event that you are interested in, you can define the timing of your own shock variable in dynare…people sometimes use their own user defined productivity shock.

So for example, if you want a negative shock after 5 quarters, you can specify your own user defined shock variable (&x_t&) to be (0,0,0,0,0, -0.5,0,0…0). So here, there is a single negative shock in period 6…shocks in all other periods are zero. Is it something like this that you want??

Yes exactly, this is what I want to do. I want a user defined shock to a particular variable in the model say reserves/credit and then I want to see how it propagates through the model and affects other variables.

Here is a thread for predefined shocks/: Predefined shocks in certain periods with 'simult_' - How? (DSGE) . You can ask further questions there I think.

@kofiemma thank you! This appears to be a helpful tip. Let me try there.