# Error in estimation, but model runs perfect in simulation

**URL:** <https://forum.dynare.org/t/error-in-estimation-but-model-runs-perfect-in-simulation/28307>\
**Category:** Estimation\
**Created:** [14 March 2026 23:51 UTC](https://forum.dynare.org/t/error-in-estimation-but-model-runs-perfect-in-simulation/28307 "2026-03-14T23:51:42Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![ChrisL](https://forum.dynare.org/letter_avatar_proxy/v4/letter/c/58f4c7/32.png) [@ChrisL](https://forum.dynare.org/u/ChrisL)\
**Post date:** [14 March 2026 23:51 UTC](https://forum.dynare.org/t/error-in-estimation-but-model-runs-perfect-in-simulation/28307/1 "2026-03-14T23:51:43Z")

</div>

I have a fairly complex model that runs perfectly when simulated. The model is linear.

The impulse response functions look very reasonable.

I now try to estimate the model, but the estimation routine throws a “matrix must be positive definite” error.

I’ve tried suppressing all the estimated params except for one and the estimation routine runs fine. I then un-suppress parameters one by one. I find that the estimation becomes impossible (the error is thrown) as soon as I want to include any of the parameters from the exogenous portion of the model (parameters which govern the processes describing productivity, government expenditure, loan delinquencies, etc).

I’ve tried altering the observable variables, but the consistency of the error remains. Any ideas? Thank you ahead of time.

---

<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:** [16 March 2026 12:48 UTC](https://forum.dynare.org/t/error-in-estimation-but-model-runs-perfect-in-simulation/28307/2 "2026-03-16T12:48:33Z")

</div>

Without the files it is impossible to tell.

---

<div class="post-metadata">

**Author:** ![ChrisL](https://forum.dynare.org/letter_avatar_proxy/v4/letter/c/58f4c7/32.png) [@ChrisL](https://forum.dynare.org/u/ChrisL)\
**Post date:** [16 March 2026 17:21 UTC](https://forum.dynare.org/t/error-in-estimation-but-model-runs-perfect-in-simulation/28307/3 "2026-03-16T17:21:21Z")

</div>

Before wasting yours and everyone’s time, I will try some simplifications to the model. If the problem persists, I’ll return and post. Thank you!

---

<div class="post-metadata">

**Author:** ![ChrisL](https://forum.dynare.org/letter_avatar_proxy/v4/letter/c/58f4c7/32.png) [@ChrisL](https://forum.dynare.org/u/ChrisL)\
**Post date:** [16 March 2026 20:32 UTC](https://forum.dynare.org/t/error-in-estimation-but-model-runs-perfect-in-simulation/28307/4 "2026-03-16T20:32:08Z")

</div>

Surprisingly, merely deleting two of the observable variables made a night and day difference. It runs fine for now. If any additional problems spring up, I’ll reach out to this thread again.
