GA is nowadays one of the most popular stochastic optimization techniques which is inspired by natural genetics and biological evolutionary process. It is supposed that individuals with more adaptability in current generation would have better capability of survival and breeding in the next generation. One of the most important advantages of GA is that it can make use of the limited searching processes to automatically find the optimal or near-optimal result in the solution space. Compared with the classical optimization algorithms, GA has such features as follows [17].
-
(1)
GA starts from multipoints instead of one point. Thereby, it could effectively prevent the searching processes from stopping in local optimum solutions.
-
(2)
The optimization rule of GA is varied. It is determined by probability.
-
(3)
The fitness is calculated only from object function. No other information is necessary.
-
(4)
It automatically seeks the optimal result in the whole solution space.
-
(5)
The calculation is relatively simple.
GA evaluates a population and generates a new one iteratively, with each successive population referred to as a generation. Assume the current generation
is
. After applying a set of genetic operations, the GA generates a new generation
based on the previous generation. Three basic operators are used to manipulate the genetic composition of a population: selection, crossover, and mutation [17].
The detailed implementation of the proposed method is given as follows.
Fitness Function
In order to perform GA, it is very important to define an appropriate fitness function. In GA, the probability of individual survival to the next generation depends on its fitness value. The greater the fitness value of an individual, the greater probability it has to inherit to the next generation. In this paper, the fitness function is constructed by the operation of getting the absolute value on the nonlinear function (7)
where
is the observed signal.
Generation of the Initial Group
Commonly in GA, the initial population is randomly generated. The real-coded GA is adopted in this paper. The length of chromosome graph is set as 3. The first two genes denote the frequency pairs and the third gene denotes the fitness value.
The performance of GA is influenced heavily by the population size. GA may run the risk of serious under-covering of the solution space and result in a local optimum when the population size is relatively small, whereas GA would increase the computational load when the population size is relatively large. Consequently, the population size should be chosen according to the problem scale.
Selection
The operation is to choose the good individual and get rid of the bad one from the group. The larger the fitness, the larger probability the individual has to be selected. To achieve this, the roulette wheel selection is used. The fitness of the
th individual is denoted as
. The selection probability of the
th individual is computed as
. At the same time, we reserve the best individual to the next population.
Crossover
The crossover is to exchange some parts of an individual with corresponding parts of another. The crossover is performed in the following way. Assume that
and
are pairs of parent chromosome, whether to crossover or not depends on the crossover probability
. The result of crossover is
where
is a uniformly distributed random number in
.
Mutation
The mutation operator adopts "Nonuniform Mutation" [18]. Compared with the classical uniform mutation operator, this operator has the advantage of making fewer changes on the genes with the number of generations increasing. This property makes the tradeoff between exploration and exploitation. It is more favorable to have exploration in the early stages of the algorithm, while exploitation becomes of greater importance when the obtained solution is closer to the optimal solution. The mutation can be completed in the following way: assuming
is the
th component of the individual
, the mutation probability
determines whether to mutate or not. The result of mutation is
where positive number
controls the dependence degree of random fluctuation to evolution number
and
are uniformly distributed as random numbers on the interval
.
is the largest evolution number.
Condition to Terminate the GA Iterations
When the number of generation reaches
, the iterations would be terminated.
In this paper, we seek all the optimal solutions of nonlinear function
, including local optimal solutions and global optimal solutions. However, the simple genetic algorithm is unable to get all optimal solutions. According to the niche phenomenon in nature [19, 20], a niche GA-based method is proposed to estimate harmonic frequencies. A niche in nature can be viewed as a subspace in the environment. Accordingly, a niche is commonly thought as a peak of the fitness function. The niche techniques gather the individuals on several peaks of fitness function in the population according to genetic likeness. The structure of a niche is implemented by decreasing the fitness value of the individual. The concrete method is implemented by calculating the Euclidean distance between parent individual and arbitrary other child individual and then judging whether two individuals are in the circle defined by estimating niche radius
. Compare with simple GA, niche GA can find more than one optima during evolution. The basic steps of the algorithm are given as follows.
-
(1)
Set the generation number
. Create an initial population which includes
individuals and evaluate their fitness.
-
(2)
Sort the population according to their fitness and memorize the first
individuals.
-
(3)
Produce a new population through selection, crossover and mutation.
-
(4)
Evaluate the fitness of every new individual.
-
(5)
Keep the
individuals from step 3 and
memorial individuals from step 2. Evaluate the distanced between each two of them. Introduce a penalty
to the individual with lower fitness when
.
-
(6)
Combine the
individuals with the
individuals. Sort the
individuals according to their fitness. Save the first
individuals and the first
individuals.
-
(7)
Set
and repeat steps 3–6 until
.