- Smooth any discontinuities in your model. I recommend the functional form max = ( sqrt( ( maximand1 - maximand2 )^2 + eps^2 ) + ( maximand1 + maximand2 ) ) / 2 for any maxes (where eps controls the maximum deviation from the true max). By differentiating this functional form once you can get a smooth step function, and differentiating it a second time gives a smooth delta function.
- Create a duplicate of your model file in which you remove any lags, leads or expectation operators, as well as any shocks. This ensures there are no auxiliary variables being solved for, thus minimising the dimensionality of the problem.
- Once you've done this, you will find that many equations are purely definitional, and can be replaced with dynare # definitions, further reducing dimensionality.
- Use a global solver, rather than the local ones Dynare includes. I particularly recommend CMA-ES http://www.lri.fr/~hansen/cmaesintro.html which is available for both C and Matlab, and seems remarkably powerful.
- If solver running times are too high, consider solving in C. You can take one of the CMA-ES example programmes and the automatically generated C residual code from Dynare, meaning this requires absolutely minimal coding. The speed-up for me was around 100x (no exaggeration).
- Impose constraints in the objective function. I had a reasonably strong belief on the relative magnitudes of various variables in steady state, and encoded these beliefs into the objective function by adding a large number onto any steady state that violated them. This greatly helped avoiding local minima.
- Use homotopy. Having solved a special case using CMA-ES (after multiple runs with a bit of manual tweaking of starting values), I then modified my C code to slowly adjust the free parameter until it was the value I wanted.
Hope this is of some use to someone.
T