problem with curve tracking obtained by the genetic algorithm

조회 수: 1 (최근 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 CenterFile Exchange에서 Genetic Algorithm에 대해 자세히 알아보기

제품


릴리스

R2015a

Community Treasure Hunt

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

Start Hunting!

Translated by