# An evolutionary hybrid method to predict pistachio price

- First Online:

- Received:
- Accepted:

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

### References

- 1.Makridakis S, Wheelwright SC (1989) Forecasting methods for management, 5th edn. Wiley, ChichesterMATHGoogle Scholar
- 2.Hazell PB, Jaramillo M, Williamson A (1990) The relationship between world price instability and the prices farmers receive in developing countries. J Agric Econ 41(2):227–41CrossRefGoogle Scholar
- 3.Moshiri S, Cameron NE (2000) Neural network versus econometric models in forecasting inflation. J Forecast 19(3):201–217CrossRefGoogle Scholar
- 4.Olson D, Mossman C (2003) Neural network forecasts of Canadian stock returns using accounting ratios. Int J Forecast 19(3):453–465CrossRefGoogle Scholar
- 5.Chen L (2011) The effect of China’s RMB exchange rate movement on its agricultural export: a case study of export to Japan. China Agric Econ Rev 3(1):26–41CrossRefGoogle Scholar
- 6.Abolagba EO, Onyekwere NC, Agbonkpolor BN, Umar HY (2010) Determinants of agricultural exports. J Hum Ecol 29(3):181Google Scholar
- 7.Zheng Z, Saghaian S, Reed M (2012) Factors affecting the export demand for US pistachios. Int Food Agribus Manag Rev 15(3):139–54Google Scholar
- 8.Yazdani F, Tash MN (2014) Identifying and analysis of risk management tools of pistachio farmers (a case study of Sirjan region). Int J Agric Crop Sci 7(9):555–559Google Scholar
- 9.Tohidi A, Zare MM, Mehrabi BH, Nezamabadi PH (2015) Evaluation of Artificial Neural Network-Panel Data Hybrid Model in Predicting Iran’s Dried Fruits Export Prices. 12(3):95–116Google Scholar
- 10.Croxton FE, Klein S, Cowden DJ (1968) Applied general statistics, vol 9, 10, 3rd edn. Sir Isaac Pitman and Sons, LondonMATHGoogle Scholar
- 11.Dietrich CF (1991) Uncertainty, calibration and probability: the statistics of scientific and industrial measurement (2nd ed.). Higler series on science and technology. CRC Press, Boca Raton, p 331. ISBN 9780750300605Google Scholar
- 12.Aitken AC (1939) Statistical mathematics. Oliver and Boyd, EdinburghMATHGoogle Scholar
- 13.Lee Rodgers J, Nicewander WA (1988) Thirteen ways to look at the correlation coefficient. Am Stat 42(1):59–66CrossRefGoogle Scholar
- 14.Mai V (2013) Lecture 2: entropy and mutual information. McGill University Electrical and Computer Engineering. ECSE 612— Multiuser CommunicationsGoogle Scholar
- 15.Chen CP (2009) Entropy and mutual information notes on information theory. Department of Computer Science and Engineering, National Sun Yat-Sen University, KaohsiungGoogle Scholar
- 16.Azadeh A, Asadzadeh SM, Jafari-Marandi R, Nazari-Shirkouhi S, Khoshkhou GB, Talebi S, Naghavi A (2013) Optimum estimation of missing values in randomized complete block design by genetic algorithm. Knowle Based Syst 37:37–47CrossRefGoogle Scholar
- 17.Heydari A, Keynia F, Shahsavari Pour N (2013) Machinery cost prediction based on a new neural network method. J Basic Appl Sci Res 3(7):484–491Google Scholar
- 18.Hagan MT, Demuth HB, Beale MH (2002) Neural network design: Campus Pub. Service. University of Colorado Bookstore, Boulder 1284Google Scholar
- 19.Qasem SN, Shamsuddin SM, Zain AM (2012) Multi-objective hybrid evolutionary algorithms for radial basis function neural network design. Knowl Based Syst 27:475–97CrossRefGoogle Scholar
- 20.Hsu CM, Chen KY, Chen MC (2005) Batching orders in warehouses by minimizing travel distance with genetic algorithms. Comput Ind 56(2):169–78MathSciNetCrossRefGoogle Scholar
- 21.Mühlenbein H (1997) Genetic algorithms. In: Aarts E, Lenstra JK (eds) Local search in combinatorial optimization. Wiley, New York, pp 137–171Google Scholar
- 22.Atashpaz-Gargari E, Lucas C (2007) Imperialist competitive algorithm: an algorithm for optimization inspired by imperialistic competition. In 2007 IEEE congress on evolutionary computation 2007 Sep 25 (pp 4661–4667). IEEEGoogle Scholar
- 23.Rajabioun R, Atashpaz-Gargari E, Lucas C (2008a) Colonial competitive algorithm as a tool for Nash equilibrium point achievement. International conference on computational science and its applications. Jun 30, pp 680–695. Springer, BerlinGoogle Scholar
- 24.Biabangard-Oskouyi A, Atashpaz-Gargari E, Soltani N, Lucas C (2009) Application of imperialist competitive algorithm for materials property characterization from sharp indentation test. Int J Eng Simul 10(1):11–12Google Scholar
- 25.Sepehri Rad H, Lucas C (2008) Application of imperialistic competition algorithm in recommender systems. In13th Int’l CSI Computer Conference (CSICC’08), Kish Island, IranGoogle Scholar
- 26.Atashpaz Gargari E, Hashemzadeh F, Rajabioun R, Lucas C (2008) Colonial competitive algorithm: a novel approach for PID controller design in MIMO distillation column process. Int J Intell Comput Cybern 1(3):337–55MathSciNetCrossRefMATHGoogle Scholar
- 27.Rajabioun R, Hashemzadeh F, Atashpaz-Gargari E, Mesgari B, Salmasi FR (2008b) Decentralized PID controller design for a MIMO evaporator based on colonial competitive algorithm. IFAC Proc 41(2):9952–7CrossRefGoogle Scholar
- 28.Mousavi SM, Tavakkoli-Moghaddam R, Vahdani B, Hashemi H, Sanjari MJ (2013) A new support vector model-based imperialist competitive algorithm for time estimation in new product development projects. Robot Comput Integr Manuf 29(1):157–68CrossRefGoogle Scholar
- 29.Onwunalu JE, Durlofsky LJ (2010) Application of a particle swarm optimization algorithm for determining optimum well location and type. Comput Geosci 14(1):183–98CrossRefMATHGoogle Scholar
- 30.Zhou C, Ding LY, He R (2013) PSO-based Elman neural network model for predictive control of air chamber pressure in slurry shield tunneling under Yangtze River. Autom Constr 36:208–217CrossRefGoogle Scholar
- 31.Zhang H, Li X, Li H, Huang F (2005) Particle swarm optimization-based schemes for resource-constrained project scheduling. Autom Constr 14(3):393–404CrossRefGoogle Scholar
- 32.Lu M, Lam HC, Dai F (2008) Resource-constrained critical path analysis based on discrete event simulation and particle swarm optimization. Autom Constr 17(6):670–81CrossRefGoogle Scholar
- 33.Chen JH, Yang LR, Su MC (2009) Comparison of SOM-based optimization and particle swarm optimization for minimizing the construction time of a secant pile wall. Autom Constr 18(6):844–8CrossRefGoogle Scholar
- 34.Yaghini M, Khoshraftar MM, Fallahi M (2013) A hybrid algorithm for artificial neural network training. Eng Appl Artif Intell 26(1):293–301CrossRefGoogle Scholar
- 35.Yu C, Teo KL, Zhang L, Bai Y (2010) A new exact penalty function method for continuous inequality constrained optimization problems. J Ind Manag Optim 6(4):895MathSciNetCrossRefMATHGoogle Scholar

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