Deterministic simulation with uncertain duration of shock

Hi all,

We are running a deterministic simulation of our model and if the shock is specified only in the first period everything works fine. However, we want to assess the effect of uncertainty regarding the duration of the shock, e.g. there is a shock in period 1 for sure, with probability p the shock continues in period 2 and with probability 1-p the shock will already be over in period 2, in period 3 the shock is over for sure. Is this possible in a deterministic simulation?

In the code we have Dynare is not able to find a solution for any value of p, only for small enough values of the probability for a continued shock can it compute the perfect foresight simulation. We do not understand why this is the case and appreciate any suggestions on how to fix this. I have attached the model file for reference.Uncertainty.mod (1.5 KB)

Thank you!

How should that work? Perfect foresight simulations rely on having a terminal condition. But with a shock continuing every period with some probability, the terminal condition is unknown.

But the shock is not supposed to continue every period. It will be over for sure in the third period. The only uncertainty is whether it only lasts for the first period or also for the second…

The issue seems to be the many min()-operators. Standard solvers cannot easily handle those. Is there a way to set up the problem differently, e.g. as a lmmcp-problem?

Thank you! We will try rewriting the model, it should work because our only constraints are that some probabilites have to be smaller than 1.