Specify Objective Function Value as Tolerance

조회 수: 5 (최근 30일)
David
David 2015년 7월 24일
답변: Walter Roberson 2015년 7월 24일
E.g. I would like to specify that the optimization routine return a solution only if the objective function there is < 1e-12. Is there a way to include this tolerance in the problem setup? Using R2013b with global optimization toolbox.
  댓글 수: 2
Walter Roberson
Walter Roberson 2015년 7월 24일
Which optimization routine are you using?
David
David 2015년 7월 24일
I'm trying several, including fminunc, fmincon, GlobalSearch, and MultiStart. I didn't include which routine I'm using because I'd like to specify the tolerance in the problem setup, independent of the routine.

댓글을 달려면 로그인하십시오.

답변 (1개)

Walter Roberson
Walter Roberson 2015년 7월 24일
In particular TolFun is possibly what you are looking for.
However, before placing restrictions on the function value, keep in mind that there might not be anywhere within the defined range where the function returns a value that low, especially within the maximum number of iterations you have allowed. Trying to solve for @(x) x.^2+1 <= 1E-12 is going to take forever if you want it to keep going until it finds a solution that satisfies the constraint.
Even within a global optimizer that offers multiple starts, you can construct functions that have arbitrarily narrow "pits" where the function value is less than 1E-12. For example,
@(x) ~(x(:,1) == 0.90579193707561922455084868488484062254428863525390625 & x(:,2) == 0.12698681629350605515327288230764679610729217529296875)
will return 0 at exactly one floating point pair, and will be 1 everywhere else. You would not be able to find the right pair without enumerating every possible floating point value, which is roughly 2^64 * 2047/2048 possibilities per member . Before telling a minimizer to keep going until it meets a condition, you need to consider how hard it is going to be for that condition to be met, as you probably don't want your program running for a few decades trying to find a difficult case.

카테고리

Help CenterFile Exchange에서 Global or Multiple Starting Point Search에 대해 자세히 알아보기

태그

제품

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by