I have a model, building on Ghironi and Melitz (2005) where the stochastic simulation solve with no issues, and produces sensible responses, but with the deterministic simulation, no matter how many periods I try to simulate over (I’ve tried up to 20000), the results do not converge with any size of shock >0.

Model_Diagnostics detects no obvious problems with the mod file, and the B-K conditions are satisfied (both rank and eigenvalues>1=forward looking variables).

I’ve tried reducing the model down to its most simple form possible, with no improvements.

I’ve tried with very small shocks and the simulation still fails to converge - homotopy fails as well - the only stage of the homotopy that ‘suceeds’ is when the shock size is small enough that dynare treats it as 0 when solving the model. e.g for a 0.1% shock to TFP in one industry this is the output (with maxit =10, given that the error doesn’t change after iteration 3):

MODEL SIMULATION:

Iter: 1, err. = 0.0001, time = 1.805
WARNING : Failed to find a solution to the linear system.
Iter: 2, err. = 0.00022364, time = 0.529
WARNING : Failed to find a solution to the linear system.
Iter: 3, err. = 0.00022365, time = 0.551
WARNING : Failed to find a solution to the linear system.
Iter: 4, err. = 0.00022365, time = 0.516
WARNING : Failed to find a solution to the linear system.
Iter: 5, err. = 0.00022365, time = 0.377
WARNING : Failed to find a solution to the linear system.
Iter: 6, err. = 0.00022365, time = 0.339
WARNING : Failed to find a solution to the linear system.
Iter: 7, err. = 0.00022365, time = 0.34
WARNING : Failed to find a solution to the linear system.
Iter: 8, err. = 0.00022365, time = 0.411
WARNING : Failed to find a solution to the linear system.
Iter: 9, err. = 0.00022365, time = 0.358
WARNING : Failed to find a solution to the linear system.
Iter: 10, err. = 0.00022365, time = 0.37
WARNING : Failed to find a solution to the linear system.

Total time of simulation: 21.293.
Maximum number of iterations is reached (modify option maxit).

Simulation of the perfect foresight model failed!
Switching to a homotopy method…

I have manged to work around the issue, by using a slightly different approach to the derivation of the model, so the file posted above is still the most recent version of the model with this issue. However, I am still unclear as to the theoretical reason why a model would run stochastically, and fullfil all of the BK conditions, and yet not converge deterministically, even with a large number of periods and very small shocks.

The problem in your model is that the Jacobian of the contemporaneous endogenous variables is singular. This is not a problem for the stochastic solver, but it is a problem for the way the perfect foresight simulations are conducted.

Dear Prof Pfeifer,
I encounter similar problem. It works fine under stochastic case. But perfect foresight simulations always fail.
Could you be more specific about “Singularity of Jacobian of the contemporaneous endogenous variables”? How can I avoid such singularity?