Effacer les filtres
Effacer les filtres

Parameter Optimization in an interval

1 vue (au cours des 30 derniers jours)
htrh5
htrh5 le 27 Déc 2015
Commenté : htrh5 le 27 Déc 2015
I have a scoring function asd that takes 4 parameters. Normally this works:
[m n]=fminsearch(asd,[40,40,0.04,0.75] , ...
optimset('MaxFunEvals',4000000,'MaxIter',4000000));
This gives the actual answer, the best possible point
However if I choose the starting point differently:
[m n]=fminsearch(asd,[10,100,0.04,0.75] ,...
optimset('MaxFunEvals',4000000,'MaxIter',4000000))
The optimizer just gives up and finds a non optimal solution. How do I make sure all the values within a certain interval are considered. It would be far more useful if I could specify a [lower bound, starting position, upper bound] for each parameter.

Réponse acceptée

Matt J
Matt J le 27 Déc 2015
Modifié(e) : Matt J le 27 Déc 2015
No solver can consider all values in a certain interval. However, you can use NDGRID to generate a 4D lattice of discrete sample points on the bounded region you're interested in. You could then exhaustively test the values of the objective function at all points on this lattice for its global minimum. Then, feed that result as the initial guess to fminsearch to minimize over continuous space. Depending on how finely you sample, you should get a much more reliable initial guess of the continuous-space global minimum that way. Of course, you also have to choose the sampling fineness to make the trade-off in computational expense reasonable...
If asd() is smooth, you should also consider using an Optimization Toolbox solver, if you have access to it. The performance of fminsearch deteriorates as the number of unknown variables increases. Four unknowns isn't so bad, but the Optimization Toolbox functions would have more robust performance. The Optimization Toolbox solvers, like fmincon, also let you specify bounds. This is no guarantee that all points in the bounded region will be considered, but it is a guarantee (within numerical tolerances) that points outside will not be considered.
  1 commentaire
htrh5
htrh5 le 27 Déc 2015
that was helpful, thanks

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur Get Started with Optimization Toolbox dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by