Page 1 of 1

Help with "MJDGGES returns the following error code5"

PostPosted: Wed May 20, 2009 7:45 pm
by Rafael
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.

Regards,

- Rafael

Re: Help with "MJDGGES returns the following error code5"

PostPosted: Tue May 26, 2009 8:40 am
by StephaneAdjemian
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:

Code: Select all
load second_paper_params.mat;


by

Code: Select all
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 ' ;'])
end


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

Best,
Stéphane.

Re: Help with "MJDGGES returns the following error code5"

PostPosted: Wed May 27, 2009 7:37 pm
by Rafael
Stéphane,

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

Regards,

- Rafael

Re: Help with "MJDGGES returns the following error code5"

PostPosted: Sat Aug 01, 2009 12:37 pm
by Dubs
Thanks a lot, it's a very useful trick.