Quantcast
Channel: MATLAB Central Newsreader - tag:"optimization"
Viewing all articles
Browse latest Browse all 130

Re: Options for patternsearch

$
0
0
On 2/8/2017 2:15 PM, József Vass wrote:
> I am trying to figure out how to set a threshold for the function value,
> so that patternsearch would stop once the function value falls below
> that threshold. Normally this would be set with the 'ObjectiveLimit'
> option, but it doesn't work for patternsearch. Could you please advise?

Create an output function that halts the iterations once the current
function value is low enough. This should work:

function stop = myfun(optimvalues,~,~)
if optimvalues.fval < threshold % give a numeric value for threshold
     stop = true
else
     stop = false
end

See https://www.mathworks.com/help/gads/pattern-search-options.html#f14623

Alan Weiss
MATLAB mathematical toolbox documentation

Viewing all articles
Browse latest Browse all 130

Trending Articles