Why does the searchmethod within patternsearch doesn't honor my constraint?

1 view (last 30 days)
Hello,
I'm using patternsearch with an additional searchmethod to find a global minimum on a rather big data set. I also impose some constraints to the optimization. However, the search method (searchneldermead), doesn't honor my constraints. So if the constraint is not met after running the searchmethod, pattern search starts all over again. As my optimization is very time-consuming, this is bad for two reasons: a) Patternsearch alone takes too much time and b) might end up in a local minimum. So here are my questions:
(How) Is it possible to add an constraint to the additional search routine, especially to the searchneldermead algorithm?
These are the options I chose:
hybrid_options = optimset('Diagnostics', 'off', 'Display','iter', TolFun', 1e-10, 'TolX', 1e-8, 'UseParallel', 'always','PlotFcns',{@optimplotfval ,@optimplotx});
options_ps = psoptimset('Display','iter','TolFun',1e-10,'TolX',1e-8,'TolMesh',1e-8,'TolCon',1e-10,'Vectorized','off',...
'MaxIter', 10000, 'PollMethod','GSSPositiveBasisNp1','UseParallel', 'always', 'CompletePoll','off','CompleteSearch','on','PlotFcns',{@psplotbestf,@psplotbestx},...
'Cache','on','InitialMeshSize',1,'MeshExpansion',2,'MeshContraction',0.5,'ScaleMesh','on','MeshAccelerator','on','SearchMethod', {@searchneldermead,1,hybrid_options});
[params,fval,exitflag,output]=patternsearch(objective,start,[],[],[],[],lb,ub,ConstraintFunction,options_ps);
If a constraint is not possible, which other algorithm would you recommend to run a constrained search for the global minimum? I already tried genetic algorithm, but this is too imprecise and takes too long.

Accepted Answer

Alan Weiss
Alan Weiss on 5 Aug 2013
The MATLAB fminsearch solver does not take any constraints; this is the Nelder-Mead search method, so it does not put constraints on the search.
I wonder why you want a search method at all. Why not just use the default patternsearch poll? If you need to search for a global minimum, you can start patternsearch from a variety of points. And if you want patternsearch to poll in parallel, you must turn CompletePoll on, otherwise it polls serially. If you don't want to poll in parallel, then I suggest that you turn cache on for an expensive objective or constraint function.
Good luck,
Alan Weiss
MATLAB mathematical toolbox documentation

More Answers (0)

Community Treasure Hunt

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

Start Hunting!