Abstract
The support vector regression (SVR) has been employed to deal with stock price forecasting problems. However, the selection of appropriate kernel parameters is crucial to obtaining satisfactory forecasting performance. This paper proposes a novel approach for forecasting stock prices by combining the SVR with the firefly algorithm (FA). The proposed forecasting model has two stages. In the first stage, to enhance the global convergence speed, a modified version of the FA, which is termed the MFA, is developed in which the dynamic adjustment strategy and the opposition-based chaotic strategy are introduced. In the second stage, a hybrid SVR model is proposed and combined with the MFA for stock price forecasting, in which the MFA is used to optimize the SVR parameters. Finally, comparative experiments are conducted to show the applicability and superiority of the proposed methods. Experimental results show the following: (1) Compared with other algorithms, the proposed MFA algorithm possesses superior performance, and (2) The proposed MFA-SVR prediction procedure can be considered as a feasible and effective tool for forecasting stock prices.
Similar content being viewed by others
References
Alatas B, Akin E, Ozer AB (2009) Chaos embedded particle swarm optimization algorithms. Chaos Solitons Fractals 40(4):1715–1734
Armano G, Marchesi M, Murru A (2005) A hybrid genetic-neural architecture for stock indexes forecasting. Inf Sci 170(1):3–33
Bahrammirzaee A (2010) A comparative survey of artificial intelligence applications in finance: artificial neural networks, expert system and hybrid intelligent systems. Neural Comput Appl 19(8):1165–1195
Bansal JC, Josh SK, Nagar AK (2018) Fitness varying gravitational constant in GSA. Appl Intell 3:1–16
Bisoi R, Dash P K (2014) A hybrid evolutionary dynamic neural network for stock market trend analysis and prediction using unscented Kalman filter. Appl Soft Comput 19(6):41–56
Bollerslev T (1986) Generalized autoregressive conditional heteroskedasticity. J Econ 31(3):307–327
Bollerslev T, Marrone J, Xu L, Zhou H (2014) Stock return predictability and variance risk premia: statistical inference and international evidence. J Financ Quant Anal 49(3):633–661
Box GEP, Jenkins GM (1976) Time series analysis: forecasting and control Revised Ed. San Francisco, Holden-Day
Cao L, Tay FEH (2001) Financial forecasting using support vector machines. Neural Comput Appl 10 (2):184–192
Chang PC, Liu CH (2008) A TSK type fuzzy rule based system for stock price prediction. Expert Syst Appl 34(1):135–144
Chapelle O, Vapnik V, Bousquet O, Mukherjee S (2002) Choosing multiple parameters for support vector machines. Mach Learn 46(1-3):131–159
Chen X, Zhou Y, Tang Z, Luo Q (2017) A hybrid algorithm combining glowworm swarm optimization and complete 2-opt algorithm for spherical travelling salesman problems. Appl Soft Comput 58:104–114
Chen W (2015) Artificial bee colony algorithm for constrained possibilistic portfolio optimization problem. Physica A 429:125–139
Chen W, Wang Y, Gupta P, Mehlawat M K (2018) A novel hybrid heuristic algorithm for a new uncertain mean-variance-skewness portfolio selection model with real constraints. Appl Intell 48:2996–3018
Chen W, Wang Y, Mehlawat MK (2016) A hybrid FA-SA algorithm for fuzzy portfolio selection with transaction costs. Ann Oper Res 269(1-2):129–147
Cortes C, Vapnik V (1995) Support-vector networks. Mach Learn 20(3):273–297
Dai W, Shao Y E, Lu CJ (2013) Incorporating feature selection method into support vector regression: for stock index forecasting. Neural Comput Appl 23(6):1551–1561
Darrat AF, Zhong M (2000) On testing the random-walk hypothesis: a model-comparison approach. Financ Rev 35(3):105–124
El-Shorbagy MA, Mousa AA, Nasr SM (2016) A chaos-based evolutionary algorithm for general nonlinear programming problems. Chaos Solitons Fractals 85(2):8–21
Engle RF (1982) Autoregressive conditional heteroscedasticity with estimates of the variance of United Kingdom inflation. Econometrica 50(4):987–1007
Fister I, Jr I f, Yang XS, Brest J (2013) A comprehensive review of firefly algorithms. Swarm Evol Comput 13(1):34–46
Gandomi AH, Yang XS, Talatahari S, Alavi AH (2013) Firefly algorithm with chaos. Commun Nonlinear Sci Numer Simul 18(1):89–98
Gavrishchaka VV, Banerjee S (2006) Support vector machine as an efficient framework for stock market volatility forecasting. Comput manag sci 3(2):147–160
Ghelardoni L, Ghio A, Anguita D (2013) Energy load forecasting using empirical mode decomposition and support vector regression. IEEE Trans Smart Grid 4(1):549–556
Gu J, Zhu M, Jiang L (2011) Housing price forecasting based on genetic algorithm and support vector machine. Expert Syst Appl 38(4):3383–3386
Guo Y, Han S, Shen C, Li Y, Yin X, Bai Y (2018) An adaptive SVR for high-frequency stock price forecasting. IEEE Access 6(99):11397–11404
Hafezi R, Shahrabi J, Hadavandi E (2015) A bat-neural network multi-agent system (BNNMAS) for stock price prediction: case study of DAX stock price. Appl Soft Comput 29:196–210
Hansen JV, Nelson RD (1997) Neural networks and traditional time series methods: a synergistic combination in state economic forecasts. IEEE Trans Neural Netw 8(4):863–873
Holland JH (1975) Adaptation in natural and artificial systems: an introductory analysis with applications to biology, control and artificial intelligence, USA. University of Michigan
Hong WC, Dong Y, Zheng F, Lai CY (2011) Forecasting urban traffic flow by SVR with continuous ACO. Appl Math Model 35(3):1282–1291
Hong WC, Pai PF (2006) Predicting engine reliability by support vector machines. Int J Adv Manuf Technol 28(1-2):154–161
Hong WC, Pai PF (2007) Potential assessment of the support vector regression technique in rainfall forecasting. Water Resour Manag 21(2):495–513
Huang CF (2012) A hybrid stock selection model using genetic algorithms and support vector regression. Appl Soft Comput 12(2):807–818
Huang H, Wei X, Zhou Y (2016) A sparse method for least squares twin support vector regression. Neurocomputing 211:150–158
Huang H, Wei X, Zhou Y (2018) Twin support vector machines: A survey. Neurocomputing 300:34–43
Huang SC, Chuang PJ, Wu CF, Lai HJ (2010) Chaos-based support vector regressions for exchange rate forecasting. Expert Syst Appl 37(12):8590–8598
Huang SC, Wu TK (2010) Combining wavelet-based feature extractions with relevance vector machines for stock index forecasting. Expert Syst 25(2):133–149
Hussain AJ, Knowles A, Lisboa PJG, El-Deredy W (2008) Financial time series prediction using polynomial pipelined neural networks. Expert Syst Appl 35(3):1186–1199
Kazem A, Sharifi E, Hussain FK, Saberi M, Hussain OK (2013) Support vector regression with chaos-based firefly algorithm for stock market price forecasting. Appl Soft Comput 13(2):947–958
Kennedy J, Eberhart RC (1995) Particle swarm optimization. In: Proceedings of the IEEE international conference on neural networks, pp 1942–1948
Khare K, Darekar O, Gupta P, Attar V Z (2017) Short term stock price prediction using deep learning. In: 2017 2nd IEEE international conference on recent trends in electronics information & communication technology (RTEICT). IEEE, pp 482–486
Kim EY (2017) MRF model based real-time traffic flow prediction with support vector regression. Electron Lett 53(4):243–245
Kim JH, Shamsuddin A, Lim K P (2011) Stock return predictability and the adaptive markets hypothesis: evidence from century-long U.S. data. J Empir Financ 18(5):868–879
Kim KJ (2003) Financial time series forecasting using support vector machines. Neurocomputing 55(1):307–319
Kim KJ, Han I (2000) Genetic algorithms approach to feature discretization in artificial neural networks for the prediction of stock price index. Expert Syst Appl 19(2):125–132
Li XL, Shao ZJ, Qian J (2002) An optimizing method based on autonomous animats: fish-swarm algorithm. Syst Eng Theory Pract 22:32–38. (in Chinese)
Lin SW, Ying KC, Chen SC, Lee ZJ (2008) Particle swarm optimization for parameter determination and feature selection of support vector machines. Expert Syst Appl 35(4):1817–1824
Liu CF, Yeh CY, Lee SJ (2012) Application of type-2 neuro-fuzzy modeling in stock price prediction. Appl Soft Comput 12(4):1348–1358
Lo AW, Mamaysky H, Wang J (2002) Foundations of technical analysis: computational algorithms, statistical inference, and empirical implementation. In: Advanced Trading Rules (2nd edn.) 55(4):42–111
Long NC, Meesad P, Unger H (2015) A highly accurate firefly based algorithm for heart disease prediction. Expert Syst Appl 42(21):8221–8231
Lu CJ (2013) Hybridizing nonlinear independent component analysis and support vector: regression with particle swarm optimization for stock index forecasting. Neural Comput Appl 23(7-8):2417–2427
Majhi B, Rout M, Baghel V (2014) On the development and performance evaluation of a multiobjective GA-based RBF adaptive model for the prediction of stock indices. J King Saud University-Comput Inf Sci 26 (3):319–331
Majhi R, Panda G, Sahoo G, Panda A (2008) Prediction of S&P 500 and DJIA stock indices using particle swarm optimization technique. In: 2008 IEEE world congress on computational intelligence evolutionary computation (CEC). IEEE, pp 1276–1282
Malkiel BG (2003) The efficient market hypothesis and its critics. J Econ Perspect 17(1):59–82
Marichelvam MK, Prabaharan T, Yang XS (2014) A discrete firefly algorithm for the multi-objective hybrid flowshop scheduling problems. IEEE Trans Evol Comput 18(2):301–305
Mirjalili S, Gandomi AH, Mirjalili SZ, Saremi S, Faris H, Mirjalili SM (2017) Salp swarm algorithm: a bio-inspired optimizer for engineering design problems. Adv Eng Softw 114:163–191
Mostafa MM (2010) Forecasting stock exchange movements using neural networks: empirical evidence from Kuwait. Expert Syst Appl 37(9):6302–6309
Oh SK, Pedrycz W, Park HS (2006) Genetically optimized fuzzy polynomial neural networks. IEEE Trans Fuzzy Syst 14(1):125–144
Ozer AB (2010) CIDE: Chaotically initialized differential evolution. Expert Syst Appl 37(6):4632–4641
Pérez-cruz F, Afonso-rodríguez JA, Giner J (2003) Estimating GARCH models using support vector machines. Quant Financ 3(3):163–172
Phan DHB, Sharma S S, Narayan P K (2015) Stock return forecasting: some new evidence. Int Rev Financ Anal 40:38–51
Qi M, Zhang GP (2003) Trend time-series modeling and forecasting with neural networks. IEEE Trans Neural Netw 19(5):808–816
Qiu M, Song Y, Akagi F (2016) Application of artificial neural network for the prediction of stock market returns: the case of the Japanese stock market. Chaos Solitons Fractals 85:1–7
Rahmani A, Mirhassani SA (2014) A hybrid firefly-genetic algorithm for the capacitated facility location problem. Inf Sci 283(4):70–78
Rashedi E, Nezamabadi-Pour H, Saryazdi S (2009) GSA: a gravitational search algorithm. Inf Sci 179:2232–2248
Sayed GI, Khoriba G, Haggag MH (2018) A novel chaotic salp swarm algorithm for global optimization and feature selection. Appl Intell 48(10):3462–3481
Singh R, Srivastava S (2016) Stock prediction using deep learning. Multimed Tools Appl 76(18):18569–18584
Senol D, Ozturan M (2008) Stock price direction prediction using artificial neural network approach: the case of Turkey. J Artif Intell Res 1(2):92–107
Tizhoosh HR (2005) Opposition-based learning: a new scheme for machine intelligence. In: International conference on intelligent agents, web technologies and internet commerce, pp 695–701
Vapnik V, Golowich SE, Smola A (1997) Support vector method for function approximation, regression estimation, and signal processing. Adv Neural Inf Proces Syst 9:281–287
Wang H, Wang W, Cui L, Sun H, Zhao J, Wang Y, Xue Y (2018) A hybrid multi-objective firefly algorithm for big data optimization. Appl Soft Comput 69:806–815
Wang H, Zhou X, Sun H, Yu X, Zhao J, Zhang H, Cui L (2017) Firefly algorithm with adaptive control parameters. Soft Comput 21(17):5091–5102
Wang HB, Fan CC, Tu XY (2016) AFSAOCP: a novel artificial fish swarm optimization algorithm aided by ocean current power. Appl Intell 45:1–16
Wang J, Hou R, Wang C, Shen L (2016) Improved -̌Support vector regression model based on variable selection and brain storm optimization for stock price forecasting. Appl Soft Comput 49:164–178
Xiong T, Bao Y, Hu Z (2014) Multiple-output support vector regression with a firefly algorithm for interval-valued stock price index forecasting. Knowledge-Based Syst 55:87–100
Yang CH, Tsai SW, Chuang LY, Yang CH (2012) An improved particle swarm optimization with double-bottom chaotic maps for numerical optimization. Appl Math Comput 219(1):260–279
Yang XS (2008) Nature-inspired metaheuristic algorithms: Luniver Press
Yang XS, He X (2013) Firefly algorithm: recent advances and applications. Int J Swarm Intell 1:36–50
Yeh CY, Huang CW, Lee SJ (2011) A multiple-kernel support vector regression approach for stock market price forecasting. Expert Syst Appl 38(3):2177–2186
Yu L, Wang S, Lai KK (2009) A neural-network-based nonlinear metamodeling approach to financial time series forecasting. Appl Soft Comput 9(2):563–574
Yu S, Zhu S, Ma Y, Mao D (2015) Enhancing firefly algorithm using generalized opposition-based learning. Computing 97(7):741–754
Zarandi MHF, Rezaee B, Turksen IB, Neshat E (2009) A type-2 fuzzy rule-based expert system model for stock price analysis. Expert Syst Appl 36(1):139–154
Zhao W, Tao T, Zio E, Wang W (2016) A novel hybrid method of parameters tuning in support vector regression for reliability prediction: particle swarm optimization combined with analytical selection. IEEE Trans Reliab 65(3):1393–1405
Zhou Y, Luo Q, Liu J (2014) Glowworm swarm optimization for dispatching system of public transit vehicles. Neural Process Lett 40(1):25–33
Zhou Y, Zhou G, Zhang J (2015) A hybrid glowworm swarm optimization algorithm to solve constrained multimodal functions optimization. Optimization 64(4):1057–1080
Acknowledgments
This research was supported by the Beijing Social Science Fund (No. 18YJB007). The author Yu-Fan Teng acknowledges the support by Graduate Science and Technology Innovation Foundation from the Capital University of Economics and Business, Beijing, China.
Author information
Authors and Affiliations
Corresponding author
Appendix
Appendix
Proof of Theorem
Assume that, among N fireflies, their brightness are in sequential order. Namely, firefly 1 is the brightest, and firefly N is the worst.
In the following, we will prove the theorem by induction.
STEP 1: Suppose that there are two fireflies. Then we have
Note that
Then, according to (18) and (19), we have
Because 0 < β0 < 1, we have \(0<1-\beta _{0}e^{-\gamma r_{1, 2}^{2}}<1\). Moreover, we know that \(\lim \limits _{t\rightarrow +\infty }\alpha (t)= 0\). Thus, according to (20), we have
Furthermore, we have \({\lim \limits _{t\to +\infty }}r_{1,2}(t)= 0\). That’s to say,
STEP 2: Let k ≥ 2 be an integer. Suppose that k fireflies are convergent. Namely, for some xi, xj, i,j = 1, 2,…,k, and for arbitrary 𝜖 > 0, there exists T > 0, such that t > T, implies rij < 𝜖.
Next, we will prove k + 1 fireflies are also convergent. Here, the reduction to absurdity is employed.
Suppose that k + 1 fireflies are not convergent, i.e., for arbitrary T > 0, there exists t > T such that r1,k+ 1(t) > 𝜖. If the firefly k + 1 is attracted by firefly s(1 ≤ s ≤ k), then we have
Note that
Furthermore, from (23), and (24), we have
From assumptions, we know that k fireflies are convergent, i.e., 0 < ||x1(t) − xs(t)|| < 𝜖, and k + 1th firefly is not convergent, namely, ||x1(t) − xk+ 1(t)|| > 𝜖. Namely, 0 < ||x1(t) − xs(t)|| < 𝜖 < ||x1(t) − xk+ 1(t)||. Moreover, we know that \(0<1-\beta _{0}e^{-\gamma r_{s,k + 1}^{2}}<1\). Thus, we have
Therefore, according to (26), and \(\lim \limits _{t\rightarrow +\infty }\alpha (t)= 0\), we have
Furthermore, from (25) and (27), we have \({\lim \limits _{t \to +\infty }}r_{1, k + 1}(t)\) = 0. That’s to say, k + 1th firefly is convergent, i.e., for some 𝜖 > 0, there exists T > 0, such that t > T, implies r1k+ 1(t) < 𝜖, which is contrary with assumption. Therefore, we have k + 1 fireflies are convergent.
Based on the STEP 1 and STEP 2, the theorem is proved. □
Rights and permissions
About this article
Cite this article
Zhang, J., Teng, YF. & Chen, W. Support vector regression with modified firefly algorithm for stock price forecasting. Appl Intell 49, 1658–1674 (2019). https://doi.org/10.1007/s10489-018-1351-7
Published:
Issue Date:
DOI: https://doi.org/10.1007/s10489-018-1351-7