Hey all,
What is MultiStart's behaviour, if the objective function of a StartPoint returns nan?
Suppose I define problem and MultiStart objects for 20 StartPoints:
min_fun = @(x) obj_function(x, t, modelStuff, data);
fopts = optimoptions('fmincon');
ms = MultiStart('UseParallel', true, 'StartPointsToRun', 'bounds');
prob = createOptimProblem('fmincon', 'objective', min_fun, 'x0', x0, 'lb', lb, 'ub', ub, options=fopts);
[myFit.x, myFit.f_val, myFit.exitflag, myFit.outpt, myFit.allmins] = run(ms, prob, 20);
When I run MultiStart on a problem, which returns nan, Matlab returns the following console output:
Objective function returned NaN; trying a new point...
Unfortunately I can not find any detailed description of what that means, neither in the documentation of MultiStart, nor the code of it itself. Does that message mean MultiStart tries another StartPoint instead, or just skip the current one and move on to the next StartPoint? Is the total number StartPoints evaluated "to the end" of whatever stopping criteria still the amount specified? Or does this message mean, that a StartPoint less than specified (20) was evaluated?
Why:
I am trying to fit parameters of a model to experimental data via MultiStart, to use parallel computation. To fit my parameters, I simulate a model dependant upon the input paramters and with the experimental data calculate a cost function / objective function to be minimized.
Some parameter combinations can result in infeasible simulations, that are valid numerically or mathematically speaking, but do not make physical sense. Unfortunately I can not just bound these parameters in a specific way to stay out of infeasible result domains, because they do not result in infeasible regions by themselves, only specific combinations of multiple parameters and their interactions do.
One approach I took so far is a short function called by the objective function to check the feasibilty of the simulation. If the simulation is not feasible, the objective funtion just returns nan. Should I maybe return a very high "cost" in this case instead?