# Hessian not positive definite and a laplace app. NaN

**URL:** <https://forum.dynare.org/t/hessian-not-positive-definite-and-a-laplace-app-nan/4821>\
**Category:** Dynare help (legacy posts)\
**Created:** [11 July 2015 17:40 UTC](https://forum.dynare.org/t/hessian-not-positive-definite-and-a-laplace-app-nan/4821 "2015-07-11T17:40:17Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![tamara\_b](https://forum.dynare.org/letter_avatar_proxy/v4/letter/t/5fc32e/32.png) [@tamara\_b](https://forum.dynare.org/u/tamara_b)\
**Post date:** [11 July 2015 17:40 UTC](https://forum.dynare.org/t/hessian-not-positive-definite-and-a-laplace-app-nan/4821/1 "2015-07-11T17:40:17Z")

</div>

Dear all,

I estimated a dsge model with a unit root using diffuse filter. The model works without the stimation part but reports several warning and error massages once the estimation part of the code is added.  
First it gives a few warnings, that Jacobian is sigular and there is colinearity (but I guess this is fine given the UR), then this one  
\*You did not declare endogenous variables after the estimation/calib\_smoother command.  
\*  
that I don’t know how to understand,  
then  
\*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 433  
> In dynare\_estimation at 70  
> In teza\_ss2\_e at 519  
> In dynare at 120  
> Warning: Matrix is singular to working precision.  
> In dynare\_estimation\_1 at 448  
> In dynare\_estimation at 70  
> In teza\_ss2\_e at 519  
> In dynare at 120\*

and finally  
\*Log data density [Laplace approximation] is NaN.

Error using chol  
Matrix must be positive definite.

- 

can you please help me understand to what error dynare might be pointing?

---

<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 July 2015 08:04 UTC](https://forum.dynare.org/t/hessian-not-positive-definite-and-a-laplace-app-nan/4821/2 "2015-07-12T08:04:21Z")

</div>

1. Collinearity is to be expected when you have a unit root.
2. 

> [@](#):
>
> You did not declare endogenous variables after the estimation/calib\_smoother command.

just warns that after the estimation command, you did not specify a list of variables for which to compute endogenous moments. You can ignore this.

1. This is a common problem (dozens of posts in the forum). First of all, take a look at the mode check plots if there is anything strange (in particular if there are any horizontal lines indicating non-identifiability).

---

<div class="post-metadata">

**Author:** ![tamara\_b](https://forum.dynare.org/letter_avatar_proxy/v4/letter/t/5fc32e/32.png) [@tamara\_b](https://forum.dynare.org/u/tamara_b)\
**Post date:** [14 July 2015 08:15 UTC](https://forum.dynare.org/t/hessian-not-positive-definite-and-a-laplace-app-nan/4821/3 "2015-07-14T08:15:16Z")

</div>

thank you!  
i digged a little through various topics and found a solution in setting the mode\_compute to 6… and that solved all the issues…  
now I have to look into how and why…
