# Same code, different results with different dynare version

**URL:** <https://forum.dynare.org/t/same-code-different-results-with-different-dynare-version/12660>\
**Category:** Estimation\
**Created:** [24 October 2018 05:39 UTC](https://forum.dynare.org/t/same-code-different-results-with-different-dynare-version/12660 "2018-10-24T05:39:29Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Wenddy](https://forum.dynare.org/letter_avatar_proxy/v4/letter/w/dbc845/32.png) [@Wenddy](https://forum.dynare.org/u/Wenddy)\
**Post date:** [24 October 2018 05:39 UTC](https://forum.dynare.org/t/same-code-different-results-with-different-dynare-version/12660/1 "2018-10-24T05:39:29Z")

</div>

Hi, everyone

my computer is windows 10. I installed MATLAB 2017b and Dynare 4.5.5. When I run a Dynare code under estimation(order=2), it comes out error,“Matrix must be positive definite”. then under estimation(order=1), and under stoch\_simul(order=1/order=2)， dynare works well.

then, when i try to another version, dynare v4.3, v4.4, It comes out same cases. but in Dynare v4.1, under estimation(order=2),there is no error, the same code seem to run well.

Thanks!

---

<div class="post-metadata">

**Author:** ![stepan-a](https://forum.dynare.org/user_avatar/forum.dynare.org/stepan-a/32/6652_2.png) [@stepan-a](https://forum.dynare.org/u/stepan-a)\
**Post date:** [24 October 2018 05:45 UTC](https://forum.dynare.org/t/same-code-different-results-with-different-dynare-version/12660/2 "2018-10-24T05:45:24Z")

</div>

Hi,

Did you try 4.5.6? This version comes with a couple of fixes for the nonlinear filters.

best,  
Stéphane.

---

<div class="post-metadata">

**Author:** ![Wenddy](https://forum.dynare.org/letter_avatar_proxy/v4/letter/w/dbc845/32.png) [@Wenddy](https://forum.dynare.org/u/Wenddy)\
**Post date:** [24 October 2018 05:52 UTC](https://forum.dynare.org/t/same-code-different-results-with-different-dynare-version/12660/3 "2018-10-24T05:52:09Z")

</div>

Thank you very much for replying me!  
I try to 4.5.6, it comes out the same error messages.

---

<div class="post-metadata">

**Author:** ![stepan-a](https://forum.dynare.org/user_avatar/forum.dynare.org/stepan-a/32/6652_2.png) [@stepan-a](https://forum.dynare.org/u/stepan-a)\
**Post date:** [24 October 2018 06:58 UTC](https://forum.dynare.org/t/same-code-different-results-with-different-dynare-version/12660/4 "2018-10-24T06:58:36Z")

</div>

Then you should post a mod file (with data) so that we can reproduce the error.

Best,  
Stéphane.

---

<div class="post-metadata">

**Author:** ![Wenddy](https://forum.dynare.org/letter_avatar_proxy/v4/letter/w/dbc845/32.png) [@Wenddy](https://forum.dynare.org/u/Wenddy)\
**Post date:** [24 October 2018 08:12 UTC](https://forum.dynare.org/t/same-code-different-results-with-different-dynare-version/12660/6 "2018-10-24T08:12:42Z")

</div>

sorry  
[cookadjusted.mod](https://forum.dynare.org/uploads/default/original/2X/7/7126d0f9b36468c973394e216f0e7bd908604309.mod) (6.6 KB)  
[estdat.xls](https://forum.dynare.org/uploads/default/original/2X/a/a8299743c055a0c06470b409fb4d9bb7c5ab0f4a.xls) (16.4 KB)

---

<div class="post-metadata">

**Author:** ![stepan-a](https://forum.dynare.org/user_avatar/forum.dynare.org/stepan-a/32/6652_2.png) [@stepan-a](https://forum.dynare.org/u/stepan-a)\
**Post date:** [24 October 2018 08:18 UTC](https://forum.dynare.org/t/same-code-different-results-with-different-dynare-version/12660/7 "2018-10-24T08:18:08Z")

</div>

If you want to use a nonlinear filter, you need to add measurement errors on all the observed variables. Otherwise you will have a singularity issue.

Best,  
Stéphane.

---

<div class="post-metadata">

**Author:** ![Wenddy](https://forum.dynare.org/letter_avatar_proxy/v4/letter/w/dbc845/32.png) [@Wenddy](https://forum.dynare.org/u/Wenddy)\
**Post date:** [24 October 2018 09:45 UTC](https://forum.dynare.org/t/same-code-different-results-with-different-dynare-version/12660/8 "2018-10-24T09:45:51Z")

</div>

Thx,Stepan  
i add measurement errors on all the observed variables, but it comes out the same error messages.  
Update the mod-file[cookadjusted.mod](https://forum.dynare.org/uploads/default/original/2X/7/7126d0f9b36468c973394e216f0e7bd908604309.mod) (6.6 KB)
