# Support vector regression with modified firefly algorithm for stock price forecasting

- 368 Downloads

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

## Keywords

Stock price forecasting Support vector regression Firefly algorithm Opposition-based learning Chaotic## Notes

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

## References

- 1.Alatas B, Akin E, Ozer AB (2009) Chaos embedded particle swarm optimization algorithms. Chaos Solitons Fractals 40(4):1715–1734MathSciNetzbMATHGoogle Scholar
- 2.Armano G, Marchesi M, Murru A (2005) A hybrid genetic-neural architecture for stock indexes forecasting. Inf Sci 170(1):3–33MathSciNetGoogle Scholar
- 3.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–1195Google Scholar
- 4.Bansal JC, Josh SK, Nagar AK (2018) Fitness varying gravitational constant in GSA. Appl Intell 3:1–16Google Scholar
- 5.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–56Google Scholar
- 6.Bollerslev T (1986) Generalized autoregressive conditional heteroskedasticity. J Econ 31(3):307–327MathSciNetzbMATHGoogle Scholar
- 7.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–661Google Scholar
- 8.Box GEP, Jenkins GM (1976) Time series analysis: forecasting and control Revised Ed. San Francisco, Holden-DayzbMATHGoogle Scholar
- 9.Cao L, Tay FEH (2001) Financial forecasting using support vector machines. Neural Comput Appl 10 (2):184–192zbMATHGoogle Scholar
- 10.Chang PC, Liu CH (2008) A TSK type fuzzy rule based system for stock price prediction. Expert Syst Appl 34(1):135–144MathSciNetGoogle Scholar
- 11.Chapelle O, Vapnik V, Bousquet O, Mukherjee S (2002) Choosing multiple parameters for support vector machines. Mach Learn 46(1-3):131–159zbMATHGoogle Scholar
- 12.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–114Google Scholar
- 13.Chen W (2015) Artificial bee colony algorithm for constrained possibilistic portfolio optimization problem. Physica A 429:125–139MathSciNetzbMATHGoogle Scholar
- 14.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–3018Google Scholar
- 15.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–147MathSciNetzbMATHGoogle Scholar
- 16.Cortes C, Vapnik V (1995) Support-vector networks. Mach Learn 20(3):273–297zbMATHGoogle Scholar
- 17.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–1561Google Scholar
- 18.Darrat AF, Zhong M (2000) On testing the random-walk hypothesis: a model-comparison approach. Financ Rev 35(3):105–124Google Scholar
- 19.El-Shorbagy MA, Mousa AA, Nasr SM (2016) A chaos-based evolutionary algorithm for general nonlinear programming problems. Chaos Solitons Fractals 85(2):8–21MathSciNetzbMATHGoogle Scholar
- 20.Engle RF (1982) Autoregressive conditional heteroscedasticity with estimates of the variance of United Kingdom inflation. Econometrica 50(4):987–1007MathSciNetzbMATHGoogle Scholar
- 21.Fister I, Jr I f, Yang XS, Brest J (2013) A comprehensive review of firefly algorithms. Swarm Evol Comput 13(1):34–46Google Scholar
- 22.Gandomi AH, Yang XS, Talatahari S, Alavi AH (2013) Firefly algorithm with chaos. Commun Nonlinear Sci Numer Simul 18(1):89–98MathSciNetzbMATHGoogle Scholar
- 23.Gavrishchaka VV, Banerjee S (2006) Support vector machine as an efficient framework for stock market volatility forecasting. Comput manag sci 3(2):147–160MathSciNetzbMATHGoogle Scholar
- 24.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–556Google Scholar
- 25.Gu J, Zhu M, Jiang L (2011) Housing price forecasting based on genetic algorithm and support vector machine. Expert Syst Appl 38(4):3383–3386Google Scholar
- 26.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–11404Google Scholar
- 27.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–210Google Scholar
- 28.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–873Google Scholar
- 29.Holland JH (1975) Adaptation in natural and artificial systems: an introductory analysis with applications to biology, control and artificial intelligence, USA. University of MichiganGoogle Scholar
- 30.Hong WC, Dong Y, Zheng F, Lai CY (2011) Forecasting urban traffic flow by SVR with continuous ACO. Appl Math Model 35(3):1282–1291MathSciNetzbMATHGoogle Scholar
- 31.Hong WC, Pai PF (2006) Predicting engine reliability by support vector machines. Int J Adv Manuf Technol 28(1-2):154–161Google Scholar
- 32.Hong WC, Pai PF (2007) Potential assessment of the support vector regression technique in rainfall forecasting. Water Resour Manag 21(2):495–513Google Scholar
- 33.Huang CF (2012) A hybrid stock selection model using genetic algorithms and support vector regression. Appl Soft Comput 12(2):807–818MathSciNetGoogle Scholar
- 34.Huang H, Wei X, Zhou Y (2016) A sparse method for least squares twin support vector regression. Neurocomputing 211:150–158Google Scholar
- 35.Huang H, Wei X, Zhou Y (2018) Twin support vector machines: A survey. Neurocomputing 300:34–43Google Scholar
- 36.Huang SC, Chuang PJ, Wu CF, Lai HJ (2010) Chaos-based support vector regressions for exchange rate forecasting. Expert Syst Appl 37(12):8590–8598Google Scholar
- 37.Huang SC, Wu TK (2010) Combining wavelet-based feature extractions with relevance vector machines for stock index forecasting. Expert Syst 25(2):133–149Google Scholar
- 38.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–1199Google Scholar
- 39.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–958Google Scholar
- 40.Kennedy J, Eberhart RC (1995) Particle swarm optimization. In: Proceedings of the IEEE international conference on neural networks, pp 1942–1948Google Scholar
- 41.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–486Google Scholar
- 42.Kim EY (2017) MRF model based real-time traffic flow prediction with support vector regression. Electron Lett 53(4):243–245Google Scholar
- 43.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–879Google Scholar
- 44.Kim KJ (2003) Financial time series forecasting using support vector machines. Neurocomputing 55(1):307–319Google Scholar
- 45.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–132Google Scholar
- 46.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)Google Scholar
- 47.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–1824Google Scholar
- 48.Liu CF, Yeh CY, Lee SJ (2012) Application of type-2 neuro-fuzzy modeling in stock price prediction. Appl Soft Comput 12(4):1348–1358Google Scholar
- 49.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–111Google Scholar
- 50.Long NC, Meesad P, Unger H (2015) A highly accurate firefly based algorithm for heart disease prediction. Expert Syst Appl 42(21):8221–8231Google Scholar
- 51.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–2427Google Scholar
- 52.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–331Google Scholar
- 53.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–1282Google Scholar
- 54.Malkiel BG (2003) The efficient market hypothesis and its critics. J Econ Perspect 17(1):59–82Google Scholar
- 55.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–305Google Scholar
- 56.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–191Google Scholar
- 57.Mostafa MM (2010) Forecasting stock exchange movements using neural networks: empirical evidence from Kuwait. Expert Syst Appl 37(9):6302–6309Google Scholar
- 58.Oh SK, Pedrycz W, Park HS (2006) Genetically optimized fuzzy polynomial neural networks. IEEE Trans Fuzzy Syst 14(1):125–144Google Scholar
- 59.Ozer AB (2010) CIDE: Chaotically initialized differential evolution. Expert Syst Appl 37(6):4632–4641Google Scholar
- 60.Pérez-cruz F, Afonso-rodríguez JA, Giner J (2003) Estimating GARCH models using support vector machines. Quant Financ 3(3):163–172MathSciNetzbMATHGoogle Scholar
- 61.Phan DHB, Sharma S S, Narayan P K (2015) Stock return forecasting: some new evidence. Int Rev Financ Anal 40:38–51Google Scholar
- 62.Qi M, Zhang GP (2003) Trend time-series modeling and forecasting with neural networks. IEEE Trans Neural Netw 19(5):808–816Google Scholar
- 63.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–7MathSciNetGoogle Scholar
- 64.Rahmani A, Mirhassani SA (2014) A hybrid firefly-genetic algorithm for the capacitated facility location problem. Inf Sci 283(4):70–78MathSciNetzbMATHGoogle Scholar
- 65.Rashedi E, Nezamabadi-Pour H, Saryazdi S (2009) GSA: a gravitational search algorithm. Inf Sci 179:2232–2248zbMATHGoogle Scholar
- 66.Sayed GI, Khoriba G, Haggag MH (2018) A novel chaotic salp swarm algorithm for global optimization and feature selection. Appl Intell 48(10):3462–3481Google Scholar
- 67.Singh R, Srivastava S (2016) Stock prediction using deep learning. Multimed Tools Appl 76(18):18569–18584Google Scholar
- 68.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–107Google Scholar
- 69.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–701Google Scholar
- 70.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–287Google Scholar
- 71.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–815Google Scholar
- 72.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–5102Google Scholar
- 73.Wang HB, Fan CC, Tu XY (2016) AFSAOCP: a novel artificial fish swarm optimization algorithm aided by ocean current power. Appl Intell 45:1–16Google Scholar
- 74.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–178Google Scholar
- 75.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–100Google Scholar
- 76.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–279MathSciNetzbMATHGoogle Scholar
- 77.Yang XS (2008) Nature-inspired metaheuristic algorithms: Luniver PressGoogle Scholar
- 78.Yang XS, He X (2013) Firefly algorithm: recent advances and applications. Int J Swarm Intell 1:36–50Google Scholar
- 79.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–2186Google Scholar
- 80.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–574Google Scholar
- 81.Yu S, Zhu S, Ma Y, Mao D (2015) Enhancing firefly algorithm using generalized opposition-based learning. Computing 97(7):741–754MathSciNetzbMATHGoogle Scholar
- 82.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–154Google Scholar
- 83.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–1405Google Scholar
- 84.Zhou Y, Luo Q, Liu J (2014) Glowworm swarm optimization for dispatching system of public transit vehicles. Neural Process Lett 40(1):25–33Google Scholar
- 85.Zhou Y, Zhou G, Zhang J (2015) A hybrid glowworm swarm optimization algorithm to solve constrained multimodal functions optimization. Optimization 64(4):1057–1080MathSciNetzbMATHGoogle Scholar