From the above analysis, it can be seen that the ANN model is suitable for forecasting economic data series. However, the ANN model has many problems. To solve those problems, a hybrid intelligent model of ANN optimized using HHO (called HHO-ANN) is proposed here.
4.1. Harris Hawks Optimization (HHO)
HHO [
50] is a new intelligence optimization algorithm inspired by the predation behavior of groups of Harris hawks. In a group of Harris hawks, during their predation process, some Harris hawks pounce on the prey from all directions, and the prey instinctively escapes through various methods. Correspondingly, the Harris hawks use various methods to chase the prey. Therefore, in HHO, based on the escape energy of the prey, different location update strategies are applied in three stages to simulate the searching and hunting characteristics of the Harris hawks. The location update strategies in the three stages are explained as follows.
4.1.1. Searching Stage
In this stage, the random location update strategy is applied. For this strategy, based on the random number (q) generated in the range of [0, 1], the location updates of the Harris hawk individuals are as follows.
If
, the position of the Harris hawk individual is updated as
Otherwise, the position of the Harris hawk individual is updated as
where
X(
t) and
X(
t + 1) are the positions of the Harris hawk individual at the current and the next iteration.
t is the number of iterations.
is the position of a randomly selected Harris hawk individual.
is the position of the prey (the individual with the best fitness value).
are the random numbers in the range of [0, 1].
ub and
lb are the upper and lower bounds of the searching scope.
is the average position of the Harris hawks group, which is
where
is the position of individual
k and
M is the population size of the Harris hawks.
4.1.2. Searching and Hunting Conversion Stage
In this stage, according to the escape energy of the prey (
E), the HHO switches between the searching and hunting stages. The escape energy of the prey (
E) is defined as
where
E0 is the initial escape energy of the prey, which is a random number in the range of [−1, 1].
T is the maximum number of iterations.
If the absolute value of the escape energy () is larger than or equal to 1, the HHO switches to the searching stage. Otherwise, the HHO switches to the hunting stage.
4.1.3. Hunting Stage
In this stage, according to the absolute value of the escape energy () and one random number (r) in the range of [0, 1], different location update strategies are used, which are the following.
(1) If
and
, the location update strategy is described as
where
J is one random number in the range of [0, 2].
is the difference between the prey’s position and the current individual’s position, which is
(2) If
and
, the location update strategy is described as
(3) If
and
, the location update strategy is described as
where
is the fitness function.
Y and
Z can be described as
where
DIM is the dimension of the solved problem.
S is a random vector whose dimension is
DIM, in which the vector elements are the random numbers in the range of [0, 1].
LF(
DIM) is the Levy flight vector whose dimension is
DIM, which is described as
where
u and
v are the standard normal distribution random numbers whose dimensions are
DIM.
c is one constant which is 1.5.
can be described as
where
is the Gamma function, which is
.
(4) If
and
, the location update strategy is described as
where
can be described as
Because HHO can search for the global optimum without the complex controlling parameters with a flexible algorithm structure and strong optimization performance, it was chosen for application. The detailed processes of HHO are as follows.
- (1)
Parameter initiation
The initial parameters of HHO, such as population size and maximum number of iterations, should be provided beforehand.
- (2)
Creation of initial population
In the HHO, the initial population is randomly generated in the solution space.
- (3)
Computation of fitness value
By using the fitness function from the solved problem, the fitness values for all the initial Harris hawk individuals can be obtained.
- (4)
Selection of prey
The Harris hawk individual whose fitness value is the best is selected as the prey.
- (5)
Location updating
According to the escape energy of the prey and the generated random numbers q and r, the different location update strategies are applied for all Harris hawk individuals, and the new Harris hawk population can be generated.
- (6)
Updating prey
If the fitness value of the best individual of the new Harris hawk population is better than the fitness value of the current prey, the current prey is replaced by the best individual.
- (7)
Termination criterion
In the original HHO, the termination criterion is the maximum number of iterations. However, using this criterion, the convergence of the algorithm relies on the maximum number of iterations and affects the computing efficiency. Therefore, here, new termination criteria were applied, which are as follows. The main termination condition was the amount of iterations performed without replacing the current prey. In this study, the number of iterations was five, determined via experience and test. Moreover, to avoid infinite iterations, a secondary condition, the maximum number of iterations, was also used.
- (8)
Output results
If the termination conditions are not satisfied, the process returns to step (5). Otherwise, the process is over, and at this time, the fitness value and the location of the prey are output.
The flow chart of the HHO is shown in
Figure 1.
4.2. New Hybrid Intelligent Model
To predict economic data using ANN, the first step is to construct the training samples. This process is described as follows.
Suppose the economic data series is {
x(
i),
i = 1, 2, …,
n}. If the numbers of the input and output neurons are
ni and
no, respectively, the number of the training samples is
n−
ni−
no + 1. The constructed training samples can be obtained as shown in
Table 3.
Generally, parameter
no is the forecasting step, which can be easily determined based on experience. Therefore, to construct the samples, it is important to select parameter
ni. When determining the ANN structure, apart from the number of input neurons, the hidden-layer structure (the number of layers and neuron numbers in each layer) should be determined too. Because the computing results of ANN are significantly affected by its structure, it is critical and very difficult to determine the suitable ANN structure in advance. Therefore, the intelligent optimization method HHO was used to select the suitable ANN structure, which includes the number of input neurons, the number of layers, and the neuron numbers of each layer. Generally, the traditional BP algorithm is used to optimize the weights and thresholds of the ANN model. However, this kind of algorithm has some shortcomings, such as premature convergence, etc. To improve this method, here, the HHO was also used to optimize the weights and thresholds of the ANN model. Moreover, to improve the performance of the original ANN model, the new neuron activation function called the Softplus function was applied, which is expressed as follows:
This function, which is the primitive function of the logistic sigmoid function and can be taken as the smoothed or “softened” version of Rectified Linear Units (max(1, z)), is closer to the activation model of real brain neurons.
Therefore, for the new hybrid intelligent model in this study, there are three structure parameters (the number of input neurons, the number of hidden layers, and the number of hidden-layer neurons), and the weights and thresholds of ANN are determined using the HHO. Here, the full-linking network [
51] is used to make the hybrid intelligent model as simple as possible.
The detailed steps of the proposed hybrid intelligent model’s process are as follows.
(1) The initial search ranges for the three structure parameters of ANN (the number of input neurons, the number of hidden layers, and the number of hidden-layer neurons) and the initial controlling parameters of the new hybrid intelligent model (maximum number of iterations, population size, and the number of output neurons of ANN) are all determined beforehand.
It should be noted that the initial conditions include the structure parameters of the ANN (number of input neurons, number of hidden layers, number of hidden-layer neurons, and number of output neurons) and the parameters of HHO (maximum number of iterations and population size). For the four structure parameters of ANN, only the search ranges of three of them (number of input neurons, number of hidden layers, and number of hidden-layer neurons) should be provided, as these only slightly affect the computing efficiency and do not affect the computing results. Additionally, the number of output neurons can be determined easily based on real economic data, and it only slightly affects the computing results and computing efficiency. Finally, the two parameters of HHO, which can be determined easily according to experience, also slightly affect the computing efficiency and computing results. Because the effect of those initial conditions on the computing results is not significant, in this study, they were determined according to experience and our tests.
(2) By using three randomly generated structure parameters in their search ranges and the given number of output neurons, one individual that represents one specific ANN structure can be obtained. Moreover, based on some randomly generated individuals whose number is the given population size, the initial population is created. Finally, it should be pointed out that for the generated individual, the fixed relationship between the number of hidden-layer neurons and the hidden layer is applied, which is determined beforehand.
(3) The fitness value of each created individual is computed using the following method.
a. Based on the economic data series, using the method described in
Table 3, the learning samples can be generated. The samples are then divided into training samples (80% of the total samples) and testing samples (20% of the total samples).
b. The initial linking weights and thresholds of this specific ANN structure are randomly generated; thus, one ANN model is obtained. This process is repeated to generate a group of ANN models with the same structure whose number equals the population size of the HHO.
c. In the generated initial group of ANN models, each ANN model is trained using the training samples, and thus the square error (E) of the testing samples is taken as the fitness value.
d. For the initial generated group of ANN models, the individual with the best fitness value is selected as the prey.
e. According to the HHO, different location update strategies are used to adjust the linking weights and thresholds of each ANN model in the generated group of ANN models; then, a new group of ANN models can be created.
f. In the new group of ANN models, each ANN model is trained; thus, the square error (E) of the testing samples is taken as the fitness value.
g. For the newly generated group of ANN models, the prey is updated.
h. If the termination criteria of HHO are not reached, the computing process returns to step e. Otherwise, the fitness value of the final prey is the fitness value of the created individual.
(4) The individual whose fitness is the best is selected as the prey.
(5) According to the HHO, different location update strategies are used for each individual, and a new individual can be generated.
(6) The fitness values of each new individual are calculated using the method described in step (3). The new population can then be generated.
(7) The prey is updated.
(8) If the termination criteria of the HHO are reached, the algorithm stops. At this time, the prey which is the best individual in the current population is selected as the suitable HHO-ANN model for economic data forecasting.
The flow chart of the new hybrid intelligent model for economic data forecasting is shown in
Figure 2.
It must be noted that, because the hybrid intelligence model is based on the ANN model, the proposed new hybrid intelligence model can be used to predict any kind of economic data. However, compared with the previous hybrid intelligent models, the new hybrid model considers both aspects of ANN models, which makes it easy to implement, and its initial parameters can be determined easily because their numbers are as small as possible.