# Error message: MJDGGES requires two square real matrices

**URL:** <https://forum.dynare.org/t/error-message-mjdgges-requires-two-square-real-matrices/983>\
**Category:** Dynare v4 (legacy)\
**Created:** [25 March 2009 21:21 UTC](https://forum.dynare.org/t/error-message-mjdgges-requires-two-square-real-matrices/983 "2009-03-25T21:21:20Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![olena7](https://forum.dynare.org/letter_avatar_proxy/v4/letter/o/ecb155/32.png) [@olena7](https://forum.dynare.org/u/olena7)\
**Post date:** [25 March 2009 21:21 UTC](https://forum.dynare.org/t/error-message-mjdgges-requires-two-square-real-matrices/983/1 "2009-03-25T21:21:20Z")

</div>

Hi,  
I am getting the following error message during the system stability check (command “check”):

??? Error using ==\> mjdgges  
MJDGGES requires two square real matrices of the same dimension.

One of the earlier posts on this topic suggested that one of the model parameters may be uninitialized - I have checked to make sure they they all are defined and spelled correctly (case-sensitive). The error is still here.  
Can anyone tell me what else might be causing this error message? (I am using Dynare 4.0.3)  
Thank you!  
Olena

---

<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:** [25 March 2009 22:09 UTC](https://forum.dynare.org/t/error-message-mjdgges-requires-two-square-real-matrices/983/2 "2009-03-25T22:09:48Z")

</div>

Hi, Did you check if your steady state is real (I mean not complex) ?

Best, Stéphane.

---

<div class="post-metadata">

**Author:** ![JamieHall](https://forum.dynare.org/letter_avatar_proxy/v4/letter/j/3ec8ea/32.png) [@JamieHall](https://forum.dynare.org/u/JamieHall)\
**Post date:** [25 March 2009 22:59 UTC](https://forum.dynare.org/t/error-message-mjdgges-requires-two-square-real-matrices/983/3 "2009-03-25T22:59:03Z")

</div>

Hi Olena,

There’s a trick you can do with the Matlab debugger that often helps to pin down where the error is happening. If your mod file is called “example.mod”, then include “dbstop in example\_static.m at 14;” in the mod file before the “steady” line. When you run Dynare, it should stop at the start of “example\_static”; set a breakpoint at the line “if ~isreal(residual)”, and run to that point (by hitting F5, or using the Debug menu).

If there’s an MJDGGES problem, it often shows up at this point, in the form of NaN or Inf values in the “residual” variable. Each element of “residual” corresponds to one of your model’s equations, in the order that they appear in the mod file.

Hope that helps…

Jamie

---

<div class="post-metadata">

**Author:** ![olena7](https://forum.dynare.org/letter_avatar_proxy/v4/letter/o/ecb155/32.png) [@olena7](https://forum.dynare.org/u/olena7)\
**Post date:** [27 March 2009 18:47 UTC](https://forum.dynare.org/t/error-message-mjdgges-requires-two-square-real-matrices/983/4 "2009-03-27T18:47:29Z")

</div>

Thank you, Jamie and Stephanie.  
Now that I understand what the error message means, it was fairly easy to fix the problem!

---

<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:** [24 July 2017 13:29 UTC](https://forum.dynare.org/t/error-message-mjdgges-requires-two-square-real-matrices/983/5 "2017-07-24T13:29:00Z")

</div>

Closed on 24 July 2017 13:29 UTC



---

<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:** [24 July 2017 13:29 UTC](https://forum.dynare.org/t/error-message-mjdgges-requires-two-square-real-matrices/983/6 "2017-07-24T13:29:47Z")

</div>

Archived on 24 July 2017 13:29 UTC


