A PSO-GRNN model for railway freight volume prediction: Empirical study from China
Abstract
EconStor is a publication server for scholarly economic literature, provided as a non-commercial public service by the ZBW.
Full text
Sun, Yan; Lang, Maoxiang; Wang, Danzhu; Liu, Linyun Article A PSO-GRNN model for railway freight volume prediction: Empirical study from China Journal of Industrial Engineering and Management (JIEM) Provided in Cooperation with: The School of Industrial, Aerospace and Audiovisual Engineering of Terrassa (ESEIAAT), Universitat Politècnica de Catalunya (UPC) Suggested Citation: Sun, Yan; Lang, Maoxiang; Wang, Danzhu; Liu, Linyun (2014) : A PSO-GRNN model for railway freight volume prediction: Empirical study from China, Journal of Industrial Engineering and Management (JIEM), ISSN 2013-0953, OmniaScience, Barcelona, Vol. 7, Iss. 2, pp. 413-433, https://doi.org/10.3926/jiem.1007 This Version is available at: https://hdl.handle.net/10419/188609 Standard-Nutzungsbedingungen: Die Dokumente auf EconStor dürfen zu eigenen wissenschaftlichen Zwecken und zum Privatgebrauch gespeichert und kopiert werden. Sie dürfen die Dokumente nicht für öffentliche oder kommerzielle Zwecke vervielfältigen, öffentlich ausstellen, öffentlich zugänglich machen, vertreiben oder anderweitig nutzen. Sofern die Verfasser die Dokumente unter Open-Content-Lizenzen (insbesondere CC-Lizenzen) zur Verfügung gestellt haben sollten, gelten abweichend von diesen Nutzungsbedingungen die in der dort genannten Lizenz gewährten Nutzungsrechte. Terms of use: Documents in EconStor may be saved and copied for your personal and scholarly purposes. You are not to copy documents for public or commercial purposes, to exhibit the documents publicly, to make them publicly available on the internet, or to distribute or otherwise use the documents in public. If the documents have been made available under an Open Content Licence (especially Creative Commons Licences), you may exercise further usage rights as specified in the indicated licence. https://creativecommons.org/licenses/by-nc/3.0/
Journal of Industrial Engineering and Management JIEM, 2014 – 7(2): 413-433 – Online ISSN: 2013-0953 – Print ISSN: 2013-8423 http://dx.doi.org/10.3926/jiem.1007 A PSO-GRNN model for railway freight volume prediction: Empirical study from China Yan Sun1, Maoxiang Lang*1, Danzhu Wang1, Linyun Liu2 1School of Traffic and Transportation, Beijing Jiaotong University (China) 2College of Engineering, Northeastern University (U.S.A.) suny[email protected], [email protected] *Corresponding author, [email protected], [email protected] Abstract: Purpose: In this study, we aim to design a mathematical model for railway freight volume prediction which can provide an accurate direction for railway freight resource allocation. Based on the precise prediction, railway freight enterprises are able to optimize and integrate the limited resources to organize freight transport more efficiently and economically. Design/methodology/approach: In this study, we design a PSO-GRNN model to predict railway freight volume. In the proposed model, GRNN carries out the nonlinear regression analysis between railway freight volume and its influencing factors which can be described by detailed and measurable indexes and outputs the prediction value. PSO algorithm with time linear decreasing inertia weight and time varying acceleration coefficients is applied to optimize the basic GRNN model by searching the optimal smoothing parameter. Findings: The simulation result in this study indicates that (1) the PSO-GRNN model is able to predict railway freight volume by using the value of other relevant indexes as its input to fit the variation of railway freight volume; (2) Through optimization for GRNN model based on PSO algorithm, the proposed model performs well prediction accuracy; (3) Compared with RBFNN model and BPNN model, the superiority of the proposed model in prediction accuracy and curve fitting capacity is verified. -413-
Journal of Industrial Engineering and Management – http://dx.doi.org/10.3926/jiem.1007 Originality/value: In the empirical study from China, we establish a railway freight volume prediction index system containing seventeen prediction indexes from five influencing factors. Then we construct the PSO-GRNN model to predict the railway freight volume from 2007 to 2011 by using data from 1990 to 2006 as training samples. In order to verify the feasibility and prediction accuracy of the proposed model, we also use two widely applied neural network models, including RBFNN model and BPNN model, to estimate the railway freight volume prediction during the same period. Compared with RBFNN model and BPNN model, the simulation results indicate that the proposed model has higher prediction accuracy and better curve fitting capacity. Therefore, PSO-GRNN model can be further applied in practical railway freight production. Keywords: railway freight volume, prediction model, neural network, GRNN, smoothing parameter, PSO algorithm 1. Introduction Prediction is a kind of estimation about the development mode that how things are going on in the future. As an essential guidance towards social production, prediction has always been a highlight in academic research field. As for railway freight volume prediction, the widely applied methods have been limited to the traditional ones, such as time serial analysis, regression analysis, and gray prediction model and so on. However, with the scale of data becoming larger and requirement for prediction accuracy becoming higher, limitations of these traditional methods appear to be obvious. Therefore, many researchers have paid attention to the prediction model optimization. With the development of artificial intelligence in recent years, neural networks have already made great contributions to prediction field, due to their high prediction accuracy and calculation efficiency and so on. Some relevant studies are given as follows. Korres, Anastopoulos, Lois, Alexandridis, Sarimveis and Bafas (2002) focused on applying radial basis function neural network (RBFNN) model to undertake the diesel fuel lubricity prediction. In this study, six fuel properties were regarded as the input variable The experimental results verified that the RBFNN model could use other fuel properties as input values to approximate the lubricity. Liang and Noore (2004) gave a Bayesian regularization optimized recurrent neural network modelling method for software reliability prediction. Measured by software cumulative failure time, the software reliability was able to be better predicted by the proposed model when compared with the existing neural network models. Wang, Wang, Jia and Li (2005) designed a 4-layer modified BP neural network (BPNN) model -414-
Journal of Industrial Engineering and Management – http://dx.doi.org/10.3926/jiem.1007 for railway passenger volume time serial prediction. In this study, the basic BPNN model was optimized by adaptive learning rate algorithm and momentum BP algorithm. The relative errors of the testing samples calculated by the modified BPNN model were less than the basic BPNN model. Liu, Ji, Ye and Geng (2006) compared the prediction performance of RBFNN model, BPNN model and gray prediction model in railway freight volume time serial prediction. Using data from 1989 to 2002 as training samples, RBFNN model had the minimum mean relative error of testing samples in 2003 and 2004 when compared with the rest two models. Adeli and Panakkat (2009) analyzed the influencing factors of earthquake magnitudes and presented a probabilistic neural network (PNN) model for predicting the earthquake magnitudes using eight elements as the seismicity indexes. The empirical study indicated that the model had different prediction accuracy for the earthquakes with magnitudes in different ranges. Brahme, Winning and Raabe (2009) presented a 3-layer BPNN model for the prediction of cold rolling textures of steels by inputting the values of sixteen variables, including carbon content, carbide size and so on. The experimental results in this study stressed the importance of the selection of the training data set for the prediction accuracy of the model. Ömer Faruk (2010) designed an ARIMA and BPNN based hybrid model for water quality time serial prediction. Using water temperature, boron and dissolved oxygen as the output variables, the hybrid prediction model could fit the relationship between the output variables and the time. The prediction accuracy of the hybrid model was more satisfactory than the traditional ARIMA model and BPNN model. Chen and Vachtsevanos (2012) modified fuzz neural network (FNN) and constructed an interval Type-2 FNN model for the prediction of bearing health conditions. The prediction results of the proposed model were compared with the widely used adaptive neuro-fuzzy inference system. The comparison indicated that the interval Type-2 FNN model had better prediction accuracy. Okkan (2012) optimized wavelet neural network (WNN) model by Levenberg-Marquaradt (L-M) algorithm based feed forward neural network (FFNN) and applied the proposed model to predict monthly reservoir inflow. The results in this study showed that the WNN model was a more appropriate tool to model the monthly inflow series of dam and had better prediction accuracy than FFNN model and multiple linear regressions model. Mostafa (2012) proposed multi-layer perceptron neural network (MPLNN) and generalized regression neural network (GRNN) to undertake KSE closing price movement prediction. The feasibility and accuracy of neural network model in the stock exchange movement prediction were proved superior to the traditional regression analysis and ARIMA. Gnana Sheela and Deepa (2013) constructed a hybrid wind speed prediction model based on MLPNN and selforganizing map neural network (SOMNN). The proposed model possessed higher prediction accuracy and less error than the traditional MPLNN model, BPNN model and RBFNN model, which verified the proposed model can improve both the accuracy of prediction and the convergence rate. -415-
Journal of Industrial Engineering and Management – http://dx.doi.org/10.3926/jiem.1007 In brief, substantial accomplishments have been achieved in the prediction field. And the application of neural networks in prediction trends to be mature. All these studies above laid a solid foundation for the research in our study. The rest sections of this study are organized as follows. First we design a GRNN model for railway freight volume prediction in Section 2 and apply PSO algorithm to optimize the basic GRNN model in Section 3. Then an empirical study is given in Section 4 to verify the feasibility of PSO-GRNN model. In Section 4, a railway freight volume prediction index system containing seventeen indexes is established and the proposed model is constructed to predict the railway freight volume from 2007 to 2011. For comparison, BPNN model and RBFNN model are also used in Section 4 to predict the railway freight volume during the same period. Finally, we present the conclusions of this study in Section 5. 2. Construction of GRNN model for railway freight volume prediction 2.1. Generalized regression neural network and its mathematical basis Generalized Regression Neural Network (GRNN) was first proposed by Specht (1991). It is a kind of artificial neural networks which use a brain synapse-like structure to manage the information (Tsuda, 1992) and is often used for function approximation (Liu, Ji, Ye & Geng, 2006). GRNN has many advantages, such as fast learning, well nonlinear mopping capacity, flexible network structure, high fault-tolerance and well robustness (López-Martín, Isaza & Chavoya, 2012). These advantages become outstanding when the data is in a large scale. Therefore, GRNN model has been widely applied in many fields, such as classification, structure analysis, bioengineering and so on. The mathematical basis of GRNN model for railway freight volume prediction is nonlinear regression analysis between railway freight volume and its influencing factors. The regression analysis between the railway freight volume of a year (dependent variable) y relative to its corresponding index vector of the influencing factors (independent variable) X can be calculated by equation (1). (1) Where ŷ(X) represents the prediction value of y, and f(X,y) is the joint probability density function between X and y. -416-
Journal of Industrial Engineering and Management – http://dx.doi.org/10.3926/jiem.1007 In equation (1), the expression of f(X,y) is unknown. But it can be estimated from the training sample set by Parzen estimation (Parzen, 1962), which is as shown in equation (2). (2) Where is the estimation of f(X,y), n represents the number of training samples, m represents the dimension of the index vector, σ represents the smoothing parameter, and disti is the Euclidean Distance between X and Xi, which can be calculated by equation (3). (3) Where Xi = (xi1,..., xij,..., xim) and X = (x1,..., xj,..., xm), xi and xij represent the ith dimensional value of X and Xi, respectively. Due to , equation (1) can be rewritten as equation (4) when equation (2) is substituted into it. (4) 2.2. Modeling process of GRNN model for railway freight volume prediction GRNN is a feed forward neural network composed of 4 layers, including input layer, pattern layer, summation layer and output layer. Each layer contains many neurons by which different layers can connect with each other. The topological structure of GRNN model is as shown in Figure 1. -417-
Journal of Industrial Engineering and Management – http://dx.doi.org/10.3926/jiem.1007 Figure 1. Topological structure of GRNN model Based on its topological structure, the modeling process of GRNN model is given as follows. Step 1. Input the index vector of the influencing factors of a year by the input neurons. Step 2. Calculate the output value of each pattern neuron. Weights from input neurons to pattern neurons are set to 1. So the input index vector will be transferred to each pattern neuron directly. The ith pattern neuron Pi corresponds with the ith training sample and uses radial basis function as its transfer function to calculate its output value by equation (5). (5) Step 3. Calculate the output value of the summation neurons. There are 2 neurons in the summation layer, including simple arithmetic summation neuron Sa and weighted summation neuron Sw. Weights from pattern neurons to Sa are set to 1, while weights from pattern neurons to Sw are set to yi which is the output value of the ith training sample. So the output value of the two neurons can be calculated by equation (6) and equation (7), respectively. (6) -418-
Journal of Industrial Engineering and Management – http://dx.doi.org/10.3926/jiem.1007 (7) Step 4. Determine the prediction value of the railway freight volume. In this step, the output value of Sw will be divided by the output value of Sa. The prediction value can be gained by equation (8). (8) As we can see from the modelling process above, smoothing parameter σ is the only parameter ought to be set manually. The prediction accuracy and the generalization capacity of GRNN model are both sensitive to its setting, which can be seen from Figure 2. Figure 2. Influence of smoothing parameter on GRNN model (data from Section 4) Generally, two methodologies can be applied to determine the appropriate σ, including individual experience and intelligent optimization algorithm. Because of the disadvantages of individual experience, we design a heuristic algorithm to optimize GRNN model by searching the optimal smoothing parameter in this study. -419-
Journal of Industrial Engineering and Management – http://dx.doi.org/10.3926/jiem.1007 3. Optimization for GRNN model based on PSO algorithm 3.1. Particle swarm optimization algorithm In order to optimize the performance of GRNN model and reduce the prediction error, we apply particle swarm optimization algorithm to search the optimal smoothing parameter to construct the GRNN model. Particle Swarm Optimization (PSO) algorithm was proposed by Kennedy and Eberhart (1995). It has already been widely used in the optimization fields for its simplified operation and less parameters relying on individual experience (Hou, Lu, Xiong, Cheng & Wu, 2004). PSO algorithm simulates a simplified social model that is composed of a group of particles. The particle has two parameters, including position and velocity. In the solution process of an optimization problem, these particles will modify their positions according to their own learning experience and their neighbours and finally find their best positions (Hashemi & Meybodi, 2004). 3.2. Design for the PSO algorithm in the optimization In the optimization for GRNN model based on PSO algorithm, the smoothing parameter is set as the position of the particles and the searching space is one dimensional. The parameters in the tth iteration process of PSO algorithm are set as follows. The personal position of the kth particle is pk(t) and its velocity is vk(t). The best personal position of the particle is pbestk(t) and the global best position of the swarm is gbestk(t). In PSO algorithm, Mean Square Error (MSE) between prediction values and actual values of the testing samples reflects the prediction accuracy of the model and can be used to judge the quality of σ. Therefore, the fitness function can be defined as equation (9). (9) Where Q represents the size of testing samples. yq, and ^ yq(t) represent the actual value and prediction value of the qth testing sample, respectively. The value of the fitness function will be calculated in every iteration. If PSO algorithm doesn’t reach the termination condition (usually the maximum iteration time), the velocity and position of the particle will be modified by equation (10) and equation (11) in the (t+1)th iteration, respectively. -420-
Journal of Industrial Engineering and Management – http://dx.doi.org/10.3926/jiem.1007 is 500, and sigmoid function and L-M algorithm are selected as transfer function and training algorithm, respectively. The termination accuracy of the iteration process is 10-7, and “newtt()” is applied by Matlab to construct a BPNN with least MSE. The training performance of BPNN model is as shown in Figure 6. Figure 6. Training performance of BPNN model with given parameters The prediction results of the three prediction models above are given in Table 4. The Mean Relative Error (MRE) of the prediction volumes and MSE of the normalized testing sample data are also presented in the table. Year Prediction result PSO-GRNN model RBFNN model BPNN model Prediction volume Relative error (%) Prediction volume Relative error (%) Prediction volume Relative error (%) 2007 318846.5 1.47 314495.6 0.08 314333.5 0.03 2008 324806.5 1.68 319747.9 3.21 320465.4 2.99 2009 336638.5 0.99 334684.5 0.40 319379.8 4.19 2010 367967.8 1.01 355048.4 2.53 390722.5 7.28 2011 386840.4 1.63 362670.9 7.79 393188.4 0.02 MRE (%) 1.36 2.80 2.90 MSE 0.00377 0.03638 0.03179 Table 4. Railway freight volume prediction results From Table 4, we can find that PSO-GRNN model has the minimum MRE and MSE compared with RBFNN model and BPNN model. The MRE of PSO-GRNN model is 0.49 of RBFNN model and 0.47 of BPNN model. The MSE of PSO-GRNN model is 0.1 of both RBFNN model and BPNN model. Although RBFNN model and BPNN model can gain very high prediction accuracy in some years, their prediction errors are very large in the other years. The difference between -427-
Journal of Industrial Engineering and Management – http://dx.doi.org/10.3926/jiem.1007 the maximum and minimum MRE of the three models above is 0.63%, 7.71% and 7.26%, respectively. The analysis above indicates that PSO-GRNN model has both better prediction accuracy and better curve fitting capacity when compared with RBFNN model and BPNN model, which can be also seen from Figure 7. Therefore, PSO-GRNN model we design in this study is more appropriate for railway freight volume prediction. Figure 7. Curve fitting for the target volumes of the three prediction models 5. Conclusions Railway freight volume prediction is a necessary work in railway freight transport organization. In this study, we design a PSO-GRNN model to fit the complicated nonlinear relationship between railway freight volume and its influencing factors from 1991 to 2006, and then estimate the railway freight volume prediction from 2007 to 2011. Railway freight volume is influenced by various factors. In the prediction, a railway freight volume prediction index system containing seventeen prediction indexes is established as shown in Table 1. Index vector of the influencing factors in the index system is the input of PSO-GRNN model and its output is the prediction value of railway freight volume. In the proposed model, GRNN calculates the prediction value and PSO algorithm is used to optimize GRNN model to improve its prediction accuracy by searching the optimal smoothing parameter. The proposed model has significant superiority to the widely applied RBFNN model and BPNN model. The following conclusions can be drawn after simulation. -428-
Journal of Industrial Engineering and Management – http://dx.doi.org/10.3926/jiem.1007 •The PSO-GRNN model we design in this study is able to predict railway freight volume by using the value of other relevant indexes as its input to fit the variation of railway freight volume. •Through optimization for GRNN model based on PSO algorithm, the proposed model performs well prediction accuracy with its MRE and MSE which is 1.36% and 0.003771, respectively. •Compared with RBFNN model and BPNN model, the superiority of the proposed model in prediction accuracy and curve fitting capacity is verified. Therefore, the proposed model can be promoted to the practical railway freight transport organization. Although PSO-GRNN model presents a well prediction performance in this study, it consumes much longer calculation time than RBFNN model and BPNN model. The calculation time mainly relies on two factors, including the parameter setting of PSO algorithm and the scale of sample data. Based on the defect of our study, the future research should focus on the improvement of the calculation efficiency of the proposed model. Two approaches should be attached great importance to in the future research. One approach is to modify parameter setting of PSO algorithm; the other one is to optimize the data processing. The latter can be realized by improving the manually established railway freight volume prediction index system and decreasing the dimension of sample data by rough set theory or other methods. Besides, the railway freight volume prediction in this study limits to the total volume prediction. In order to make the railway freight volume prediction more meaningful in railway network construction and railway operation and management, we should expend the railway freight total volume prediction to the railway freight volume prediction in the space distribution of railway network in the future research. Acknowledgments This study was supported by the Science and Technology Development Plan of Ministry of Railways, P.R.C. (No.2012X012-A) and the National Natural Science Foundation Project of P.R.C. (No.71390332). The authors would also thank the editors of the journal and the anonymous reviewers for their constructive suggests and comments that have led to a significant improvement of the manuscript. -429-
Journal of Industrial Engineering and Management – http://dx.doi.org/10.3926/jiem.1007 References Adeli, H., & Panakkat, A. (2009). A probabilistic neural network for earthquake magnitude prediction. Neural Networks, 22(7), 1018-1024. http://dx.doi.org/10.1016/j.neunet.2009.05.003 Brahme, A., Winning, M., & Raabe, D. (2009). Prediction of cold rolling texture of steels using an Artificial Neural Network. Computational Materials Science, 46(4), 800-804. http://dx.doi.org/10.1016/j.commatsci.2009.04.014 Chen, C., & Vachtsevanos, G. (2012). Bearing condition prediction considering uncertainty: an interval type-2 fuzzy neural network approach. Robotics and Computer-Integrated Manufacturing, 28(4), 509-516. http://dx.doi.org/10.1016/j.rcim.2012.02.005 Gnana Sheela, K., & Deepa, S.N. (2013). Neural network based hybrid computing model for wind speed prediction. Neurocomputing, 122, 425-429. http://dx.doi.org/10.1016/j.neucom.2013.06.008 Hashemi, A.B., & Meybodi, M.R. (2004). A note on the learning automata based algorithms for adaptive parameter selection in PSO. Applied Soft Computing Journal, 11(1), 689-705. http://dx.doi.org/10.1016/j.asoc.2009.12.030 Leeghim, H., Seo, I., & Bang, H. (2008). Adaptive nonlinear control using input normalized neural networks. Journal of Mechanical Science and Technology, 22(6), 1073-1083. http://dx.doi.org/10.1007/s12206-007-1119-1 Hou, Y., Lu, L., Xiong, X., Cheng, S., & Wu, Y. (2004). Enhanced particle swarm optimization algorithm and ITS application on economic dispatch of power system. Proceedings of The Chinese Society for Electrical Engineering, 24(7), 95-100. Kennedy, J., & Eberhart, R.C. (1995). Particle swarm optimization. 1995 IEEE International Conference on Neural Networks Proceedings, Perth, WA., (AUSTRALIA), 27 Nov.-1 Dec., 1995, available at: http://ieeexplore.ieee.org/stamp/stamp.jsp?tp=&arnumber=488968 Korres, D.M., Anastopoulos, G., Lois, E., Alexandridis, A., Sarimveis, H., & Bafas, G. (2002). A neural network approach to the prediction of diesel fuel lubricity. Fuel, 81(10), 1243-1250. http://dx.doi.org/10.1016/S0016-2361(02)00020-0 Liang, T., & Noore, A. (2004). Software reliability prediction using recurrent neural network with Bayesian regularization. International Journal of Neural Systems, 14(3), 165-174. http://dx.doi.org/10.1142/S0129065704001966 Liu, Z., Ji, L., Ye, Y., & Geng, Z. (2006). A study on prediction of railway freight volumes based on RBF neural network. Journal of the China Railway Society, 28(5), 1-5. -430-
Journal of Industrial Engineering and Management – http://dx.doi.org/10.3926/jiem.1007 López-Martín, C., Isaza C., & Chavoya, A. (2012). Software development effort prediction of industrial projects applying a general regression neural network. Empirical Software Engineering, 17(6), 738-756. http://dx.doi.org/10.1007/s10664-011-9192-6 Mostafa, M.M. (2012). Forecasting stock exchange movements using neural networks: Empirical evidence from Kuwait. Expert Systems with Applications, 37(9), 6302-6309. http://dx.doi.org/10.1016/j.eswa.2010.02.091 Nie, P., Geng, J., & Qin, Z. (2011). Self-adaptive inertia weight PSO test case generation algorithm considering prematurity restraining. International Journal of Digital Content Technology and its Applications, 5(9), 125-133. http://dx.doi.org/10.4156/jdcta.vol5.issue9.14 Okkan, U. (2012). Wavelet neural network model for reservoir inflow prediction. Scientia Iranica, 19(6), 1445-1455. http://dx.doi.org/10.1016/j.scient.2012.10.009 Ömer Faruk, D. (2010). A hybrid neural network and ARIMA model for water quality time series prediction. Engineering Applications of Artificial Intelligence, 23(4), 586-594. http://dx.doi.org/10.1016/j.engappai.2009.09.015 Parzen, E. (1962). On the estimation of a probability density function and mode. Annals of Mathematical Statistics, 33(3), 1065-1076. http://dx.doi.org/10.1214/aoms/1177704472 Ratnaweera, A., Halgamuge S.K., & Watson, H.C. (2004). Self-organizing hierarchical particle swarm optimizer with time-varying acceleration coefficients. IEEE Transactions on Evolutionary Computation, 8(3), 240-255. http://dx.doi.org/10.1109/TEVC.2004.826071 Specht, D.F. (1991). A general regression neural network. IEEE Transactions on Neural Networks, 2(6), 568-576. http://dx.doi.org/10.1109/72.97934 Tsuda, I. (1992). Dynamic link of memory-chaotic memory map in nonequilibrium neural networks. Neural Networks, 5(2), 313-326. http://dx.doi.org/10.1016/S0893-6080(05)80029-2 Wang, Z., Wang, Y., Jia, L., & Li, P. (2005). Application of improved BP neural network in the prediction of railway passenger volume time serial. China Railway Science, 26(2), 127-131. -431-
Journal of Industrial Engineering and Management – http://dx.doi.org/10.3926/jiem.1007 Appendix A. Main source code of PSO-GRNN model for railway freight volume prediction %%Simulation by Matlab R2012b clc clear all %%Initialization of PSO algorithm %Calculate the initial fitness value of each particle for i=1:popsize pop(i,:)=abs(rands(1,1)); v(i,:)=rands(1,1)*0.01; spread(i)=pop(i,:); net=newgrnn(sampleinput_train,sampleoutput_train,spread(i)); testout_sim(i,:)=sim(net,sampleinput_test); error(i,:)= testout_expect(i,:)- testout_sim(i,:); fitness(i)=mse(error(i,:)); end %Calculate the initial best personal position of the particle and best global position of the swarm [bestfitness bestparticle]=min(fitness); gbest=pop(bestparticle,:); pbest=repmat(pop,1,1); fitnesspbest=fitness; fitnessgbest=bestfitness; %%Search the optimal solution by PSO algorithm for j=1:maxiter %update the personal best position %update the velocity of the particle for i=1:popsize w=wmax-(wmax-wmin)*j/maxiter; c1=(c1f-c1i)*j/maxiter+c1i; c2=(c2f-c2i)*j/maxiter+c2i; v(i,:)= w*v(i,:)+ c1*rand*(pbest(i,:)-pop(i,:))+c2*rand*(gbestpop(i,:)); v(i,find(v(i,:)>vmax))=vmax; v(i,find(v(i,:)<vmin))=vmin; %Update the position of the particle pop(i,:)=pop(i,:)+v(i,:); pop(i,find(pop(i,:)>popmax))=popmax; %Update the fitness value of the particle spread(i)=pop(i,:); net=newgrnn(sampleinput_train, sampleoutput_train,spread(i)); testout_sim(i,:)=sim(net, sampleinput_test); error(i,:)= testout_expect(i,:)- testout_sim(i,:); fitness(i)=mse(error(i,:)); end %Update the best personal position of the particle for i=1:popsize if fitness(i)<fitnesspbest(i) pbest(i,:)=pop(i,:); fitnesspbest(i)=fitness(i); end end %Update the global best position of the swarm for i=1:popsize if fitness(i)<fitnessgbest gbest=pop(i,:); fitnessgbest=fitness(i); end end -432-
Journal of Industrial Engineering and Management – http://dx.doi.org/10.3926/jiem.1007 best_fitness(j)= fitnessgbest; best_spread(j)= gbest; end %%Construct GRNN with best spread [gbestfitness gbestparticle]=min(best_fitness); gbestspread= best_spread(gbestparticle); net=newgrnn(sampleinput_train, sampleinput_train,best_spread); testout_sim(i,:)=sim(net,sampleinput_test); Journal of Industrial Engineering and Management, 2014 (www.jiem.org) Article's contents are provided on a Attribution-Non Commercial 3.0 Creative commons license. Readers are allowed to copy, distribute and communicate article's contents, provided the author's and Journal of Industrial Engineering and Management's names are included. It must not be used for commercial purposes. To see the complete license contents, please visit http://creativecommons.org/licenses/by-nc/3.0/. -433-