Parameter Optimization in an interval
5 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
htrh5
el 27 de Dic. de 2015
Comentada: htrh5
el 27 de Dic. de 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.
0 comentarios
Respuesta aceptada
Matt J
el 27 de Dic. de 2015
Editada: Matt J
el 27 de Dic. de 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.
Más respuestas (0)
Ver también
Categorías
Más información sobre Get Started with Optimization Toolbox en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!