# Hessian estimation with user provided function

**URL:** <https://forum.dynare.org/t/hessian-estimation-with-user-provided-function/3453>\
**Category:** Dynare help (legacy posts)\
**Created:** [21 October 2013 02:16 UTC](https://forum.dynare.org/t/hessian-estimation-with-user-provided-function/3453 "2013-10-21T02:16:57Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![Dr\_En\_Ami](https://forum.dynare.org/letter_avatar_proxy/v4/letter/d/a5b964/32.png) [@Dr\_En\_Ami](https://forum.dynare.org/u/Dr_En_Ami)\
**Post date:** [21 October 2013 02:16 UTC](https://forum.dynare.org/t/hessian-estimation-with-user-provided-function/3453/1 "2013-10-21T02:16:57Z")

</div>

How does one return (to dynare\_estimation\_1) an estimate of the Hessian with the user defined mode estimator?

For what is the mh\_posterior\_mode\_estimation option?

Where may I post bug reports or request revisions to the documentation?

---

<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:** [22 October 2013 09:28 UTC](https://forum.dynare.org/t/hessian-estimation-with-user-provided-function/3453/2 "2013-10-22T09:28:47Z")

</div>

Currently this is not possible, but if you could provide details on what you are trying to do and what you would need, we could try to accomodate this.

`mh_posterior_mode_estimation ` is for example used when loading a pre-existing mode file and not wanting to start again using this mode as starting value.

You can post bug reports and request revisions to the documentation either here or directly at [github.com/DynareTeam/dynare/issues?page=1&state=open](https://github.com/DynareTeam/dynare/issues?page=1&state=open)

---

<div class="post-metadata">

**Author:** ![Dr\_En\_Ami](https://forum.dynare.org/letter_avatar_proxy/v4/letter/d/a5b964/32.png) [@Dr\_En\_Ami](https://forum.dynare.org/u/Dr_En_Ami)\
**Post date:** [23 October 2013 21:35 UTC](https://forum.dynare.org/t/hessian-estimation-with-user-provided-function/3453/3 "2013-10-23T21:35:59Z")

</div>

I need a positive definite Hessian which none of the documented built-in methods provide. Actually it would be sufficient if I could use the undocumented ‘prior’ value for mode\_compute.

---

<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:** [25 October 2013 05:27 UTC](https://forum.dynare.org/t/hessian-estimation-with-user-provided-function/3453/4 "2013-10-25T05:27:15Z")

</div>

I am not sure to be following. Problems with optimizers are rarely responsible for the non-positive definite Hessian. Usually there is an issue with the model or finding the mode. If neither mode\_compute=6,8,9,10 (or a sequence thereof) provide a satsifactory results, there is usually a more fundamental problem hidden in the model.

---

<div class="post-metadata">

**Author:** ![Dr\_En\_Ami](https://forum.dynare.org/letter_avatar_proxy/v4/letter/d/a5b964/32.png) [@Dr\_En\_Ami](https://forum.dynare.org/u/Dr_En_Ami)\
**Post date:** [25 October 2013 06:17 UTC](https://forum.dynare.org/t/hessian-estimation-with-user-provided-function/3453/5 "2013-10-25T06:17:06Z")

</div>

Yes, I am having trouble finding the mode with any of the built in optimizers, but I don’t need the mode to run Metropolis-Hastings. I merely need a positive definite matrix which dynare calls the Hessian. I posted an issue about how to accomplish this when the optimizers fail.

---

<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:** [25 October 2013 08:31 UTC](https://forum.dynare.org/t/hessian-estimation-with-user-provided-function/3453/6 "2013-10-25T08:31:08Z")

</div>

A quick and dirty hack that would solve your problem can be found here: [[Usual Bayesian estimation problem](https://forum.dynare.org/t/usual-bayesian-estimation-problem/3295/1))

---

<div class="post-metadata">

**Author:** ![Dr\_En\_Ami](https://forum.dynare.org/letter_avatar_proxy/v4/letter/d/a5b964/32.png) [@Dr\_En\_Ami](https://forum.dynare.org/u/Dr_En_Ami)\
**Post date:** [27 October 2013 00:47 UTC](https://forum.dynare.org/t/hessian-estimation-with-user-provided-function/3453/7 "2013-10-27T00:47:31Z")

</div>

That does not seem to work either, presumably due to limited precision.

---

<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:** [27 October 2013 08:27 UTC](https://forum.dynare.org/t/hessian-estimation-with-user-provided-function/3453/8 "2013-10-27T08:27:20Z")

</div>

You could also simple comment out the error after the chol().command and set hh to an identity.
