problem with curve tracking obtained by the genetic algorithm
    5 visualizaciones (últimos 30 días)
  
       Mostrar comentarios más antiguos
    
    Maisa Melo
 el 11 de Feb. de 2019
  
    
    
    
    
    Comentada: Maisa Melo
 el 11 de Feb. de 2019
            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?
0 comentarios
Respuesta aceptada
  John D'Errico
      
      
 el 11 de Feb. de 2019
        
      Editada: John D'Errico
      
      
 el 11 de Feb. de 2019
  
      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 comentarios
  John D'Errico
      
      
 el 11 de Feb. de 2019
				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.
Más respuestas (0)
Ver también
Categorías
				Más información sobre Genetic Algorithm 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!