For a first-order approx, IRF is straightforward: you feed shock like [1,0,0,0,0,0,…0] then track down the responses of each variable.

For second order, the user guide says, “The technique is instead to pull future shocks from their distribution and see how they impact your system, and
repeat this procedure a multitude of times in order to draw out an average response.”

Okay, but still I don’t get the picture. How does Dynare implement this specifically?

Does it mean that I feed a series of random shocks into the model? But then it becomes a just simulated series, not IRF. Does it feed a shock series like [Big shock, normal random shock, normal random shock, …, normal random shock]? Also, due to the cross terms, just one series would not give a nice hump-shaped impulse responses: it would not converge to zero level.

This sounds like a stupid question but I am planning to implement the dynare’s method to my own code but I don’t understand the specific details of how Dynare does this. Any comment will be appreciated. Thanks.

We need two series. One with ordinary shocks, which is a kind of simulated series. And we need another series with a Big shock at a given point of time. So it will be like

[e1+shock,e2,e3,e4…] these 'e_i’s are random shock. And the impulse response is the difference between two series of the corresponding variable.

And we did this many times and average out the difference as impulse response. Am I right? Someone please tell me!

I have a follow up question on the previous one: Why doesn’t Dynare construnct the IR from the policy functions directly? This would also solve the problem that “The simulations conducted for generating IRFs … were explosive” and that one has to reduce the shock size or use pruning. Or do I not understand this correctly?
Thanks for your help!

How would you do this?
Also note that we are talking about Generalized IRFs, because we integrate out the state-dependence. As shown in Andreasen et al (2013), you could compute these analytically, but we do not yet support this.