Genetic Algorithm (Plot Function)

조회 수: 6 (최근 30일)
Joe
Joe 2016년 2월 27일
답변: Cam Salzberger 2016년 3월 1일
Hi,
I set up an genetic algorithm for running a curve fitting process in order to identify the parameters (a,b,c) of a model equation. The model equation should later predict the experimental data depending on variables (x,y,z).
I used the sum of squares as my objective function:
sse = sum(power(ExperimentalData - ModelOutput,2));
Now I like to observe the actual function (ModelOutput) whiles the algorithm runs using the parameters (design variables) which the algorithm finds at each iteration.
Can someone help me to create such a Plot function which I could include in the GA options (gaoptimset)? I don`t really know which values are availible during the iterations and how I can access them. My initial idea was just to create a function file which includes my model function. This function file gets the parameters plus a range for the variables x,y,z (eg. x =[0:0.001:5]; y =[0:0.001:2]; z =[0:0.001:7])
and the experimental data as an input in order to visualize how the model prediction would look like compared to the experimental data.
How could a solution look like?
I´m looking forward to somebody helping me out with this problem.
Best regards Joe
  댓글 수: 1
Joe
Joe 2016년 2월 29일
Is there anyone who can help me?

댓글을 달려면 로그인하십시오.

답변 (1개)

Cam Salzberger
Cam Salzberger 2016년 3월 1일
Hello Joe,
I understand that you are looking to plot the current output of the model as the genetic algorithm is running. I believe that you will find the 'PlotFcns' property, that can be set with "gaoptimset", to be the most useful. There are a variety of built-in plotting functions. Of them, I believe that the "Best individual" function (@gaplotbestindiv) is what you would like to see. You can also create a custom function, and pass its handle to that property. Custom functions should match the format shown here.
I hope this helps!
-Cam

카테고리

Help CenterFile Exchange에서 Genetic Algorithm에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by