フィルターのクリア

problem with curve tracking obtained by the genetic algorithm

2 ビュー (過去 30 日間)
Maisa Melo
Maisa Melo 2019 年 2 月 11 日
コメント済み: Maisa Melo 2019 年 2 月 11 日
Hello,
I'm running a genetic algorithm with linear inequality constraints:
gaoptions = gaoptimset('TolCon', 1e-12, 'TolFun', 1e-8, 'CrossoverFcn', @crossoverheuristic, 'MutationFcn',@mutationadaptfeasible, 'PopulationSize', 100, 'Generations', 200, 'InitialPopulation',U0');
U =ga(@(U0) funcaoObjetivo(QP,U0',n,auxPrevisoes,R,Riqueza,auxR1,tbBarra,C,D,r1,ci,Uant,peso1,peso2),m*(n+1),B,b,[],[],[],[],[],gaoptions);
I'm also running the same algorithm with fmincon optimization.
options = optimoptions(@fmincon,'Algorithm','sqp','TolFun',1e-12);
U = fmincon(@(U0) funcaoObjetivo(QP,U0,n,auxPrevisoes,R,Riqueza,auxR1,tbBarra,C,D,r1,ci,Uant,peso1,peso2),U0,B,b,[],[],[],[],[],options);
Both results must be equivalents however, the genetic algorithm is not able to achieve good solutions as fmincon does. The main objective is tracking a curve, the solutions obtained by fmincon get tracking the curve exactly (with small error), the solutions obtained by ga also get tracking the curve but with a big error. Do you know what can be my mistake?

採用された回答

John D'Errico
John D'Errico 2019 年 2 月 11 日
編集済み: John D'Errico 2019 年 2 月 11 日
It is not really a mistake, except perhaps a mistake of choice. Or you might say a mistake of understanding the tools involved.
GA is a stochastic algorithm. It is good at trying to not get stuck in a local minimum, while still trying to find the global solution. But it is not really that good at zeroing in on the exact solution. Or if you try to force it to do so, a stochastic optimizer will take a longer time to do so, because it will require many function evaluations.
Fmincon is designed to move down a smoothly structured surface, with rapid convergence when the solution is near. If you want, think of the quadratic convergence behavior of algorithms in the class of Newton's method.
Different algoithms have differing performance, and different things they do really well.
So you can have it either way, but you cannot so easily have the best of all worlds. Yes, I suppose you could use GA to do as well as it can in areasonable amount of time, then when it terminates, switch to fmincon to hone in on the solution.
  3 件のコメント
John D'Errico
John D'Errico 2019 年 2 月 11 日
AH. Thank you Alan. One thing I really need to do is learn the GO TB toolset. Harder since I do not have that TB.
Maisa Melo
Maisa Melo 2019 年 2 月 11 日
Thank you, everyone, to the help. I used the HybridFcn option as suggested. The result for ga optimization was a lot better than the result before.

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeGenetic Algorithm についてさらに検索

製品


リリース

R2015a

Community Treasure Hunt

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

Start Hunting!

Translated by