# Reduce mh\_init\_scale

**URL:** <https://forum.dynare.org/t/reduce-mh-init-scale/3375>\
**Category:** Dynare help (legacy posts)\
**Created:** [5 September 2013 20:00 UTC](https://forum.dynare.org/t/reduce-mh-init-scale/3375 "2013-09-05T20:00:42Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![zsm](https://forum.dynare.org/letter_avatar_proxy/v4/letter/z/779978/32.png) [@zsm](https://forum.dynare.org/u/zsm)\
**Post date:** [5 September 2013 20:00 UTC](https://forum.dynare.org/t/reduce-mh-init-scale/3375/1 "2013-09-05T20:00:42Z")

</div>

Hi,

I am estimating a model with Dynare 4.3.3 (please find the code uploaded, the forum didnt allow to upload the data file - is there a way to do that?!) using Dynare 4.3.3.

When running this version of the code I get the following error message:  
Multiple chains mode.  
MH: Searching for initial values…  
MH: I couldn’t get a valid initial value in 100 trials.  
MH: You should Reduce mh\_init\_scale…  
MH: Parameter mh\_init\_scale is equal to 0.400000.  
MH: Enter a new value…

Even if I reduce this parameter, the code is not running, even if I set the parameter to 0, Dynare says to reduce it further, although it cannot be negative.

Before this error message the posterior modes and standard errors seem to be reasonable, but MH is not working.

Could you please help me out what the problem might be?

Also, there are other versions of this code, where the chol matrix is not positive definite or even when MH is running, the posterior distributions are extremely narrow.

What I tried so far:

- different computation methods: mainly 6 and 9
- different mh\_jscale-s (0.1, 0.3, 0.4)
- different lik\_init-s (2, 3)
- other prior shapes (gamma vs normal, not truncated priors etc)
- other prior moments
- shorter dataset/less observables
- estimating less number of parameters (sometimes only 1!)

Thank you very much for any comments in advance!  
[SA\_bayes16.mod](https://forum.dynare.org/uploads/default/original/2X/a/a0a71a112b37324cbf2216fa91c11b2016ca5db4.mod) (14.8 KB)

---

<div class="post-metadata">

**Author:** ![zsm](https://forum.dynare.org/letter_avatar_proxy/v4/letter/z/779978/32.png) [@zsm](https://forum.dynare.org/u/zsm)\
**Post date:** [5 September 2013 20:28 UTC](https://forum.dynare.org/t/reduce-mh-init-scale/3375/2 "2013-09-05T20:28:35Z")

</div>

Now, running the same code with differently transformed data (instead of y-SS(y), I used (y-SS(y))/SS(y) ), the error message changes:

Error using \*  
Inner matrix dimensions must agree.

Error in metropolis\_hastings\_initialization (line 110)  
candidate = rand\_multivariate\_normal(  
transpose(xparam1), d \* options\_.mh\_init\_scale, npar);

Error in random\_walk\_metropolis\_hastings (line 69)  
ix2, ilogpo2, ModelName, MhDirectoryName, fblck, fline, npar, nblck,  
nruns, NewFile, MAX\_nruns, d ] = …

Error in dynare\_estimation\_1 (line 931)  
feval(options\_.posterior\_sampling\_method,objective\_function,options\_.proposal\_distribution,xparam1,invhess,bounds,dataset\_,options\_,M\_,estim\_params\_,bayestopt\_,oo\_);

Error in dynare\_estimation (line 70)  
dynare\_estimation\_1(var\_list,dname);

Error in SA\_bayes16\_rev (line 876)  
dynare\_estimation(var\_list\_);

Error in dynare (line 120)  
evalin(‘base’,fname) ;

It does not seem to be related to the priors or the estimations options or does it?

---

<div class="post-metadata">

**Author:** ![jpfeifer](https://forum.dynare.org/user_avatar/forum.dynare.org/jpfeifer/32/5044_2.png) [@jpfeifer](https://forum.dynare.org/u/jpfeifer)\
**Post date:** [6 September 2013 08:10 UTC](https://forum.dynare.org/t/reduce-mh-init-scale/3375/3 "2013-09-06T08:10:12Z")

</div>

Please put the all files including the datafile into a zip-file. Then you will be able to upload it.

---

<div class="post-metadata">

**Author:** ![zsm](https://forum.dynare.org/letter_avatar_proxy/v4/letter/z/779978/32.png) [@zsm](https://forum.dynare.org/u/zsm)\
**Post date:** [6 September 2013 13:23 UTC](https://forum.dynare.org/t/reduce-mh-init-scale/3375/4 "2013-09-06T13:23:37Z")

</div>

Good idea, done. Thank you!  
[SAmodel.zip](https://forum.dynare.org/uploads/default/original/2X/4/4774846ec02fa76182bfe97384bf54e851b46bbf.zip) (9.32 KB)

---

<div class="post-metadata">

**Author:** ![zsm](https://forum.dynare.org/letter_avatar_proxy/v4/letter/z/779978/32.png) [@zsm](https://forum.dynare.org/u/zsm)\
**Post date:** [7 September 2013 16:22 UTC](https://forum.dynare.org/t/reduce-mh-init-scale/3375/5 "2013-09-07T16:22:11Z")

</div>

I am sorry, these are the correct files!  
[SAmodel\_rev.zip](https://forum.dynare.org/uploads/default/original/2X/1/1d94ec452dda2bcfb55154dbfe17d120a5e1a0f8.zip) (9.32 KB)

---

<div class="post-metadata">

**Author:** ![jpfeifer](https://forum.dynare.org/user_avatar/forum.dynare.org/jpfeifer/32/5044_2.png) [@jpfeifer](https://forum.dynare.org/u/jpfeifer)\
**Post date:** [8 September 2013 15:42 UTC](https://forum.dynare.org/t/reduce-mh-init-scale/3375/6 "2013-09-08T15:42:39Z")

</div>

Please run

```auto

```

to see that your model has collinearity issues that prevent the Kalman filter from functioning. This in turn leads to the likelihood due to singularity issues always being Inf and Dynare not finding starting values. Tweaking estimation without fixing the model won’t work.
