Hello,
I am using fmincon and I want to set the function tolerance and I thought that it meant that if |f(xi) – f(xi+1)| < TolFun the iterations stop. I thought here f was the objective function but is it actually the first order optimality measure?
I set my options as follows:
options = optimoptions(@fmincon,'Algorithm', 'sqp','Display','iter','OutputFcn',@outfun,'TolFun',1e-2);
options.FiniteDifferenceType='central';
options.AlwaysHonorConstraints='none';
And my results are
Local minimum found that satisfies the constraints.Optimization completed because the objective function is non-decreasing in feasible directions, to within the selected value of the optimality tolerance,and constraints are satisfied to within the default value of the constraint tolerance.<stopping criteria details>Elapsed time is 62.872469 seconds.Optimization completed: The relative first-order optimality measure, 4.994050e-03,is less than options.OptimalityTolerance = 1.000000e-02, and the relative maximum constraintviolation, 0.000000e+00, is less than options.ConstraintTolerance = 1.000000e-06.Optimization Metric Optionsrelative first-order optimality = 4.99e-03 OptimalityTolerance = 1e-02 (selected)relative max(constraint violation) = 0.00e+00 ConstraintTolerance = 1e-06 (default)
I don't really understand what the first order optimality is (I know what it represents) so I would like to apply my tolerance to the value of the objective function, how can I do this?
Best Answer