BEATING THE MARKET: STOCK PRICE PREDICTION THROUGH ARTIFICIAL NEURAL NETWORKS, SUPPORT VECTOR MACHINES, AND SENTIMENT ANALYSIS


Authors
  • Noemi Mejia
  • University of Asia and the Pacific
Published in


Abstract
  • Many researchers have used support vector machines (SVMs), artificial neural networks (ANNs), and sentiment analyses (SA) in the prediction of stock prices. This study aims to make a comparison between SVMs and ANNs in terms of accuracy in predicting the Philippine Stock Exchange Index (PSEi). Additionally, the researcher wants to determine the effect that the SA has on the two models if they are combined. To do this, the researcher first collects five years’ worth of historical prices of the PSEi from the Yahoo! Finance website, and five years’ worth of news articles from the Philippine Daily Inquirer website. The researcher then formulates, trains, and tests five models: the ANN, SVM, SA, ANN-SA, and SVM-SA. These models are evaluated by their Mean Squared Error (MSE), R-squared (R2), and Directional Accuracy (DA). The predictions of the five models are then used to develop a set of trading decisions. Based on their MSE, R2, and DA, the models using ANN predict more accurately than those using SVM, while the SA predicts the least accurately. Additionally, the SA improves the predictions of the ANN, as seen in the ANN-SA model, but does the opposite on the prediction of the SVM, based on the SVM-SA model. Accuracy has been shown to have a significant impact on the rate of return. Results show that the more accurate the prediction of the model, the higher the annualized return.


Keywords
  • Neural Networks, Support Vector Machines, Sentiment Analysis




References
  • Adebiyi, A., Adewumi, A., & Ayo, C. (2014) Comparison of arima and artificial neural networks models for stock price prediction. Journal of Applied Mathematics, Vol. 2014, Article ID 614342..
  • Adhikari, R., & Agrawal, R. K. (2013). An introductory study on time series modeling and forecasting. arXiv preprint arXiv:1302.6613..
  • Ahmed, N., Atiya, A., Gayar, N., & El-Shishiny, H. (2010) 'An Empirical Comparison of Machine Learning Models for Time Series Forecasting', Econometric Reviews, 29: 5, 594 — 621..
  • Al-Mansouri, E. & Amos, S. (2016). Using Artificial Neural Networks and Sentiment Analysis to Predict Upward Movements in Stock Price (Doctoral dissertation, WORCESTER POLYTECHNIC INSTITUTE)..
  • Awad, M. & Khanna, R. (2015) Efficient Learning Machines: Theories, concepts, and applications for engineers and system designers. Apress Media, LLC..
  • Baker, M., & Wurgler, J. (2007). Investor sentiment in the stock market. The Journal of Economic Perspectives, 21(2), 129-151..
  • Balaba, J. (2017) Does the stock market drive the Philippine economy? DLSU Research Congress 2017. De La Salle University, Manila, Philippines..
  • Beer, D. (2016) The data analytics industry and the promises of real-time knowing: perpetuating and deploying a rationality of speed, Journal of Cultural Economy, 10:1, 21-33, DOI: 10.1080/17530350.2016.1230771 Biau, G. (2012). Analysis of a random forests model. Journal of Machine Learning Research, 13(Apr), 1063-1095..
  • Calderon, L. (1999) Understanding the stock market. Notes on Business Education, Vol. 2, No. 5, De La Salle University - College of Business and Economics..
  • Chang, C. C., & Lin, H. (2007). A library for support vector machines..
  • Chang, P., Su, C., Wu, J., & Yu, L. (2012) Stock Price Predication using Combinational Features from Sentimental Analysis of Stock News and Technical Analysis of Trading Information. DOI: 10.7763/IPEDR. 2012. V55. 8..
  • Chen, H. & Schumaker, R. (2010) A discrete stock price prediction engine based on financial news. Computer 43(1), pp. 51 – 56..
  • CitisecOnline.com, Inc. & The Philippine Stock Exchange, Inc. (2012) Building Wealth With Stocks: A Basic Guide to Investing in the Philippine Stock Market. The Philippine Stock Exchange, Inc..
  • Corrales, N. (2017, April 21) Work suspended in parts of Metro Manila on April 27-28. Inquirer.net. Retrieved from http://newsinfo.inquirer.net/890881/april-27-28-declared-holidays-in-metro-manila Corrales, N. (2017, August 29) Sept. 1, 2017 declared a holiday in observance of Eid’l Adha. Inquirer.net. Retrieved from http://newsinfo.inquirer.net/926395/breaking-sept-1-2017- declared-a-holiday-in-observance-of-eidl-adha Corrales, N. (2017, June 16) Palace declares June 26 a holiday for Eid’l Fitr. Inquirer.net. Retrieved from http://newsinfo.inquirer.net/906125/palace-declares-june-26-a-holiday-for-eidl-fitr Cortes, C., & Vapnik, V. (1995). Support-vector networks. Machine learning, 20(3), 273-297..
  • Crisostomo, R., Padilla, S., & Visda, M. (2013) Philippine stock market in perspective. 12th National Convention on Statistics. EDSA Shangri-La Hotel, Mandaluyong City..
  • Cruz, R. V. & Delos Reyes, A. A. (2014). Is Print Media Dead?: A Case Study on the effects of Reduced Newspaper Readership to the Financial Status of Philippine Daily Inquirer and Philippine Star, 2002-2012. Unpublished Undergraduate Thesis, University of the Philippines Diliman, College of Mass Communication..
  • Dai, Y. & Zhang, Y. (2013) Machine learning in stock price trend forecasting. Stanford University..
  • Das, S. & Padhy, S. (2012) Support vector machines for prediction of futures prices in Indian stock market. International Journal of Computer Applications, Volume 41 - No. 3..
  • Dumlao-Abadilla, D. (2017, September 12) No PSE trading Sept. 12. Inquirer.net. Retrieved from http://business.inquirer.net/236702/no-pse-trading Eid'l Adha: September 12 declared regular holiday (2016, September 6) Rappler.com. Retrieved from https://www.rappler.com/nation/145347-eidl-adha-regular-holiday-september-12-2016 Fama, E. (1995) Random walks in stock-market prices. Graduate School of Business, University of Chicago. Selected Papers No. 16..
  • Fernandez-Rodrıguez, F., Gonzalez-Martel, C., & Sosvilla-Rivero, S. (2000). On the profitability of technical trading rules based on artificial neural networks: Evidence from the Madrid stock market. Economics letters, 69(1), 89-94..
  • Gesmundo, J., Giray, J., Baya, C., & San Miguel, A. (2012) Industry Study on Philippine Broadsheets. Unpublished Work..
  • Gonzales, Y. (2015, July 9) July 17 declared holiday in observance of Eid’l Fitr. Inquirer.net. Retrieved from http://newsinfo.inquirer.net/704042/july-17-declared-holiday-in-observance-of-eidl- fitr Gonzales, Y. (2016, August 18) LOOK: Palace declares 2017 holidays. Inquirer.net. Retrieved from http://newsinfo.inquirer.net/807359/look-palace-declares-2017-holidays Guevarra, M. (2016, December 13) Proclamation No. 117 declaring 26 December 2016 (Monday) and 2 January 2017 (Monday) as special (non-working) days throughout the country. Retrieved from http://www.officialgazette.gov.ph/downloads/2016/12dec/20161213-PROC-117-RRD.pdf Guiso, L., Sapienza, P., & Zingales, L. (2008) Trusting the stock market. The Journal of Finance, Vol. LXIII, No. 6, pp. 2557 - 2600..
  • Hagenau, M., Hedwig, M., Liebmann, M., & Neumann, D. (2012) Automated news reading: Stock Price Prediction based on Financial News Using Context-Specific Features. 45th Hawaii International Conference on System Sciences..
  • Hajek, P., Myskova, R., & Olej, V. (2013) Forecasting Stock Prices using Sentiment Information in Annual Reports – A Neural Network and Support Vector Regression Approach. WSEAS TRANSACTIONS on BUSINESS and ECONOMICS, Issue 4, Volume 10..
  • Hegina, A. (2016, July 4) Malacañang declares July 6 a holiday in observance of Eid al-Fitr. Inquirer.net. Retrieved from http://newsinfo.inquirer.net/794130/malacanang-declares-july-6-as-holiday-for-eid-al-fitr Kalyanaraman, V., Kazi, S., Oswal, S., & Tondulkar, R. (2014) Sentiment analysis on news articles for stocks..
  • Kalyani, J., Bharathi, P., & Jyothi, P. (2016). Stock trend prediction using news sentiment analysis. arXiv preprint arXiv:1607.01958..
  • Kar, A. (1990). Stock prediction using artificial neural networks. Dept. of Computer Science and Engineering, IIT Kanpur..
  • Kara, Y., Boyacioglu, M. A., & Baykan, Ö. K. (2011). Predicting direction of stock price index movement using artificial neural networks and support vector machines: The sample of the Istanbul Stock Exchange. Expert systems with Applications, 38(5), 5311-5319..
  • Katrekar, A. (2015). An Introduction to Sentiment Analysis. GlobalLogic Inc..
  • Kim, K. (2003) Financial time series forecasting using support vector machines. Neurocomputing 55 307 - 319..
  • Loh, W. Y., & Zheng, W. (2013). Regression trees for longitudinal and multiresponse data. The Annals of Applied Statistics, 7(1), 495-522..
  • Madge, S. (2015) Predicting stock price direction using support vector machines. Princeton University..
  • Mandal, S. & Patel, Y. (n.d.) Stock Market Prediction using Daily News Articles. Indian Institute of Technology Patna..
  • Mangosing, F. (2014, July 16) PSE suspends trading on Wednesday. Inquirer.net. Retrieved from http://business.inquirer.net/174756/pse-suspends-trading-on-wednesday May 9, special non-working holiday (2016, April 27) Rappler.com. Retrieved from https://www.rappler.com/nation/politics/elections/2016/130917-may-9-2016-elections-holiday Meesad, P., & Rasel, R. I. (2013). Predicting stock market price using support vector regression. In Informatics, electronics & vision (iciev), 2013 international conference on (pp. 1-6). IEEE..
  • Moghaddam, A. H., Moghaddam, M. H., & Esfandyari, M. (2016). Stock market index prediction using artificial neural network. Journal of Economics, Finance and Administrative Science, 21(41), 89-93..
  • Moharrampour, M., Sohrabi, S., Mehrabi, A., Hajikandi, H., & Vakili, J. (2013). Comparison of Support Vector Machines (SVM) and Autoregressive integrated moving average (ARIMA) in daily flow forecasting. Journal of River Engineering, 1..
  • Montague, D. (n.d.) Algorithmic Trading of Futures via Machine Learning..
  • Morck, R., Shleifer, A., & Vishny, R. (1990) The Stock Market and Investment: Is the market a sideshow? Brookings Papers on Economic Activity, pp. 157 - 215..
  • Ng, A. (2012) Supervised learning. CS229 Lecture notes..
  • Ng, A. (n.d.) Part VII: Regularization and model selection. CS229 Lecture notes..
  • Nielsen, F. Å. (2011). A new ANEW: Evaluation of a word list for sentiment analysis in microblogs. arXiv preprint arXiv:1103.2903..
  • Ochoa Jr., P. (2014, December 22) Proclamation No. 936 declaring January 15, 16, and 19, 2015 as special (non-working) days in the National Capital Region (NCR). Official Gazette. Retrieved from http://www.officialgazette.gov.ph/2014/12/22/proclamation-no-936-s-2014/ Ochoa Jr., P. (2015, July 13) Proclamation No. 1072 declaring 18 and 19 November 2015 as special (non-working) days in the National Capital Region (NCR). Official Gazette. Retrieved from http://www.officialgazette.gov.ph/2015/07/13/proclamation-no-1072-s-2015/ October 6, regular holiday for Eidul Adha (2014, September 16) Rappler.com. Retrieved from https://www.rappler.com/nation/69246-eidul-adha-2014 Palace suspends work in gov't offices (2014, September 19) Rappler.com. Retrieved from https://www.rappler.com/nation/69537-palace-suspends-work-typhoon-mario Pekelis, L. (2013). Classification And Regression Trees: A Practical Guide for Describing a Dataset. Bicostal Datafest..
  • PSE suspends trading on August 19 (2013, August 19) Rappler.com. Retrieved from https://www.rappler.com/business/36732-pse-suspends-trading-monday-aug-19 Qiu, M., & Song, Y. (2016). Predicting the direction of stock market index movement using an optimized artificial neural network model. PloS one, 11(5), e0155133..
  • Reinstein, I. (2017, October 17) Random Forests(r), Explained. KDnuggets. Retrieved from https://www.kdnuggets.com/2017/10/random-forests-explained.html Riedmiller, M. (1994). Rprop-Description and implementation details: technical report. Inst. f. Logik, Komplexität u. Deduktionssysteme..
  • Riedmiller, M., & Braun, H. (1993). A direct adaptive method for faster backpropagation learning: The RPROP algorithm. In Neural Networks, 1993., IEEE International Conference on (pp. 586-591). IEEE..
  • Rivera, D. (2014, December 8) BSP suspends clearing ops, PSE cancels trading ahead of Typhoon Ruby. GMA News Online. Retrieved from http://www.gmanetwork.com/news/money/content/391559/bsp-suspends-clearing-ops-pse-cancels-trading-ahead-of-typhoon-ruby/story/ Rosillo, R., Giner, J., De la Fuente, D., & Pino, R. (2012). Trading system based on support vector machines in the S&P500 index. In Proceedings on the International Conference on Artificial Intelligence (ICAI) (p. 1). The Steering Committee of The World Congress in Computer Science, Computer Engineering and Applied Computing (WorldComp)..
  • Rosillo, R.; Giner, J. & De la Fuente, D. (2014): "Stock Market simulation using support Sabillo, K. (2014, July 14) July 29 declared holiday in observance of Eid'l Fitr. Inquirer.net. Retrieved from http://newsinfo.inquirer.net/619481/july-29-declared-holiday-in-observance-of-eidl-fitr Salkind, N. J. (Ed.). (2010). Encyclopedia of research design (Vol. 1). Sage..
  • Samson, A. G. (2016). The Tortoise or the Hare? Media Coverage and Legislative Success. Philippine Social Sciences Review, 68(1)..
  • September 25, regular holiday for Eid’l Adha (2015, September 15) Rappler.com. Retrieved from https://www.rappler.com/nation/105979-september-25-2105-eid-l-adha-holiday Sezer, O. B., Ozbayoglu, A. M., & Dogdu, E. (2017, April). An Artificial Neural Network-based Stock Trading System Using Technical Analysis and Big Data Framework. In Proceedings of the SouthEast Conference (pp. 223-226). ACM..
  • Shah, V. H. (2007). Machine learning techniques for stock prediction. Foundations of Machine Learning| Spring, 1-19..
  • Shalev-Shwartz, S. & Ben-David, S. (2014) Understanding Machine Learning: From theory to algorithms. Cambridge University Press..
  • Sheta, A. F., Ahmed, S. E. M., & Faris, H. (2015). A comparison between regression, artificial neural networks and support vector machines for predicting stock market index. Soft Computing, 7, 8..
  • Smola, A. J., & Schölkopf, B. (2004). A tutorial on support vector regression. Statistics and computing, 14(3), 199-222..
  • Tuazon, R. (2015, April 30). The Print Media: A Tradition of Freedom. Retrieved April 16, 2018, from http://ncca.gov.ph/subcommissions/subcommission-on-cultural-disseminationscd/communication/the-print-media-a-tradition-of-freedom/vector machines", Journal of Forecasting, vol. 33, no 6, (488–500)..
  • Walker, M. (2013) Machine learning applications in the real world. Data Science Association..
  • Wanjawa, B. W., & Muchemi, L. (2014). ANN Model to Predict Stock Prices at Stock Exchange Markets. arXiv preprint arXiv:1502.06434..
  • Wei, Z. (2012). A SVM approach in forecasting the moving direction of Chinese Stock Indices. Lehigh University..
  • Yao, J., Tan, C. L., & Poh, H. L. (1999). Neural networks for technical analysis: a study on KLCI. International journal of theoretical and applied finance, 2(02), 221-241..