Matlab code for optimisation?

hi guys
would anybody be willing to share some optimisation matlab code? Dynares options do not seem to be working for me, to maximise my posterior distn. wonder if there are better alternatives available.


Dear Reuben,

you can make the task of the optimizer easier, by trying the following steps

  1. tighten your prior and replace uniform priors by bell shaped ones
  2. dimish the number of observed variables, this usually simplifies the shape of the posterior
  3. dimish the number of parameters to be estimated (calibrate the other ones)

Then once you have found a simpler estimation problem, try to add the difficulties that you eliminated temporarly back into the model. Some of the earlier difficulties may disappear because you have now better inital values forthe parameters (use the estim_params_init syntax) or if they come back you will be able to link them to specific parameter or specific observed variable and get a chance to understand where the problem lies.

Gook luck


estimating with fewer observables will surely help!

I found that solvopt ( does pretty well. If you really have a hard time, but you have some … time, the simulated annealing version by W.L. Goff, can help you out.

To make them work you have to change the options in the file dynare_estimation (Dynarev3).

Here I attach my versions of those programs. I’ve modified them in order to be able to pass data to the function.


Gianni (377 KB)