An evolutionary hybrid method to predict pistachio price

Pistachio produce is of great importance in the world and considered as a valuable agricultural produce. This product is important for the economy of the producing countries as well as other importer countries. In this regard, countries which are capable of getting control over this product’s market would obtain considerable benefits; one way to do so is predicting market trend or the price of this product and the affecting factors. In this survey, initially, the affecting parameters on pistachio price are identified. Then, using a novel combined intelligent method, the price of this product is predicted. In addition, using analysis of variance method, the results of the proposed method are compared to other intelligent combined methods, such as Feed Forward-Particle Swarm Optimization, Elman- Imperialist Competitive Algorithm, Feed Forward-Imperialist Competitive Algorithm, Elman-Genetic Algorithm, and Feed Forward-Genetic Algorithm. The results of the mentioned comparison indicate that the proposed method owns an excellent performance.


Introduction
Nowadays, managers' success in various decision-making conditions and the identification of the future events for better decision-making requires a methodology to predict these events and obtain a better estimate. The economic decisionmaking to achieve the maximum benefit is regarded as one of management success determinants. Since prediction is the process to forecast almost near future [1], therefore, using methods which result in less error prediction has a broad application in many fields. In the recent decade, global market of agricultural produce has experienced significant fluctuations; as in some cases, considerable amount instability was observed.
The aforementioned issue may be intensified in some countries due to the currency instability which is dramatic in case of US dollar. These fluctuations can be extremely harmful for the developing countries' stable benefits-resulted from export, and consequently, may lead to some problems in paying off their debts and growth [2]. Pistachio produce has a great importance and high value in agricultural and economic sectors of the producing countries. In recent years, those countries, capable to dominate the pistachio market, using great mass production, have gained considerable benefit.
There are several methods to model and predict time series; the traditional-statistical methods which introduce linear predictions for future values of the variables, such as: Moving Average, Weighted Average, ARIMA, Regression Method, Markov Chain, Neural Networks, and etc. Despite some advantages, linear methods face some limitations like incapability to work with non-linear relations. To compensate this shortcoming, several non-linear methods have been suggested. In addition, in recent years, artificial neural networks have been employed to predict time series. One of the most important advantages of neural networks is their flexibility in prediction of different types of non-linear models. These networks are inspired by human neural network and brain; therefore, they have better efficiency compared to other mentioned methods in different problems. Some of the studies conducted on economic dimensions of pistachio are: Moshiri and Cemeron reviewed advantages of neural networks over econometric models and compared Back-Propagation Artificial Neural Network (BPN) model with statistic and econometric models [3]. Their results showed that BPN model is capable of excellent prediction. Olson and Mossman compared error back-propagation neural network method with Logit model and Ordinary Least Square methods [4]. The results show that the neural network model is more accurate and possesses lower error. In a study, Chen claimed that currency fluctuations of China's agricultural export have had a positive effect on Japan [5]. Abolagba et al. evaluated the export of agricultural products [6]. In their study, the effective factors on agricultural produce export with Ordinary Least Square regression method (OLS) was estimated, regarding variables of product amount, export amount, and currency rate, production price, and the amount of domestic and national consumption. In a study, Zheng et al. investigated the role of US in the global production and pistachio business as well as affecting factors on the US's demand of pistachio export [7]. Results of this study indicated that, using advanced technologies and higher food standards, US pistachio production was able to increase its rank in the global markets. In a case study by Yazdani, risk management tools of pistachio farmers were discussed. Sirjan city is one of the main pistachio producers in Kerman which itself is a very significant pistachio producer province in Iran. The author mentioned and analyzed 144 dangers that farmers face while producing pistachio. The results indicate that: use poisons before damage (3.55), use risk management tools before damage (3.52), do not using new products (3.21), agricultural insurance (2.85) has the highest preference on risk management tools. In addition, stepwise regression results show these three factors: family members, Education, and age of farmers approximately 67% effect on risk management tools [8]. Tohidi et al. represented the hybrid artificial neural network-panel data method to predict the price of pistachio, raisin, and date exports. The results show that the novel artificial hybrid neural network-panel data method has a better performance in the prediction of the price of Iran's pistachio, raisin, and date exports than that of the regression method. Thus, it is proposed that exporters, policy makers, and researchers use this method to predict economic variables [9].
Based on the previous conducted studies about pistachio, there has been no study on pistachio price prediction. In this study, two methods are used to determine the effective parameters on pistachio price. In addition, a new hybrid method (El-PSO) is used to predict the price of pistachio . The results  of the suggested method were compared with other combined  methods, such as El-GA, El-ICA, FF-PSO, FF-GA, and FF-ICA. It was pointed out the proposed method has an excellent  performance and a relatively negligible error. This investigation is organized as follows: "Data and methods" explains the methods to determine correlation coefficient. Intelligent methods are illustrated in the next section. The proposed method for prime cost is explained further. "Numerical results" and "Conclusion" present the study's results of the proposed intelligent combined methods, their comparison, and a general conclusion of this investigation, respectively.

Data and methods
Nowadays, due to economic crisis, fluctuation in currency rate, and inflation rate, it is difficult to predict the produce's price; in addition, the identification of the influential parameters has its own complexity.

Pearson correlation
Correlation method is employed as a statistic tool to measure the state of the relation between variables. Several correlation methods exist to determine the effects of variables on each other. One of the most common of all is Pearson correlation coefficient, because when there is a linear relation between Fig. 1 Parameters affecting pistachio price two variables, Pearson correlation coefficient shows a high sensitivity [10][11][12]. Pearson correlation coefficient measures the relationship between two variables by dividing the covariance of the two variables by their standard deviation [13]. The correlation coefficient ρ X,Y between two random variables X and Y , with expected value of μ X , μ Y , and standard deviation σ X σ Y is calculated as: where E is the expected value, Cov is the covariance, σ is the standard deviation, and Corr stands for Pearson correlation coefficient.

Mutual information
Based on the following definitions and equations, the effect of two variables on each other can be specified.
Definition 1 MI between two the discrete random variables of X and Y regarding the distribution of p(x, y) is simultaneously and collectively obtained as follows [14]: In addition, it should be considered that an appropriate MI is in arguments as follows [15]: Definition 2 MI between two continuous random variables of X and Y is obtained by p.d. f , f (x, y) as follows [15]: The coefficient of the selected parameters All parameters, already introduced to predict pistachio price, are evaluated and their effectiveness is studied, using two suggested methods. Table 1 shows the influence of the introduced parameters on pistachio price. As it can be observed in Table 1, the obtained coefficients are in the interval of [0 1] and these coefficients illustrate that larger coefficients (closer to 1) are more influential. All the parameters, except the quantity of internal production and export quantity, have large coefficients. Figures 2, 3, and 4 illustrate the trend of export quantity, pistachio global price, and pistachio the price in Iran, respectively.

Elman neural network
In general, Artificial Neural Networks (ANNs) are briefly mathematical techniques planned and designed to accomplish different types of tasks. Nowadays, neural networks can be configured in a variety of arrangements to perform a range of tasks including pattern recognition, data mining, classification, forecasting, and process modeling. ANNs are made up of attributes which lead to perfect solutions in applications where learning a linear or non-linear mapping is needed [16]. Elman network is considered as one of the most common and efficient recurrent neural networks. This network is normally a two-layer network, in which the first layer is the hidden layer or input layer and the second layer is the output layer. This network performs like a perceptron network; however, in the Elman network, the output of the hidden layer is applied to the input of the hidden layer, via feedback loops. Hence, the output value in each moment will depend on the previous efficient values. Figure 5 depicts a schematic of Elman neural network, along with its inputs and outputs of the problem.

Feed-forward neural network
Feed-forward neural network, inspired by biologic classification algorithm, consists of different neurons and layers to process and organize data. The existence of several layers of neurons with a non-linear transfer function makes the network capable to learn linear and non-linear relation between inputs and outputs. Neurons, which are the elements of the signal processing, are connected to each other by synaptic feed-forward cross layer joints. The input-output connection may be performed by non-linear mapping functions [17]. Appropriate determination and selection of weights and biases is very important in network performance. Weight coefficient expresses the level of the given importance to the parameter. In multi-layer neural networks, the output of a layer is the input of the succeeding one. The equation is as follows [18]. Figure 6 shows the feed-forward neural network, along with inputs and outputs of the problem.

Genetic algorithm
Genetic algorithm is an optimization method, inspired by living nature, which can be introduced as a numerical, direct, and random search method. This algorithm is based on population and repetition. Its principle concepts are derived from genetic science [19]. In addition, to apply the concept of genetic evolution to an optimization problem, in the real world; two points should be considered: (1) encoding the potential solutions; (2) defining the fitness function (cost function) [20]. The general structure of genetic algorithm Feed-forward neural networks, with specific inputs and outputs employed in this study is defined in a step-by-step process [21].
Step 1: Defining the practical solution of the problem as a genetic problem Step 2: Generating an initial population Step 3: the calculation of the mean of fitnessf Step 4: selection operator; in this study, tournament selection operator is employed for selection of parents for crossover.
Step 5: running the crossover operator with a defined probability for each pair.
Step 6: applying mutation operator with a defined probability for each child.
Step 7: forming a new population p(t + 1) using surviving mechanism.
Step 8: setting t = t + 1 and returning to the third step.

Imperialist competitive algorithm
Imperialist Competitive Algorithm (ICA) is a novel politicalsocial strategy for optimize different problems [22]. This algorithm, as an evolutionary optimization strategy, possesses an excellent performance in convergence speed and absolute optimum point [22][23][24][25][26][27]. ICA algorithm is simulated based on political-social imperialism process and imperialist competition [28]. In different optimization methods, different arrays have been used to name problem solutions. For example, in PSO, GA, and ICA algorithms, this array is named as particle, chromosome, and country, respectively. Different optimization problems consist of different dimensions. For an N var dimension optimization problem, a country has 1 × N var arrays; the array is defined as below: where P shows the dimensions of the problem and each dimension of the problem represents a specific characteristic of the country. Figure 7 depicts some of these characteristics [26]. Each country's value is evaluated by a cost function. This function, based on the type of the problem, is different and its general form is as: This algorithm starts its work by generating an initial population from countries with N POP size. The countries are divided to two categories: imperialist and colony. A number equal to N imp and N col is selected from the powerful countries and countries as the empire and colony, respectively. Each colony belongs to an empire. To form the initial empires, colonies are attracted to the empire, based on empire's power. In other words, the initial number of colonies is directly proportional to the power of the empire. The normalized cost of an imperialist to divide the colonies among the appropriate imperialists is as follows [26]: where c n is the cost of nth imperialist and C n is the normalized cost. Regarding the normalized cost of all imperialists, the normal power of each imperialist is defined as follows: First, the initial colonies are divided based on the power of the empire. Afterward, the initial number of colonies of the nth empire is calculated as follows: where N C n is the initial number of colonies of the nth imperialist and N col is the number of all colonies. To divide the colonies between imperialists, a quantity equal to N C n from the colonies was randomly selected and allocated to imperialists. The power of an empire equals to the power of the colonial country plus a percentage of total power of its colonies. In this way, the total cost of an empire is as: where T.C. n is the total cost of the nth empire and ξ is a positive number, normally considered between 0 and 1 and close to 0. A smaller value of ξ leads to an approximate balance between the total cost of an empire and the cost of its central government, while, if ξ increases, it will increase the influence of the quantity of the colonies' cost of an empire on the determination of its total cost. Typically, ξ = 0.05 leads to desirable responses in most of the applications [26]. Each empire which is unable to improve its power and loses its competition power will be eliminated through imperialist completions; this elimination is performed gradually. In other words, as time goes on, weak empires lose their colonies and more powerful empires occupy these colonies and enhance their power. In order to model this, it is assumed that the eliminating empire is the weakest existing one. Hence, in the algorithm's repetition process, one or several weakest colonies are selected, and then-to seize these colonies-a competition is generated within all empires. The mentioned colonies are not necessarily seized by most powerful empire; although the more powerful empires are a higher chance to seize. Figure 8 illustrates the schematic of this section of the algorithm [26].
In this figure, empire 1 is considered as the weakest empire and one of its colonies is exposed to imperialistic competition, and empires 2 to N compete to seize it. To model the competition among empires to seize the colony, primarily, the probability of each empire to seize-which is proportional to the power of that empire-is calculated, regarding the total cost of the empire. First, through the total cost of the empire, its total normalized cost is determined: In this equation, T.C. n is the total cost of the nth empire and N .T.C. n is the total normalized cost of the empire. Each empire which has less T.C. n , the higher its N .T.C. n will be. As a matter of fact, T.C. n is equal to the total cost of an empire, while NTCn is its total power. The empire with the least cost is the one with the highest power. Having the total normalized cost, the probability of the ownership, by each empire, of the colony-exposed to the competition-is calculated as: Regarding the probability of each empire to seize, it is required to have a mechanism like roulette wheel in genetic algorithm to assign the colony-exposed to the competitionto one empires, based on their appropriate probability.
Having probability of each empire to seize, to divide the colony to empires randomly, but with the dependent probability to the seizing probability of each empire, P vector is formed based on the above probability values as follows [26]: where P vector is of 1× N imp size and consists of probability values of empires' seizing. Consequently, random vector R is generated with the same size of P vector. Elements of this vector are random numbers with uniform distribution in [0, 1] interval: Therefore, D vector is generated as: Possessing vector D, the colonies are given to an empire that its index is greater in D vector, as compared to other empires; the empire which has the highest probability to seize, whose index-with higher probability-in vector D, will have the greatest quantity [26].

Particle swarm optimization
Particle swarm optimization algorithm is a social search algorithm which is modeled based on social behavior of bird species. First, this algorithm was employed to identify patterns of simultaneous flight of birds and rapid path change and optimum re-formation of the group. In this algorithm, each solution of the problem is modeled as a particle that has a value and fitness value. In this algorithm, vector method is used to search for the optimum solution. This algorithm has been used in many study fields, such as problem optimization, economic problems, neural network training, and optimization of production systems [29]. PSO is designed to search for the best global solution, using a swarm of particles, and is updated through each stage [30]. Each particle represents a potential solution in search space, which sets its location and velocity regarding the its own best experience or local best and the so-far-obtained best experience or local best of all particles (global best) [31]. Consider an N dimensional problem with i particles and t generations. X i,N (t) and V i,N (t) are location and velocity of the ith particle, respectively. The velocity of the ith particle for the (t + 1) generation is calculated through the following equation [32,33]: where 1 ≤ i ≤ m, 1 ≤ t ≤ k; and c 1 and c 2 have the values c 1 = c 2 = 2. r 1 and r 2 are the two independent random numbers that follow the uniform functions in [−1, 1] interval. ω is the inertia coefficient that controls the effect of the previous speed on the current speed: where ω(1) is the initial inertia weight and ω(k) is equal to the inertia weight which evolved swarm in the last generation of k and t is equal to maximum repetition and initial repetition of the maximum generation, respectively. PSO, as a type of simple and effective random searching algorithm, may lead to better results than the gradient descent method, penalty function method, and genetic algorithm, when solving some non-linear optimization problems [34,35].

Proposed method
Within the last two decades, optimization has spread its application in different fields, such as industrial engineering, electrical engineering, computer engineering, telecommunication, and transportation. Nowadays, the application of intelligent methods such as artificial neural networks and meta-heuristic algorithms has an important position in different study fields. In this survey, Genetic, Imperialist Competitive, and Particle Swarm (GA, ICA, and PSO) algorithms have been used as optimizers of the neural network parameters. Since the performance of these algorithms is based on population, the combination of each algorithm with the Elman neural network and feed-forward network is almost similar. However, based on their nature, they show different performance. The purpose of combining these algorithms with the neural network is to optimize weights and biases of the neural network. As stated in the previous sections, these algorithms are of a population based nature, and the problem has to be defined, so that the algorithms can optimize it as a swarm of the population. In problem-defining stage, chromosome (GA), particle (PSO), or country (ICA) should be in a way to optimize the weights and biases, which mean the number of each chromosome's gens, and should be equal to the number of weights and biases. Training the neural network, the number of weights and biases depends on the number of layers and neurons. To make a particle, the following procedure is performed: (n l i · n l i+1 ) where N is the number of neural network parameters or in other words, the dimension of the optimization problem. n l i and I are the number of neurons in the ith layer and input of the network, respectively. When the solution chromosome is specified, a cost function should be defined for the optimization problem to calculate the optimal value of parameters (W, b). The employed cost function is represented in the following section.

Cost function
MMSE cost function is used in this section to optimize parameters of the neural network. Here, each solution of the problem (chromosome, particle, or country) has a cost; the cost function calculates these costs for solutions. Furthermore, based on the nature of the cost function, it should be minimized using optimization algorithms: to find a solution with the least possible cost. In this investigation, three optimization algorithms of PSO, ICA, and GA methods are used to minimize the cost function. MMSE is the Minimum Mean Squares Error of (MSE). MSE and MMSE are: where, X FOR is the predicted value, X ACT is the actual value, and n is the number of data.

Training and testing of the neural network
After defining the neural network parameters as a problem and optimizing the problem with aforementioned algorithms, the neural network should be trained and tested. In this stage, the optimal value of the parameters should be provided to the neural network and the network employs a part of input data (75% in this study) for training. Optimized parameters by the optimization algorithms such as PSO, ICA, and GA as well as transfer functions (here, tangent sigmoid transfer function is used), relation, and behavior of the data are obtained, and then, the trained network is evaluated by different criteria. In the current study, to evaluate the performance of the neural network training, two criteria of Mean Squared Errors (MSE) and Root Mean Square of Errors (RMSE) are used.
If the training is performed well, the neural network testing phase would be initiated. The network is tested by data which had been preserved for this phase. Afterwards, the network is evaluated by different error criteria. To evaluate testing phase, two error criteria of Mean Absolute Error (MAE) and Mean Absolute Percentage Error (MAPE) are used: where X ACT and X FOR are actual value and predicted value, respectively. Figure 9 illustrates flowchart of combination of the proposed method.

Input data
In the current investigation, monthly data in a period of 15 years (1996-2010) were used as inputs of the neural network. These data are for Islamic Republic of Iran collected from different organizations, such as Iran's Pistachio Research The purpose of normalizing the data is that all the training data should have a uniform statistic distribution. In this study, linear normalization is used to convert data.
where X norm is the normalized value, X is the non-normal value, and Min(X ) and Max(X ) is minimum and maximum of the non-normal, respectively.

Case study
Pistachio product is of great importance in either producing countries or other countries and is considered as the green gold. Two major pistachio producing countries are Iran and the US. In this study, the price in Iran of pistachio data is used to predict the price of this produce. In addition to Iran's domestic market prices data, the data of inflation rate, export value, and production amount, and etc.-which have been mentioned in previous sections-were used as well.

Results of the proposed method and other combined methods
As stated in the previous sections, combined method of El-PSO was used to predict Iran's domestic market pistachio prices. Table 2 illustrates the best results of this method and other combined methods. Figure 10 shows the actual and the predicted data by the El-PSO method. Moreover, 60 data were selected (for 5 years) and the performance was once again evaluated. Table 3 depicts the performance result of this part of data, which was obtained by El-PSO and other methods.
According to the results of the table, El-PSO method has an excellent performance as compared to other methods,  . 10 The comparison of actual data and predicted data of the El-PSO method which proves that the efficiency of this method to predict pistachio price is, indeed, a complicated task.

Results analysis, using analysis of variance method
Since several novel combined methods are used to predict pistachio price in this study, one of the best techniques to evaluate these methods' performance is analysis of variance method (ANOVA). Using this technique, more than a society (method) can be evaluated. In this section, the results of MAE error criterion, which are obtained by all the methods, are compared by ANOVA. Figures 11 and 12 are the output of this method, which show mean and distribution, respectively. Table 4 represents statistical characteristics obtained by ANOVA method. Using these results, it can be concluded Fig. 11 Mean of the proposed method and other methods, using MAE criterion that the suggested method of El-PSO has an excellent performance and limited distribution. It should be mentioned that Minitab 16 software is employed to implement ANOVA.

Conclusion
According to complexity of pistachio price in Iran and the world, it is very difficult to propose a model capable to predict pistachio price, based on relevant factors and results with a lower error. Suggesting an efficient method can be helpful to the economy of producing countries, as well. In the current survey, El-PSO method is proposed to predict pistachio price. This method owns an excellent performance and so efficient that can be used in other problems, also.