This page is frozen and has been moved to https://git.dynare.org/Dynare/dynare/wikis/mode-compute-6

In some situations the posterior mode (that will be used to initialize the Metropolis Hastings (MH) and to define the jumping distribution) is hard to obtain with standard (newton like) optimization routines. The user, by specifying **mode_compute = 6**, can trigger a Monte-Carlo based optimization routine.

- It's not an optimization routine!... Or a very inefficient one.
- For the MH algorithm we don't need to start from the posterior mode. We only need to start from a point (in parameters space) with a high posterior density value and to use a good covariance matrix for the jumping distribution.
- The idea is to use a MH algorithm with a diagonal covariance matrix (prior variances or a covariance matrix proportional to unity) and to continuously update the posterior covariance matrix and the posterior mode estimates through the MH draws.
After each MH-draw in the posterior distribution we update the posterior mean, the posterior mode and the posterior covariance as follows:

Use

**options_.Opt6Numb =**[default=20000] (before the estimation command) to set the number of simulations in the new routine.Use

**options_.Opt6Iter =**[default=3] to call repeatedly the new optimization routine. Improves the estimates of the posterior covariance matrix and of the posterior mode.- This new optimization routine also provides a scale parameter (for the jumping distribution) such that acceptance ratio of the MH simulations will be around one third.

- In Dynare unstable the options have been renamed and made more flexible
Use

**options_.gmhmaxlik.iterations =**[default=3] to call repeatedly the new optimization routine. Improves the estimates of the posterior covariance matrix and of the posterior mode.Use

**options_.gmhmaxlik.number =**[default=20000] to set the number of simulations used in estimation of the covariance matrix.Use

**options_.gmhmaxlik.nscale =**[default=200000] to set the number of simulations used in the tuning of the scale parameter.Use

**options_.gmhmaxlik.nclimb =**[default=200000] to set the number of simulations used in the hill climbing simulations.