Matlab Global Optimization Toolbox

Hi,

When I try to access the various mode_compute methods that use the Matlab Global Optimization Toolbox (such as mode_compute=12), I receive the error

“Error using dynare_minimize_objective (line 427)
Option mode_compute=12 requires the Global Optimization Toolbox”

I confirmed with Matlab tech support that I do indeed have the correct Global Optimization Toolbox license and that the toolbox is working correctly.

The problem seems to arise from the “dynare_minimize_objective” function where the various cases (such as case 12 on line 423) that use the Global Optimization Toolbox call the user-defined function user_has_matlab_license() with the argument “global_optimization_toolbox”, which in that function on line 34 is then used in the Matlab function “[hasLicense, ~] = license(‘checkout’,toolbox);” as “toolbox”.

According to Matlab, the toolbox name must match the name in the user’s Matlab license file, which for the the Global Optimization Toolbox is “GADS_Toolbox”. Indeed, if I evaluate license() using this name, I get

hasLicense=license(‘checkout’,‘GADS_Toolbox’)

hasLicense =

 1

Is there some intermediate setup step that I am missing in order to make the mapping between the toolbox name in my license and the dynare code?

FYI, I am running Dynare 4.6.3 on Matlab R2020b.

Thanks!

1 Like

I second that question, as I seem to face the same constraint. Also I am on Ubuntu, maybe this has something to do as well.

Best

1 Like

As a short-term work-around, I modified the dynare_minimize_objective.m function (contained in the Dynare installation directory (in Windows at least) under dynare>4.6.3>matlab>optimization) as follows:

Under “Case 12 (or whichever other mode_compute method uses the Global Opt Toolbox)”, comment out the line
“elseif ~user_has_matlab_license(‘global_optimization_toolbox’)”
and replace it with
"elseif ~user_has_matlab_license(‘GADS_Toolbox’) ".

It seems to work for me, but I have no idea if this will cause any other issues, so proceed with caution!

This is a known bug that has been fixed in the unstable version and Dynare 4.6.4 to be released soon. See Known bugs present in the current stable version · Wiki · Dynare / dynare · GitLab

2 Likes