Hello,

I have a program where it solves a stochastic model and generates IRF. In line 48 of the file “workertype_henry”, I used delta^(2-1). However, when I changed the code to delta^(thetta-1) where thetta is a parameter equals to 2, I get a different IRF result (figure 1, response to eta shock) which is shown in the file “workertype_henrythetta”. I’ve been starting at the code for more than a day but I couldn’t figure out why changing from “2” to “thetta” could yield a drastic result in the IRF. Does anyone know why this could be the case? I am using Dynare 4.2.5. Thank you in advance for all your help!

workertype_henry.mod (2.37 KB)

workertype_henrythetta.mod (2.38 KB)

This is a rare bug.

Please replace the Dynare 4.2.5 file from the Matlab folder with the attached one. Sorry for the inconvenience.

getPowerDeriv.m (1.09 KB)

I replaced the Dynare 4.2.5 file from the Matlab folder with the file you attached. The two codes now produce the same IRFs. Thank you so much for your help!

I just noted the problem also affects higher orders. The file has been updated.

Hi jpfeifer,

Does the current “getPowerDeriv.m” file that you posted on this thread reflect the changes for higher orders as well? I compared the Impulse responses using “workertype_henrythetta.mod” when theta=4 and when theta==6 (theta can’t be odd number), and they are numerically identical which intuitively shouldn’t be the case. Thanks again for your help.

For higher orders (i.e. stoch_simul(order=3)) there seems to be the same problem in the C+±files used. Fixing this is not so easy as these files need to be compiled. A fixed version will most probably appear tomorrow or so in the unstable Dynare version.