How can you tell if you have located the global minimum of your objective function? The short answer is that you cannot; you have no guarantee that the result of a Global Optimization Toolbox solver is a global optimum.
However, you can use the strategies in this section for investigating solutions.
Before you can determine if a purported solution is a global
minimum, first check that it is a local minimum. To do so, run
patternsearch on the problem.
To convert the
problem to use
problem.solver = 'patternsearch';
Also, change the start point to the solution you just found, and clear the options:
problem.x0 = x; problem.options = ;
For example, Check Nearby Points (Optimization Toolbox) shows the following:
options = optimoptions(@fmincon,'Algorithm','active-set'); ffun = @(x)(x(1)-(x(1)-x(2))^2); problem = createOptimProblem('fmincon', ... 'objective',ffun,'x0',[1/2 1/3], ... 'lb',[0 -1],'ub',[1 1],'options',options); [x,fval,exitflag] = fmincon(problem) x = 1.0e-007 * 0 0.1614 fval = -2.6059e-016 exitflag = 1
However, checking this purported solution with
that there is a better solution. Start
the reported solution
% set the candidate solution x as the start point problem.x0 = x; problem.solver = 'patternsearch'; problem.options = ; [xp,fvalp,exitflagp] = patternsearch(problem) Optimization terminated: mesh size less than options.MeshTolerance. xp = 1.0000 -1.0000 fvalp = -3.0000 exitflagp = 1
Suppose you have a smooth objective function in a bounded region.
Given enough time and start points,
locates a global solution.
Therefore, if you can bound the region where a global solution
can exist, you can obtain some degree of assurance that
the global solution.
For example, consider the function
The initial summands x6 + y6 force the function to become large and positive for large values of |x| or |y|. The components of the global minimum of the function must be within the bounds
–10 ≤ x,y ≤ 10,
since 106 is much larger than all the multiples of 104 that occur in the other summands of the function.
You can identify smaller bounds for this problem; for example, the global minimum is between –2 and 2. It is more important to identify reasonable bounds than it is to identify the best bounds.
To check whether there is a better solution to your problem,
MultiStart with additional start points. Use
GlobalSearch for this task because
not run the local solver from all start points.
For example, see Example: Searching for a Better Solution.
If you use
GlobalSearch on an unconstrained
problem, change your
problem structure before using
You have two choices in updating a
for an unconstrained problem using
solver field to
problem.solver = 'fminunc';
To avoid a warning if your objective function does not compute
a gradient, change the local
options to have
problem.options.Algorithm = 'quasi-newton';
Add an artificial constraint, retaining
the local solver:
problem.lb = -Inf(size(x0));
To search a larger region than the default, see Refine Start Points.