Error message: MJDGGES requires two square real matrices

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!

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

Best, Stéphane.

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…


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