An Intelligent Event-Sentiment-Based Daily Foreign Exchange Rate Forecasting System
Abstract
:1. Introduction
- Since time series models such as Auto regressive conditional heteroscedasticity (ARCH) and GARCH do not yield significant prediction results, we use a deep learning approach that also deals with nonlinear patterns of time series datasets.
- The exchange rate is considered as a highly volatile variable and can be affected by any information floated in the market such as social media sentiments based on events at the macro level, therefore, we also consider investor sentiment while making exchange rate predictions which is a significant contribution to the existing body of knowledge.
- We consider three different economies namely, Hong Kong (emerging), Pakistan (developing), and UK (developed) that belong to different regions which exhibit specific characteristics. Such a dataset has remained unexplored in the existing literature.
2. Related Work
2.1. Econometric Approach
2.2. Time Series Models
2.3. Artificial Neural Network
2.4. Deep Neural Network
3. Proposed Methodology
3.1. Input Layer/First Layer
3.2. Convolutional Layers
3.3. Pooling Layers
3.4. Rectified Linear Unit Layer
3.5. Fully Connected Layers
3.6. Network Training and Testing
4. Results and Discussion
4.1. Dataset
4.2. Evaluation Metrics
4.2.1. Root Mean Squared Error—RMSE
4.2.2. Mean Absolute Error—MAE
4.3. Descriptive Statistic
Unit Root Test
4.4. Results without Event Sentiments
4.5. Results with Event Sentiments
5. Conclusions
Author Contributions
Funding
Conflicts of Interest
References
- Meese, R.A.; Rogoff, K. Empirical exchange rate models of the seventies: Do they fit out of sample? J. Int. Econ. 1983, 14, 3–24. [Google Scholar] [CrossRef]
- Meese, R.; Rogoff, K. The out-of-sample failure of empirical exchange rate models: Sampling error or misspecification? In Exchange Rates and International Macroeconomics; University of Chicago Press: Chicago, IL, USA, 1983; pp. 67–112. [Google Scholar]
- Štěpnička, M.; Cortez, P.; Donate, J.P.; Štěpničková, L. Forecasting seasonal time series with computational intelligence: On recent methods and the potential of their combinations. Expert Syst. Appl. 2013, 40, 1981–1992. [Google Scholar] [CrossRef] [Green Version]
- Cavalli, F.; Naimzada, A.; Pireddu, M. An evolutive financial market model with animal spirits: Imitation and endogenous beliefs. J. Evol. Econ. 2017, 27, 1007–1040. [Google Scholar] [CrossRef]
- Contreras, J.; Espinola, R.; Nogales, F.J.; Conejo, A.J. ARIMA models to predict next-day electricity prices. IEEE Trans. Power Syst. 2003, 18, 1014–1020. [Google Scholar] [CrossRef]
- Bollerslev, T. Generalized autoregressive conditional heteroskedasticity. J. Econom. 1986, 31, 307–327. [Google Scholar] [CrossRef] [Green Version]
- Galeshchuk, S. Neural networks performance in exchange rate prediction. Neurocomputing 2016, 172, 446–452. [Google Scholar] [CrossRef]
- Khashei, M.; Bijari, M. An artificial neural network (p, d, q) model for timeseries forecasting. Expert Syst. Appl. 2010, 37, 479–489. [Google Scholar] [CrossRef]
- Yadav, A.K.; Chandel, S. Solar radiation prediction using Artificial Neural Network techniques: A review. Renew. Sustain. Energy Rev. 2014, 33, 772–781. [Google Scholar] [CrossRef]
- Agatonovic-Kustrin, S.; Beresford, R. Basic concepts of artificial neural network (ANN) modeling and its application in pharmaceutical research. J. Pharm. Biomed. Anal. 2000, 22, 717–727. [Google Scholar] [CrossRef]
- Majhi, R.; Panda, G.; Sahoo, G. Efficient prediction of exchange rates with low complexity artificial neural network models. Expert Syst. Appl. 2009, 36, 181–189. [Google Scholar] [CrossRef]
- Pradeepkumar, D.; Ravi, V. Forecasting financial time series volatility using particle swarm optimization trained quantile regression neural network. Appl. Soft Comput. 2017, 58, 35–52. [Google Scholar] [CrossRef]
- Tang, Z.; Fishwick, P. Back-propagation neural nets as models for time series forecasting. ORSA J. Comput. 1993, 5, 374–385. [Google Scholar] [CrossRef]
- Mundell, R.A. Capital mobility and stabilization policy under fixed and flexible exchange rates. Can. J. Econ. Political Sci. 1963, 29, 475–485. [Google Scholar] [CrossRef]
- Dornbusch, R. Exchange rate expectations and monetary policy. J. Int. Econ. 1976, 6, 231–244. [Google Scholar] [CrossRef]
- Engel, C. Exchange rates and interest parity. In Handbook of International Economics, Vol. 4; Gopinath, G., Helpman, E., Rogoff, K., Eds.; Elsevier: Amsterdam, The Netherlands, 2013. [Google Scholar]
- Neely, C.J.; Sarno, L. How well do monetary fundamentals forecast exchange rates? In Federal Reserve Bank of St. Louis Working Paper Series; Federal Reserve Bank of St. Louis: St. Louis, MO, USA, 2002. [Google Scholar]
- Box, G.E.; Jenkins, G.M.; Reinsel, G.C.; Ljung, G.M. Time Series Analysis: Forecasting and Control; John Wiley & Sons: Hoboken, NJ, USA, 2015. [Google Scholar]
- Lam, M. Neural network techniques for financial performance prediction: Integrating fundamental and technical analysis. Decis. Support Syst. 2004, 37, 567–581. [Google Scholar] [CrossRef]
- Thinyane, H.; Millin, J. An investigation into the use of intelligent systems for currency trading. Comput. Econ. 2011, 37, 363–374. [Google Scholar] [CrossRef]
- Önder, E.; Bayır, F.; Hepsen, A. Forecasting macroeconomic variables using artificial neural network and traditional smoothing techniques. J. Appl. Financ. Bank. 2013, 3, 73–104. [Google Scholar]
- Ahmad, J.; Fatmi, H. Quadric neural network for the prediction of financial time series data. In Proceedings of the 1994 IEEE International Conference on Neural Networks (ICNN’94), Orlando, FL, USA, 28 June–2 July 1994; pp. 3667–3670. [Google Scholar]
- Swanson, N.R.; White, H. Forecasting economic time series using flexible versus fixed specification and linear versus nonlinear econometric models. Int. J. Forecast. 1997, 13, 439–461. [Google Scholar] [CrossRef] [Green Version]
- Kuan, C.-M.; White, H. Artificial neural networks: An econometric perspective. Econom. Rev. 1994, 13, 1–91. [Google Scholar] [CrossRef]
- Qi, M.; Maddala, G. Economic factors and the stock market: A new perspective. J. Forecast. 1999, 18, 151–166. [Google Scholar] [CrossRef]
- Gencay, R. Linear, non-linear and essential foreign exchange rate prediction with simple technical trading rules. J. Int. Econ. 1999, 47, 91–107. [Google Scholar] [CrossRef]
- Santos, A.A.P.; da Costa, N.C.A., Jr.; dos Santos Coelho, L. Computational intelligence approaches and linear models in case studies of forecasting exchange rates. Expert Syst. Appl. 2007, 33, 816–823. [Google Scholar] [CrossRef]
- Ozkan, F. A comparison of the monetary model and artificial neural networks in exchange rate forecasting. Bus. Econ. Res. J. 2012, 3, 1–27. [Google Scholar]
- Dunis, C.L.; Huang, X. Forecasting and trading currency volatility: An application of recurrent neural regression and model combination. J. Forecast. 2002, 21, 317–354. [Google Scholar] [CrossRef]
- Jena, P.R.; Majhi, R.; Majhi, B. Development and performance evaluation of a novel knowledge guided artificial neural network (KGANN) model for exchange rate prediction. J. King Saud Univ.-Comput. Inf. Sci. 2015, 27, 450–457. [Google Scholar] [CrossRef] [Green Version]
- Kamruzzaman, J.; Sarker, R.A. ANN-based forecasting of foreign currency exchange rates. Neural Inf. Process.-Lett. Rev. 2004, 3, 49–58. [Google Scholar]
- Chen, A.-S.; Leung, M.T. Regression neural network for error correction in foreign exchange forecasting and trading. Comput. Oper. Res. 2004, 31, 1049–1068. [Google Scholar] [CrossRef]
- Dunis, C.L.; Laws, J.; Sermpinis, G. Higher order and recurrent neural architectures for trading the EUR/USD exchange rate. Quant. Financ. 2011, 11, 615–629. [Google Scholar] [CrossRef]
- Nag, A.K.; Mitra, A. Forecasting daily foreign exchange rates using genetically optimized neural networks. J. Forecast. 2002, 21, 501–511. [Google Scholar] [CrossRef]
- Hinton, G.E. Training products of experts by minimizing contrastive divergence. Neural Comput. 2002, 14, 1771–1800. [Google Scholar] [CrossRef] [PubMed]
- Hinton, G.E.; Osindero, S.; Teh, Y.-W. A fast learning algorithm for deep belief nets. Neural Comput. 2006, 18, 1527–1554. [Google Scholar] [CrossRef] [PubMed]
- Nasse, F.; Thurau, C.; Fink, G.A. Face detection using gpu-based convolutional neural networks. In Proceedings of the International Conference on Computer Analysis of Images and Patterns, Münster, Germany, 2–4 September 2009; pp. 83–90. [Google Scholar]
- Osadchy, M.; Cun, Y.L.; Miller, M.L. Synergistic face detection and pose estimation with energy-based models. J. Mach. Learn. Res. 2007, 8, 1197–1215. [Google Scholar]
- Sukittanon, S.; Surendran, A.C.; Platt, J.C.; Burges, C.J. Convolutional networks for speech detection. In Proceedings of the Eighth International Conference on Spoken Language Processing, Jeju Island, Korea, 4–8 October 2004. [Google Scholar]
- Lee, H.; Pham, P.; Largman, Y.; Ng, A.Y. Unsupervised feature learning for audio classification using convolutional deep belief networks. In Proceedings of the Advances in Neural Information Processing Systems, Vancouver, BC, Canada, 7–10 December 2009; pp. 1096–1104. [Google Scholar]
- Busseti, E.; Osband, I.; Wong, S. Deep learning for time series modeling. Tech. Rep. Stanf. Univ. 2012, 1–5. [Google Scholar]
- Längkvist, M.; Karlsson, L.; Loutfi, A. A review of unsupervised feature learning and deep learning for time-series modeling. Pattern Recognit. Lett. 2014, 42, 11–24. [Google Scholar] [CrossRef] [Green Version]
- Ribeiro, B.; Lopes, N. Deep belief networks for financial prediction. In Proceedings of the International Conference on Neural Information Processing, Shanghai, China, 13–17 November 2011; pp. 766–773. [Google Scholar]
- Chao, J.; Shen, F.; Zhao, J. Forecasting exchange rate with deep belief networks. In Proceedings of the 2011 International Joint Conference on Neural Networks, San Jose, CA, USA, 31 July–5 August 2011; pp. 1259–1266. [Google Scholar]
- Yeh, S.-H.; Wang, C.-J.; Tsai, M.-F. Corporate default prediction via deep learning. In Proceedings of the 34th International Symposium on Forecasting (ISF’14), Rotterdam, The Netherlands, 29 June–2 July 2014. [Google Scholar]
- Hinton, G.E.; Salakhutdinov, R.R. Reducing the dimensionality of data with neural networks. Science 2006, 313, 504–507. [Google Scholar] [CrossRef] [PubMed]
- Schmidhuber, J. Deep learning in neural networks: An overview. Neural Netw. 2015, 61, 85–117. [Google Scholar] [CrossRef] [PubMed] [Green Version]
- Larochelle, H.; Bengio, Y.; Louradour, J.; Lamblin, P. Exploring strategies for training deep neural networks. J. Mach. Learn. Res. 2009, 10, 1–40. [Google Scholar]
- Masci, J.; Meier, U.; Cireşan, D.; Schmidhuber, J. Stacked convolutional auto-encoders for hierarchical feature extraction. In Proceedings of the International Conference on Artificial Neural Networks, Espoo, Finland, 14–17 June 2011; pp. 52–59. [Google Scholar]
- Ranzato, M.A.; Huang, F.J.; Boureau, Y.-L.; LeCun, Y. Unsupervised learning of invariant feature 7hierarchies with applications to object recognition. In Proceedings of the 2007 IEEE Conference on Computer Vision and Pattern Recognition, Minneapolis, MN, USA, 17–22 June 2007. [Google Scholar]
- Vincent, P.; Larochelle, H.; Bengio, Y.; Manzagol, P.-A. Extracting and composing robust features with denoising autoencoders. In Proceedings of the 25th International Conference on Machine Learning, Helsinki, Finland, 5–9 July 2008; pp. 1096–1103. [Google Scholar]
- LeCun, Y.; Bengio, Y.; Hinton, G. Deep learning. Nature 2015, 521, 436–444. [Google Scholar] [CrossRef]
- Zubiaga, A. A longitudinal assessment of the persistence of twitter datasets. J. Assoc. Inf. Sci. Technol. 2018, 69, 974–984. [Google Scholar] [CrossRef] [Green Version]
- Nazir, F.; Ghazanfar, M.A.; Maqsood, M.; Aadil, F.; Rho, S.; Mehmood, I. Social media signal detection using tweets volume, hashtag, and sentiment analysis. Multimed. Tools Appl. 2019, 78, 3553–3586. [Google Scholar] [CrossRef]
- Iqbal, M.; Ghazanfar, M.A.; Sattar, A.; Maqsood, M.; Khan, S.; Mehmood, I.; Baik, S.W. Kernel Context Recommender System (KCR): A Scalable Context-Aware Recommender System Algorithm. IEEE Access 2019, 7, 24719–24737. [Google Scholar] [CrossRef]
- Khan, S.; Khan, A.; Maqsood, M.; Aadil, F.; Ghazanfar, M.A. Optimized gabor feature extraction for mass classification using cuckoo search for big data e-healthcare. J. Grid Comput. 2018, 17, 239–254. [Google Scholar] [CrossRef]
- Kalsoom, A.; Maqsood, M.; Ghazanfar, M.A.; Aadil, F.; Rho, S. A dimensionality reduction-based efficient software fault prediction using Fisher linear discriminant analysis (FLDA). J. Supercomput. 2018, 74, 4568–4602. [Google Scholar] [CrossRef]
- Ateeq, T.; Majeed, M.N.; Anwar, S.M.; Maqsood, M.; Rehman, Z.-U.; Lee, J.W.; Muhammad, K.; Wang, S.; Baik, S.W.; Mehmood, I. Ensemble-classifiers-assisted detection of cerebral microbleeds in brain MRI. Comput. Electr. Eng. 2018, 69, 768–781. [Google Scholar] [CrossRef]
Variables/Countries | Hong Kong | Pakistan | UK |
---|---|---|---|
Exchange rate, crude oil prices, gold price index. | From 26 April 2008 to 31 May 2018 | From 29 March 2008 to 31 January 2019 | From 2 January 2008 to 28 November 2018 |
2123 observations | 2132 observations | 2633 observations |
Country | Local Events | Number of Tweets | Global Event | Number of Tweets |
---|---|---|---|---|
Hong Kong | Hong Kong Protest (2014) | 1,188,372 | US Election 2012 | 1,740,258 |
Pakistan | Lahore Blast 2016 | 1,149,253 | US Election 2012 | 1,740,258 |
UK | Brexit | 1,826,290 | US Election 2012 | 1,740,258 |
Exchange Rate | Other Variables | ||||
---|---|---|---|---|---|
Hong Kong | Pakistan | UK | Oil Prices | Gold Price Index | |
Mean | 7.769 | 98.257 | 1.536 | 74.645 | 21.424 |
Median | 7.758 | 101.856 | 1.554 | 79.350 | 19.380 |
Std. Dev. | 0.0261 | 14.740 | 0.170 | 22.724 | 7.689 |
Jarque–Bera | 1729.421 *** | 24.135 *** | 164.269 *** | 186.477 *** | 4619.799 *** |
Observation | 2121 | 2131 | 2632 | 2121 | 2121 |
Countries | Variables | ADF Test Stat | Critical Value (5%) | |
---|---|---|---|---|
Level | 1st Difference | |||
Hong Kong | Exchange rate | −1.980 | −23.610 *** | −2.86 |
Oil prices | −1.613 | −47.594 *** | −2.86 | |
Gold price index | −3.427 *** | −2.86 | ||
Pakistan | Exchange rate | −0.161 | −45.311 *** | −2.86 |
Oil prices | −1.613 | −47.594 *** | −2.86 | |
Gold price index | −3.427 *** | −2.86 | ||
UK | Exchange rate | −2.231 | −51.735 *** | −2.86 |
Oil prices | −1.613 | −47.594 *** | −2.86 | |
Gold price index | −3.427 *** | −2.86 |
Without Sentiment | Mean Absolute Error (MAE) | Root Mean Squared Error (RMSE) | ||||
---|---|---|---|---|---|---|
Linear Regression | Support Vector Regression | Deep Learning | Linear Regression | Support Vector Regression | Deep Learning | |
Final HK | 0.018 ± 0.018 | 0.017 ± 0.024 | 0.017 ± 0.017 | 0.025 ± 0.000 | 0.029 ± 0.000 | 0.024 ± 0.000 |
Final Pak | 9.042 ± 7.902 | 8.687 ± 8.285 | 7.636 ± 6.952 | 12.008 ± 0.000 | 12.004 ± 0.000 | 10.327 ± 0.000 |
Final UK | 0.074 ± 0.054 | 0.074 ± 0.054 | 0.068 ± 0.060 | 0.092 ± 0.000 | 0.092 ± 0.000 | 0.091 ± 0.000 |
With Sentiment | Mean Absolute Error (MAE) | Root Mean Squared Error (RMSE) | ||||
---|---|---|---|---|---|---|
Final HK | Linear Regression | Support Vector Regression | Deep Learning | Linear Regression | Support Vector Regression | Deep Learning |
Hong Kong protest 2014 | 0.010 ± 0.008 | 0.009 ± 0.010 | 0.011 ± 0.007 | 0.013 ± 0.000 | 0.014 ± 0.000 | 0.013 ± 0.000 |
US election 2012 | 0.010 ± 0.008 | 0.010 ± 0.009 | 0.013 ± 0.008 | 0.013 ± 0.000 | 0.014 ± 0.000 | 0.015 ± 0.000 |
With Sentiment | Mean Absolute Error (MAE) | Root Mean Squared Error (RMSE) | ||||
---|---|---|---|---|---|---|
Final PAK | Linear Regression | Support Vector Regression | Deep Learning | Linear Regression | Support Vector Regression | Deep Learning |
Lahore blast 2016 | 8.024 ± 5.041 | 7.785 ± 7.215 | 11.466 ± 6.677 | 9.476 ± 0.000 | 10.615 ± 0.000 | 13.268 ± 0.000 |
US election 2012 | 3.250 ± 2.696 | 3.127 ± 3.360 | 2.613 ± 2.380 | 4.223 ± 0.000 | 4.590 ± 0.000 | 3.534 ± 0.000 |
With Sentiment | Mean Absolute Error (MAE) | Root Mean Squared Error (RMSE) | ||||
---|---|---|---|---|---|---|
The Final UK | Linear Regression | Support Vector Regression | Deep Learning | Linear Regression | Support Vector Regression | Deep Learning |
Brexit 2016 | 0.060 ± 0.056 | 0.060 ± 0.057 | 0.064 ± 0.069 | 0.082 ± 0.000 | 0.082 ± 0.000 | 0.095 ± 0.000 |
US election 2012 | 0.067 ± 0.070 | 0.066 ± 0.072 | 0.078 ± 0.067 | 0.097 ± 0.000 | 0.098 ± 0.000 | 0.102 ± 0.000 |
© 2019 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (http://creativecommons.org/licenses/by/4.0/).
Share and Cite
Yasir, M.; Durrani, M.Y.; Afzal, S.; Maqsood, M.; Aadil, F.; Mehmood, I.; Rho, S. An Intelligent Event-Sentiment-Based Daily Foreign Exchange Rate Forecasting System. Appl. Sci. 2019, 9, 2980. https://doi.org/10.3390/app9152980
Yasir M, Durrani MY, Afzal S, Maqsood M, Aadil F, Mehmood I, Rho S. An Intelligent Event-Sentiment-Based Daily Foreign Exchange Rate Forecasting System. Applied Sciences. 2019; 9(15):2980. https://doi.org/10.3390/app9152980
Chicago/Turabian StyleYasir, Muhammad, Mehr Yahya Durrani, Sitara Afzal, Muazzam Maqsood, Farhan Aadil, Irfan Mehmood, and Seungmin Rho. 2019. "An Intelligent Event-Sentiment-Based Daily Foreign Exchange Rate Forecasting System" Applied Sciences 9, no. 15: 2980. https://doi.org/10.3390/app9152980
APA StyleYasir, M., Durrani, M. Y., Afzal, S., Maqsood, M., Aadil, F., Mehmood, I., & Rho, S. (2019). An Intelligent Event-Sentiment-Based Daily Foreign Exchange Rate Forecasting System. Applied Sciences, 9(15), 2980. https://doi.org/10.3390/app9152980