Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Thread Subject:
Some parameters in GA

Subject: Some parameters in GA

From: Sata

Date: 3 Dec, 2012 11:09:08

Message: 1 of 6

1) When I run the GA solver using the toolbox, is the objective function value the most critical output I have to monitor? When I run the GA repeatedly, do I have to record down other information for each run such as current iteration, reason for the optimization terminated and the final point?

2) Is there a standard reference of how many times we have to run for each set of parameter and then take the average of the objective function value?

3) For each run, the value for current iteration is different. How does this matter? Bigger value is better or smaller value is better. Is there an ideal value for current iteration? Do I have to do something to control the current iteration?

4) What is the meaning of this termination reason which was displayed at the results of toolbox “Optimization terminated: average change in the fitness value less than options.TolFun.”
 
5) If I need to repeat the same set of parameter for ten times by using the toolbox, do I have to manually run it ten times and manually record the objective function value for each run? Is there another way which I can set to run ten times at once and record ten objective function values at once?

6) Will the stopping criteria for the number of generation affect my results? E.g does it matter if I set the number of generation to be 200, 300 or 400 etc.

7) In the constrain option, if I don’t have any constraints, do I just put [] for both linear equalities and linear inequalities?

Subject: Some parameters in GA

From: Alan_Weiss

Date: 3 Dec, 2012 13:12:49

Message: 2 of 6

On 12/3/2012 6:09 AM, Sata wrote:
> 1) When I run the GA solver using the toolbox, is the objective
> function value the most critical output I have to monitor? When I run
> the GA repeatedly, do I have to record down other information for each
> run such as current iteration, reason for the optimization terminated
> and the final point?
> 2) Is there a standard reference of how many times we have to run for
> each set of parameter and then take the average of the objective
> function value?
> 3) For each run, the value for current iteration is different. How
> does this matter? Bigger value is better or smaller value is better.
> Is there an ideal value for current iteration? Do I have to do
> something to control the current iteration?
> 4) What is the meaning of this termination reason which was displayed
> at the results of toolbox “Optimization terminated: average change in
> the fitness value less than options.TolFun.”
> 5) If I need to repeat the same set of parameter for ten times by
> using the toolbox, do I have to manually run it ten times and manually
> record the objective function value for each run? Is there another
> way which I can set to run ten times at once and record ten objective
> function values at once?
> 6) Will the stopping criteria for the number of generation affect my
> results? E.g does it matter if I set the number of generation to be
> 200, 300 or 400 etc.
> 7) In the constrain option, if I don’t have any constraints, do I just
> put [] for both linear equalities and linear inequalities?

You would do well to read the documentation, then see if you are still
confused. Read the Concepts material in
http://www.mathworks.com/help/gads/genetic-algorithm.html
except for the Genetic Algorithm Options section. It won't take very
long, and should answer most or all of your questions.

Alan Weiss
MATLAB mathematical toolbox documentation

Subject: Some parameters in GA

From: Sata

Date: 3 Dec, 2012 14:59:08

Message: 3 of 6

Hi Alan,

I appreciate your reply. However, after reading the documentations, I am still in doubt about those questions I asked. It would be good if you can try to explain each of my questions. I am sure, with your answers, I will be much clearer. TQ.

Alan_Weiss <aweiss@mathworks.com> wrote in message <k9i8gh$jpl$1@newscl01ah.mathworks.com>...
> On 12/3/2012 6:09 AM, Sata wrote:
> > 1) When I run the GA solver using the toolbox, is the objective
> > function value the most critical output I have to monitor? When I run
> > the GA repeatedly, do I have to record down other information for each
> > run such as current iteration, reason for the optimization terminated
> > and the final point?
> > 2) Is there a standard reference of how many times we have to run for
> > each set of parameter and then take the average of the objective
> > function value?
> > 3) For each run, the value for current iteration is different. How
> > does this matter? Bigger value is better or smaller value is better.
> > Is there an ideal value for current iteration? Do I have to do
> > something to control the current iteration?
> > 4) What is the meaning of this termination reason which was displayed
> > at the results of toolbox “Optimization terminated: average change in
> > the fitness value less than options.TolFun.”
> > 5) If I need to repeat the same set of parameter for ten times by
> > using the toolbox, do I have to manually run it ten times and manually
> > record the objective function value for each run? Is there another
> > way which I can set to run ten times at once and record ten objective
> > function values at once?
> > 6) Will the stopping criteria for the number of generation affect my
> > results? E.g does it matter if I set the number of generation to be
> > 200, 300 or 400 etc.
> > 7) In the constrain option, if I don’t have any constraints, do I just
> > put [] for both linear equalities and linear inequalities?
>
> You would do well to read the documentation, then see if you are still
> confused. Read the Concepts material in
> http://www.mathworks.com/help/gads/genetic-algorithm.html
> except for the Genetic Algorithm Options section. It won't take very
> long, and should answer most or all of your questions.
>
> Alan Weiss
> MATLAB mathematical toolbox documentation

Subject: Some parameters in GA

From: Marc

Date: 8 Dec, 2012 06:50:21

Message: 4 of 6

"Sata" wrote in message <k9i18k$pmq$1@newscl01ah.mathworks.com>...
> 1) When I run the GA solver using the toolbox, is the objective function value the most critical output I have to monitor? When I run the GA repeatedly, do I have to record down other information for each run such as current iteration, reason for the optimization terminated and the final point?

Yes. You should record all the other information.
>
> 2) Is there a standard reference of how many times we have to run for each set of parameter and then take the average of the objective function value?

Yes. 2431.67

>
> 3) For each run, the value for current iteration is different. How does this matter? Bigger value is better or smaller value is better. Is there an ideal value for current iteration? Do I have to do something to control the current iteration?

There is an ideal value for the current iteration. It is 42, the "meaning of life".

>
> 4) What is the meaning of this termination reason which was displayed at the results of toolbox “Optimization terminated: average change in the fitness value less than options.TolFun.”

It means that the change in your fitness value was less than the value you assigned to TolFun.

>
> 5) If I need to repeat the same set of parameter for ten times by using the toolbox, do I have to manually run it ten times and manually record the objective function value for each run? Is there another way which I can set to run ten times at once and record ten objective function values at once?

Sure, you can do this manually or use a "For" loop.

>
> 6) Will the stopping criteria for the number of generation affect my results? E.g does it matter if I set the number of generation to be 200, 300 or 400 etc.

Yes, the stopping criteria will affect your results.

>
> 7) In the constrain option, if I don’t have any constraints, do I just put [] for both linear equalities and linear inequalities?

Yes

Subject: Some parameters in GA

From: Sata

Date: 11 Dec, 2012 10:37:08

Message: 5 of 6

I understand that “Optimization terminated: average change in the fitness value less than options.TolFun.” means that the change in my fitness value was less than the value I assigned to TolFun. My question is that is this termination criteria acceptable? Do I have to do anything to correct this optimization terminated such as to change the value assigned to TolFun or something else?

Secondly, in all the runs of optimization, definitely there will be a reason display for the optimization terminated right?

"Marc" wrote in message <k9unvd$ha4$1@newscl01ah.mathworks.com>...
> "Sata" wrote in message <k9i18k$pmq$1@newscl01ah.mathworks.com>...
> > 1) When I run the GA solver using the toolbox, is the objective function value the most critical output I have to monitor? When I run the GA repeatedly, do I have to record down other information for each run such as current iteration, reason for the optimization terminated and the final point?
>
> Yes. You should record all the other information.
> >
> > 2) Is there a standard reference of how many times we have to run for each set of parameter and then take the average of the objective function value?
>
> Yes. 2431.67
>
> >
> > 3) For each run, the value for current iteration is different. How does this matter? Bigger value is better or smaller value is better. Is there an ideal value for current iteration? Do I have to do something to control the current iteration?
>
> There is an ideal value for the current iteration. It is 42, the "meaning of life".
>
> >
> > 4) What is the meaning of this termination reason which was displayed at the results of toolbox “Optimization terminated: average change in the fitness value less than options.TolFun.”
>
> It means that the change in your fitness value was less than the value you assigned to TolFun.
>
> >
> > 5) If I need to repeat the same set of parameter for ten times by using the toolbox, do I have to manually run it ten times and manually record the objective function value for each run? Is there another way which I can set to run ten times at once and record ten objective function values at once?
>
> Sure, you can do this manually or use a "For" loop.
>
> >
> > 6) Will the stopping criteria for the number of generation affect my results? E.g does it matter if I set the number of generation to be 200, 300 or 400 etc.
>
> Yes, the stopping criteria will affect your results.
>
> >
> > 7) In the constrain option, if I don’t have any constraints, do I just put [] for both linear equalities and linear inequalities?
>
> Yes

Subject: Some parameters in GA

From: Marc

Date: 1 Feb, 2013 07:19:04

Message: 6 of 6

"Sata" wrote in message <ka72cj$q31$1@newscl01ah.mathworks.com>...
> I understand that “Optimization terminated: average change in the fitness value less than options.TolFun.” means that the change in my fitness value was less than the value I assigned to TolFun. My question is that is this termination criteria acceptable? Do I have to do anything to correct this optimization terminated such as to change the value assigned to TolFun or something else?
>
> Secondly, in all the runs of optimization, definitely there will be a reason display for the optimization terminated right?
>
> "Marc" wrote in message <k9unvd$ha4$1@newscl01ah.mathworks.com>...
> > "Sata" wrote in message <k9i18k$pmq$1@newscl01ah.mathworks.com>...
> > > 1) When I run the GA solver using the toolbox, is the objective function value the most critical output I have to monitor? When I run the GA repeatedly, do I have to record down other information for each run such as current iteration, reason for the optimization terminated and the final point?
> >
> > Yes. You should record all the other information.
> > >
> > > 2) Is there a standard reference of how many times we have to run for each set of parameter and then take the average of the objective function value?
> >
> > Yes. 2431.67
> >
> > >
> > > 3) For each run, the value for current iteration is different. How does this matter? Bigger value is better or smaller value is better. Is there an ideal value for current iteration? Do I have to do something to control the current iteration?
> >
> > There is an ideal value for the current iteration. It is 42, the "meaning of life".
> >
> > >
> > > 4) What is the meaning of this termination reason which was displayed at the results of toolbox “Optimization terminated: average change in the fitness value less than options.TolFun.”
> >
> > It means that the change in your fitness value was less than the value you assigned to TolFun.
> >
> > >
> > > 5) If I need to repeat the same set of parameter for ten times by using the toolbox, do I have to manually run it ten times and manually record the objective function value for each run? Is there another way which I can set to run ten times at once and record ten objective function values at once?
> >
> > Sure, you can do this manually or use a "For" loop.
> >
> > >
> > > 6) Will the stopping criteria for the number of generation affect my results? E.g does it matter if I set the number of generation to be 200, 300 or 400 etc.
> >
> > Yes, the stopping criteria will affect your results.
> >
> > >
> > > 7) In the constrain option, if I don’t have any constraints, do I just put [] for both linear equalities and linear inequalities?
> >
> > Yes

Top posting makes things confusing...

I have no idea if the termination is acceptable. I have no idea what your problem is. Mathematically, the termination is "valid". Does that mean it solves YOUR physical problem? No idea. Run the experiment in real life and see if things agree. If you do not have that option available to you, start asking you if the answers make sense.

To your second question, I must admit I do not understand what you are asking.

Tags for this Thread

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Contact us