optimization based upon another optimization

1 visualizzazione (ultimi 30 giorni)
Leon Stolp
Leon Stolp il 14 Mag 2020
Modificato: Matt J il 14 Mag 2020
Hello,
I'm trying to figure out if its possible to base one optimization upon another.
I have a function that I want to minimize and then another function that uses the first Results from the first function as an Input. Everything is supposed to use globalSearch and fmincon.
In a perfect world I would like to make this happen in one script and with one input vector. Is this possible at all? I looked around the Documentation for a while but didn't find what I was looking for. Has somebody a hint?
Best wishes,
Leon

Risposte (1)

Matt J
Matt J il 14 Mag 2020
Modificato: Matt J il 14 Mag 2020
You can write anything you want inside the code for your objective function, including other optimization processes. However, fmincon assumes that the objective function and constraints are differentiable. Generally speaking, the optimum point and value of an inner optimization process will often not vary differentiably with the unknown parameters. To be reliable, therefore, the outer optimization would have to use a solver that does not utilize derivatives. That could be fminsearch if you have a small number of unknowns ... otherwise ga or one of the other non-derivative based solvers in the Global Optimization Toolbox.
  2 Commenti
Leon Stolp
Leon Stolp il 14 Mag 2020
That makes sense to me. So it would propably be a better idea to assign the results from the first optimization to new variables and use them as input for the second one?
Matt J
Matt J il 14 Mag 2020
Modificato: Matt J il 14 Mag 2020
I'm not seeing how that's different from what your original question describes. If the results of the first optimization are independent of the unknown variables in your second optimization, then you would simply use the result of the first optimization as a fixed parameter in the second optimization, using techniques discussed here:

Accedi per commentare.

Community Treasure Hunt

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

Start Hunting!

Translated by