Help with "MJDGGES returns the following error code5"

Dear Dynare people,

I have been trying to update a mod file I used to run with Dynare 3–it worked fine–but now (with Dynare 4) I keep getting the error code posted in the subject line.

Your help would be greatly appreciated.


Hi Rafael,

The error message is very unclear… The problem is that you cannot, with dynare version 4, assign values to the deep parameters by loading a mat file (because the preprocessor does not read the mat file). As a consequence M_.params, which should contain the values of the deep parameters, is filled with NaNs.

You have to specify explicitly the values of the deep parameters in the mod file. Another workaround is to replace:

load second_paper_params.mat;


load second_paper_params.mat;
for i=1:length(M_.params)
    deep_parameter_name = M_.param_names(i,:);
    eval('M_.params(i)  = ' deep_parameter_name ' ;'])

You have to remove the unused declared parameters phipi and kappam, otherwise the loop will crash.



Many thanks for your help, the code works fine now.


  • Rafael

Thanks a lot, it’s a very useful trick.