Developing a Time Series Model Based on Particle ... - IEEE Xplore

12 downloads 506 Views 316KB Size Report
Page 1 ... Swarm Optimization for Gold Price Forecasting. Esmaeil Hadavandi. Department ... techniques, particle swarm optimization (PSO) is one of the best AI ...
2010 Third International Conference on Business Intelligence and Financial Engineering

Developing a Time Series Model Based On Particle Swarm Optimization for Gold Price Forecasting Esmaeil Hadavandi

Arash Ghanbari

Salman Abbasian-Naghneh

Department of Industrial Engineering Sharif University of Technology Tehran, Iran, P.O. Box: 113659466 [email protected]

Department of Industrial Engineering University of Tehran Tehran, Iran P.O. Box: 11155-4563 [email protected] ([email protected])

Department of Mathematic Islamic Azad University Najafabad Branch, Najafabad, Iran [email protected]

genetic algorithms (GAs) and particle swarm optimization (PSO) are being developed and deployed worldwide in myriad applications, main reasons behind this issue are: their accuracy, symbolic reasoning, flexibility and explanation capabilities [1]. Nowadays, more and more effort has been focused on AI models to stock market prediction and using AI models or combining several models has become a common practice to improve forecasting accuracy and the literature on this topic has expanded dramatically. [2] A number of studies have compared the capability of AI techniques with conventional techniques such as ARIMA, Regression etc. in the field of financial time series forecasting and they have found that AI-based systems have more accurate results than conventional approaches such as ARIMA, Regression etc. [3,4,5,6,7,8,9]. In the field of gold price forecasting, there are different papers which have used AI-based techniques and obtained very promising results. Parisi et.al [10] analyzed recursive and rolling neural network models to forecast one-stepahead sign variations in gold price. The results showed the rolling ward networks exceed the recursive ward networks and feed forward networks in forecasting gold price sign variation. The results supported the use of neural networks with a dynamic framework to forecast the gold price sign variations, recalculating the weights of the network on a period-by-period basis, through a rolling process. Khashei et.al [11] proposed a new hybrid method based on the basic concepts of ANNs and fuzzy regression models, that yields more accurate results with incomplete data sets. They combined advantages of ANNs and fuzzy regression to overcome the limitations in both ANNs and fuzzy regression models. The empirical results of gold price and exchange rate forecasting indicate that the proposed model can be an effective way of improving forecasting accuracy. Khashei et al. [2] proposed ARIMA models integrated with Artificial Neural Networks (ANNs) and Fuzzy logic in order to overcome the linear and data limitations of ARIMA models, thus obtaining more accurate results. Empirical results of gold price forecasting indicate that the hybrid models exhibit effectively improved forecasting accuracy so that the model proposed can be used as an alternative to financial market forecasting tools.

Abstract-The trend of gold price in the market is the most important consideration for the investors of the gold, and serves as the basis of gaining profit, so there are scholars who try to forecast the gold price. Forecasting accuracy is one of the most important factors involved in selecting a forecasting method. Besides, nowadays artificial intelligence (AI) techniques are becoming more and more widespread because of their accuracy, symbolic reasoning, flexibility and explanation capabilities. Among these techniques, particle swarm optimization (PSO) is one of the best AI techniques for optimization and parameter estimation. In this study a PSO-based time series model for the gold price forecasting is proposed that uses PSO algorithm for parameter estimation. We evaluate capability of the proposed model by applying it on daily observation of gold price and compare the outcomes with previous methods using mean absolute error (MAE). Results show that the proposed approach is able to cope with the fluctuations of gold price time series and it also yields good prediction accuracy, so it can be considered as a suitable tool for financial forecasting problems. Keywords- Gold Price Forecasting; Particle Swarm Optimization(PSO); Time Series

I.

INTRODUCTION AND LITERATURE REVIEW

Forecasting activities are frequent and widespread in our life. Forecasting is the process of making projections about future performance based on existing historic data. An accurate forecast aids in decision-making and planning for the future. Forecasts empower people to modify current variables in the present to predict the future to result in a favorable scenario. Following the melt-down of US dollars, investors are putting their money into gold because gold plays an important role as a stabilizing influence for investment portfolios .Gold is now once again accepted as a potential currency and demand for this commodity is on the rise. The trend of gold price in the market is the most important consideration for the investors of the gold, and serves as the basis of gaining profit, so there are scholars who try to forecast the gold price accurately in nowadays. Artificial intelligence (AI) that computerizes human reasoning has been widely used in many areas including financial time series forecasting. AI-based techniques are becoming more and more widespread. These techniques such as artificial neural networks (ANNs), fuzzy logic, 978-0-7695-4116-7/10 $26.00 © 2010 IEEE DOI 10.1109/BIFE.2010.85

337

Where, vik : velocity of agent i at iteration k, w k : value of weighting function at iteration k, cj : weighting factor, rand: random number between 0 and 1, sik : current position of agent i at iteration k, pbest i : best position of agent i, gbest: best position of group. Using the above equation, a certain velocity, which gradually gets close to pbest and gbest can be calculated. The current position (searching point in the solution space) can be modified by the following equation:

PSO is one of the best AI techniques for optimization and parameter estimation. Emad et al. [12] presented comparison among five recent AI-based optimization algorithms: genetic algorithms, memetic algorithms, particle swarm, ant-colony systems, and shuffled frog leaping. The comparative results showed that the PSO method was generally found to perform better than other algorithms in terms of success rate and solution quality. In this study a PSO-based time series model for the gold price forecasting is proposed that uses PSO algorithm for parameter estimation. Gold price forecasting, in term of input, will be addressed using time lags of gold price as inputs. We use daily observations of gold price (Gram/US$) from 26 November 2005 to 18 January 2006 which is also used by Khashei et.al [11] and Khashei et al. [2] as the case study.

‫݇݅ݏ‬+1 = ‫ ݇݅ݏ‬+ ‫ ݇݅ݒ‬+1

Figure 1 shows a searching concept with agents in a solution space and Figure 2 shows a concept of modification of a searching point by PSO [14].

X2

II. METHODOLOGY

Agent

PSO is one of the optimization techniques and belongs to evolutionary computation techniques was developed by Kennedy and Eberhart [13] . The method has been developed through a simulation of simplified social models. The features of the method are as follows: (1) The method is based on researches on swarms such as fish schooling and bird flocking. (2) It is based on a simple concept. Therefore, the computation time is short and it requires few memories. According to the research results for bird flocking, birds are finding food by flocking (not by each individual). It leaded the assumption that information is owned jointly in flocking. According to observation of behavior of human groups, behavior pattern on each individual is based on several behavior patterns authorized by the groups such as customs and the experiences by each individual (agent). These assumptions are basic concepts of PSO. PSO is basically developed through simulation of bird flocking in two-dimension space. The position of each individual is represented by XY axis position and also the velocity is expressed by vx (the velocity of X axis) and vy (the velocity of Y axis). Modification of the agent position is realized by the position and velocity information. An optimization technique based on the above concept can be described as follows: namely, bird flocking optimizes a certain objective function. Each agent knows its best value so far (pbest) and its XY position. Moreover, each agent knows the best value so far in the group (gbest) among pbests. Each agent tries to modify its position using the following information: x the current positions (x,y), x the current velocities (vx,vy), x the distance between the position, and pbest and gbest.

X3 Xn

X1

Figure 1. Searching concept with agents in a solution space by PSO.

Y

sk+1

Vk+1 Vgbest

Vk Vpbest sk

X k

s : current searching point, k+1 s : modified searching point, k V : current velocity, k+1 V : modified velocity, Vpbest : velocity based on pbest, Vgbest : velocity based on gbest Figure 2. Concept of modification of a searching point by PSO.

III. EXPERIMENTAL RESULTS In this section, we use 40 daily observations of gold price (Gram/US$) from 26 November 2005 to 18 January 2006 which is used by Khashei et.al. [11] and Khashei et al. [2] as the case study. Applying the proposed method, 35 observations are first used to formulate the model and the last five observations are used to evaluate the performance of the model. Gold price forecasting, in term of input, will be addressed using time lags of gold price as inputs. We use 2 lags of gold price as input variables, so the proposed PSO-based time series model is used for a projecting/reflecting action:

current

This modification can be represented by the concept of velocity. Velocity of each agent can be modified by the following equation: ‫݇݅ݒ‬+1 = ‫ ݇݅ݒ × ݇ ݓ‬+ ܿ1 ‫ × ݀݊ܽݎ‬൫‫ ݅ݐݏܾ݁݌‬െ ‫ ݇݅ݏ‬൯ +

(2)

(1)

ܿ2 ‫ × ݀݊ܽݎ‬൫ܾ݃݁‫ ݐݏ‬െ ‫ ݇݅ݏ‬൯

338

‫ߙ = )݇(ܲܩ‬1 ‫ ݇(ܲܩ‬െ 1) + ߙ2 ‫ ݇(ܲܩ‬െ 2) + ߙ3

(3)

B. Performance analysis of the proposed model For the purpose of evaluating forecasting accuracy of proposed model, we use test set data and compare outputs of proposed model with models proposed by Khashei et al. [11] and Khashei et al. [2] and OLS method. We perform this task by one common evaluation statistics called mean absolute error (MAE):

Where GP(k) is Gold price in kth day. PSO algorithm is used for estimation of parameters’ vector (Ƚ1 , Ƚ2 , Ƚ3 ). We also used ordinary least square (OLS) method that is commonly used as a parameter estimation method. But two major problems occur when using OLS for such studies, namely the problem of correlated errors since the data studied is time series and the problem of multicollinearity due to the correlation between the two independent variables. So we expect that OLS method does not provide good results.

ܰ

1 ‫ = ܧܣܯ‬෍|ܻ݅ െ ܲ݅ | ܰ

Where Yi is actual value and Pi is the forecasted value of ith test data obtained from proposed model and N is number of test data. The comparisons of different models in literature and the proposed model are listed in Table III.

A. Implementing PSO-based time series model for Gold price forecasting In this stage we’ll construct the PSO-based time series model using Matlab Software. To meet the best architectures with least errors, different feature of parameters such as number of Particles, weight function, etc. have been examined. Best obtained features after tuning process are detailed in Tables I. Estimated model by using PSO algorithm is presented in the following equation:

TABLE III. COMPARISON OF PROPOSED MODEL WITH OTHER MODELS Method MAE Hybrid of ANN and Fuzzy Regression [11] 0.097 ARIMA [11] 0.105 Hybrid of ARIMA, ANN and Fuzzy [2] 0.065 OLS method 0.098 PSO-based time series model(Proposed model) 0.047

GP(k) = 0.976 GP(k െ 1) + 0.01373 GP(k െ 2) + 0.11157 (4)

Regarding to Table III, our proposed model has improved the forecasting accuracy of Gold price and outperforms rest of the models, so the proposed model can be considered as a suitable tool to deal with forecasting problems.

Actual and predicted values of proposed model for test data set are shown in Table II. Also the forecasting results are shown in Figure 3. TABLE I. TUNED FEATURE OF PSO FOR MODEL Parameter Value ‫ܥ‬1 = ‫ܥ‬2 2 # of Particles 200 # of Iterations 150 # of Parameters 3 ‫( = ݇ ݓ‬0.95)݇ Weight Function

IV. CONCLUSIONS This study proposed a PSO-based time series model for the gold price forecasting that uses PSO algorithm for parameter estimation. We evaluated capability of the proposed model by applying it on daily observation of gold price and compared the outcomes with previous methods using mean absolute error (MAE). Experimental results showed that the proposed model was able to cope with the fluctuations of gold price time series and it also yielded good prediction accuracy and outperformed other models which exist in literature. So it can be considered as a suitable tool for financial forecasting problems.

1

Min ݂(‫ = )ݔ‬σ݊݅=1ห‫ ݈ܽݑݐܿܽܧ‬െ ݊

Cost Function

‫| ݀݁ݐݏܽܿ݁ݎ݋݂ܧ‬

TABLE II. ACTUAL AND PREDICTED VALUES OF TEST DATA FOR PROPOSED MODEL Date Actual Forecasted Absolute Error 14-Jan 10.87 10.8656563 0.004344 15-Jan 11.06 10.8755589 0.184441 16-Jan 11.08 11.0612369 0.018763 17-Jan 11.06 11.0833762 0.023376 18-Jan 11.06 11.0641202 0.00412

REFERENCES [1] K. Metaxiotis, A. Kagiannas, D. Askounis, and J. Psarras, "Artificial intelligence in short term electric load forecasting:a state-of-the-art survey for the researcher," Energy Conversion and Management, vol. 44, p. 1525–1534, 2003.

11.2

[2] Mehdi Khashei, Mehdi Bijaria, and Gholam Ali Raissi Ardali, "Improvement of Auto-Regressive Integrated Moving Average models using Fuzzy logic and Artificial Neural Networks (ANNs) ," Neurocomputing, vol. 72, no. 4-6, pp. 956-967 , 2009.

11 10.8 10.6 10.4

[3] Pei-Chann Chang and Chen-Hao Liu, "A TSK type fuzzy rule based system for stock price prediction," Expert Systems with Applications, vol. 34, pp. 135-144, 2008.

10.2 10 28-Nov

(5)

݅=1

8-Dec

18-Dec

Actual

28-Dec

7-Jan

[4] Rafiul Hassan, "A combination of hidden Markov model and fuzzy model for stock market forecasting," Neurocomputing, vol. 72, p. 3439–3446, 2009.

17-Jan

Forecasted

[5] Jin-II Park, Dae-Jong Lee, Chang-Kyu Song, and Myung-Geun Chun, "TAIFEX and KOSPI 200 forecasting based on two-factors high-order fuzzy time series and particle swarm optimization,"

Figure 3. The forecasting results of the proposed model

339

Expert Systems with Applications, vol. 37, p. 959–967, 2010. [6] Mehdi Khashei and Mehdi Bijari, "An artificial neural network (p, d,q) model for timeseries forecasting," Expert Systems with Applications, vol. 37, p. 479–489, 2010. [7] Md. Rafiul Hassan, Baikunth Nath, and Michael Kirley, "A fusion model of HMM, ANN and GA for stock market forecasting," Expert Systems with Applications, vol. 33, p. 171–180, 2007. [8] M. R. Hassan and B. Nath, "Stock market forecasting using hidden markov model: a new approach," in 5th international conference on intelligent system design and application, Poland, 2005, p. 192– 196. [9] Jui-Chung Hung, "A fuzzy GARCH model applied to stock market scenario using a genetic algorithm," Expert Systems with Applications , vol. 36, p. 11710–11717, 2009. [10] $QWRQLQR3DULVL)UDQFR3DULVLDQG'DYLG'ÕD])RUHFDVWLQJJROG price changes: Rolling and recursive neural network models," J. of Multi. Fin. Manag. , vol. 18, p. 477–487, 2008. [11] Mehdi Khashei, Seyed Reza Hejazi, and Mehdi Bijari, "A new hybrid artificial neural networks and fuzzy regression model for time series forecasting," Fuzzy Sets and Systems, vol. 159, p. 769 – 786, 2008. [12] E. Emad, H. Tarek, and G. Donald, "Comparison among five evolutionary-based optimization algorithm," Advanced Engineering Informatics, vol. 19, p. 43–53, 2005. [13] Kennedy and R. Eberhart, "Particle Swarm Optimization," in IEEE International Conference on Neural Networks (ICNN), Australia, 1995, pp. 1942-1948. [14] Kwang Y. Lee and Mohamed A. El-Sharkawi, Fundumentals of Particle Swarm Optimization Techniques," in Modern Heuristic Optimization Techniques: Theory and Applications to Power Systems. New Jersey, United States of America: John Wiley & Sons, 2008.

340

Suggest Documents