# An evolutionary hybrid method to predict pistachio price

- First Online:

- Received:
- Accepted:

DOI: 10.1007/s40747-017-0038-8

- Cite this article as:
- Heydari, A., Keynia, F., Shahsavari-Pour, N. et al. Complex Intell. Syst. (2017) 3: 121. doi:10.1007/s40747-017-0038-8

- 163 Downloads

## Abstract

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.

### Keywords

Pistachio Artificial neural networks Meta-heuristic algorithms Analysis of Variance## 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 decision-making 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

Effect of the parameters on pistachio price, based on two proposed methods

Methods | IPEQ | IPPQ | PGPQ | PGP | DIR | PPCI | UD | CD | EP | ED |
---|---|---|---|---|---|---|---|---|---|---|

Pearson correlation | 0.057 | 0.332 | 0.819 | 0.872 | 0.964 | 0.745 | 0.689 | 0.918 | 0.815 | 0.745 |

Mutual information (MI) | 0.003 | 0.013 | 0.199 | 0.55 | 0.606 | 0.434 | 0.606 | 0.606 | 0.606 | 0.606 |

### Pearson correlation

*X*and

*Y*, with expected value of \(\mu _X ,\mu _Y \), and standard deviation \(\sigma _X \sigma _Y \) is calculated as:

*E*is the expected value, Cov is the covariance, \(\sigma \) 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

*X*and

*Y*regarding the distribution of

*p*(

*x*,

*y*) is simultaneously and collectively obtained as follows [14]:

### Definition 2

*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.

## Intelligent methods

### 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

### 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 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 \(P( 0 )=x_1^0 ,\ldots , x_N^0.~{\text {Set}}~ t=0.\)

*Step 3: *the calculation of the mean of fitness \(\bar{{f}}( t )=\sum _i^N {{f( {x_i } )}/N} \). Allocating fitness value to each person \({f( {x_i })}/{\bar{{f}}( t )}\).

*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

*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].

*n*th 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:

*n*th empire is calculated as follows:

*n*th imperialist and \(N_{\text {col}} \) is the number of all colonies. To divide the colonies between imperialists, a quantity equal to \(NC_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:

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].

*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:

*P*vector is formed based on the above probability values as follows [26]:

*P*vector is of \(1\times N_{\text {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:

*D*vector is generated as:

*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

*N*dimensional problem with

*i*particles and

*t*generations. \(X_{i,N} (t)\) and \(V_{i,N} ( t )\) are location and velocity of the

*i*th particle, respectively. The velocity of the

*i*th particle for the \(( {t+1} )\) generation is calculated through the following equation [32, 33]:

*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*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

*i*th 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

*n*is the number of data.

### Training and testing of the neural network

### Input data

*X*is the non-normal value, and \(\text {Min}( X )\) and \(\text {Max}( X )\) is minimum and maximum of the non-normal, respectively.

## Numerical results

### 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

Comparison of the best performance of the El-PSO method and other combined methods, using four measurement criteria

Methods | MSE | RMSE | MAE | MAPE (%) |
---|---|---|---|---|

FF-PSO | 0.003 | 0.0548 | 0.0545 | 0.0545 |

El-ICA | 0.0046 | 0.059 | 0.059 | 11.736 |

FF-ICA | 0.0065 | 0.059 | 0.1117 | 11.78 |

El-GA | 0.0189 | 0.1374 | 0.106 | 9.353 |

FF-GA | 0.0078 | 0.0883 | 0.1027 | 7.0336 |

Proposed method (El-PSO) | 0.0015 | 0.0387 | 0.0315 | 4.215 |

Comparison of performance of the proposed method and other methods, using 60 data (equal to 5 years)

Methods | MSE | RMSE | MAE | MAPE (%) |
---|---|---|---|---|

FF-PSO | 0.0049 | 0.07 | 0.0636 | 4.042 |

El-ICA | 0.0764 | 0.2764 | 0.247 | 6.4709 |

FF-ICA | 0.697 | 0.8349 | 0.217 | 9.093 |

El-GA | 0.0137 | 0.117 | 0.064 | 4.216 |

FF-GA | 0.0103 | 0.1015 | 0.0769 | 5.0651 |

Proposed method (El-PSO) | 0.0029 | 0.0539 | 0.0526 | 3.169 |

According to the results of the table, El-PSO method has an excellent performance as compared to other methods, which proves that the efficiency of this method to predict pistachio price is, indeed, a complicated task.

### Results analysis, using analysis of variance method

Statistical characteristic of the proposed method and other combined methods to predict pistachio price

Methods | Mean | Median | SE mean | Standard deviation |
---|---|---|---|---|

FF-PSO | 0.0621 | 0.06 | 0.0084 | 0.0206 |

El-ICA | 0.159 | 0.1653 | 0.0339 | 0.0831 |

FF-ICA | 0.161 | 0.1673 | 0.0337 | 0.0825 |

El-GA | 0.079 | 0.0932 | 0.0152 | 0.0372 |

FF-GA | 0.225 | 0.096 | 0.129 | 0.315 |

Proposed method (El-PSO) | 0.0473 | 0.0499 | 0.0499 | 0.0079 |

Table 4 represents statistical characteristics obtained by ANOVA method. Using these results, it can be concluded 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.

## Copyright information

**Open Access**This article is distributed under the terms of the Creative Commons Attribution 4.0 International License (http://creativecommons.org/licenses/by/4.0/), which permits unrestricted use, distribution, and reproduction in any medium, provided you give appropriate credit to the original author(s) and the source, provide a link to the Creative Commons license, and indicate if changes were made.