# The hessian matrix at the "mode" is not positive definite!

**URL:** <https://forum.dynare.org/t/the-hessian-matrix-at-the-mode-is-not-positive-definite/3739>\
**Category:** Dynare help (legacy posts)\
**Created:** [2 March 2014 12:33 UTC](https://forum.dynare.org/t/the-hessian-matrix-at-the-mode-is-not-positive-definite/3739 "2014-03-02T12:33:02Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![parantap](https://forum.dynare.org/letter_avatar_proxy/v4/letter/p/ebca7d/32.png) [@parantap](https://forum.dynare.org/u/parantap)\
**Post date:** [2 March 2014 12:33 UTC](https://forum.dynare.org/t/the-hessian-matrix-at-the-mode-is-not-positive-definite/3739/1 "2014-03-02T12:33:02Z")

</div>

Hi, Anybody can help me how to fix this problem? I tried different guesses for the parameters but it sometimes simply does not work.

POSTERIOR KERNEL OPTIMIZATION PROBLEM!  
(minus) the hessian matrix at the “mode” is not positive definite!  
=\> posterior variance of the estimated parameters are not positive.  
You should try to change the initial values of the parameters using  
the estimated\_params\_init block, or use another optimization routine.  
Warning: The results below are most likely wrong!

> In dynare\_estimation\_1 at 711  
> In dynare\_estimation at 84  
> In quant\_banking\_stoch7\_endo\_est at 378  
> In dynare at 174

---

<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 March 2014 11:37 UTC](https://forum.dynare.org/t/the-hessian-matrix-at-the-mode-is-not-positive-definite/3739/2 "2014-03-08T11:37:45Z")

</div>

Search the forum. See e.g. [[Usual Bayesian estimation problem](https://forum.dynare.org/t/usual-bayesian-estimation-problem/3295/1)). Do you already use mode\_compute=6? If nothing else works, use mcmc\_jumping\_covariance

---

<div class="post-metadata">

**Author:** ![parantap](https://forum.dynare.org/letter_avatar_proxy/v4/letter/p/ebca7d/32.png) [@parantap](https://forum.dynare.org/u/parantap)\
**Post date:** [9 March 2014 21:10 UTC](https://forum.dynare.org/t/the-hessian-matrix-at-the-mode-is-not-positive-definite/3739/3 "2014-03-09T21:10:03Z")

</div>

Many thanks for this lead. Would you kiddly tell me where and how I should insert the mcmc\_jumping\_covaraince command. I put this in the option but it did not take this. An example command will be very much appreciated.

---

<div class="post-metadata">

**Author:** ![parantap](https://forum.dynare.org/letter_avatar_proxy/v4/letter/p/ebca7d/32.png) [@parantap](https://forum.dynare.org/u/parantap)\
**Post date:** [11 March 2014 21:55 UTC](https://forum.dynare.org/t/the-hessian-matrix-at-the-mode-is-not-positive-definite/3739/4 "2014-03-11T21:55:38Z")

</div>

I have downloaded dynare 4.2.2 and it seems that this problem of negative hessian has gone away. was this a bug in the previous versionof dynare? Does anybody know? version 4.2.2 seems quite stable. It sometimes gives a java warning which I don’t understand. Besides this it seems to be a working fine.

---

<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:** [12 March 2014 14:43 UTC](https://forum.dynare.org/t/the-hessian-matrix-at-the-mode-is-not-positive-definite/3739/5 "2014-03-12T14:43:48Z")

</div>

You mean 4.4.2? As far as I know, there was no bug in this part. There might have been small changes in the mod-finders. Java warnings are Matlab problems, not Dynare. It usually helps to increase the Java Heap Space in Home -\> Preferences -\> Matlab -\> General -\> Java Heap Memory

Regarding your example: in 4.4 you can use

```auto
estimation(datafile= ..., mcmc_jumping_covariance=identity_matrix);
```
