Multiple simulation

Hi there,

I got a problem that dynare will sometimes gives nan when I have large number of simulations, say 5000, using loop. But the code works fine if number of simulation is small. I can check nan and discard it at each loop but I am curious about the reason.
new finding: the nan comes at certain loop, for example, the 7th always give nan

Another thing puzzling me is that in dyanre we have non zero coefficient of cross term between state variable and variance when approximated to second order. But according to Stephanie and Martin (2004), second order approximation should only change the constant.

Thanks in advance for any comments
steadystate.m (297 Bytes)
low_frequency_mc.mod (8.2 KB)

This is because without pruning, second order perturbation solutions might result in explosive simulations. Thus, set

Regarding the second point: there are no variance terms. You are looking at cross-terms between states and shocks. It is the level of shocks, not their variance that shows up in the policy functions.