journal article·2021Open access

Machine Learning-based USD/PKR Exchange Rate Forecasting Using Sentiment Analysis of Twitter Data

Samreen Naeem, Wali Khan Mashwani, Aqib Ali, M. Irfan Uddin, Marwan Mahmoud, Farrukh Jamal, Christophe Chesneau

Computers, Materials & Continua· Volume 67· Issue 3

Abstract

This study proposes an approach based on machine learning to forecast currency exchange rates by applying sentiment analysis to messages on Twitter (called tweets). A dataset of the exchange rates between the United States Dollar (USD) and the Pakistani Rupee (PKR) was formed by collecting information from a forex website as well as a collection of tweets from the business community in Pakistan containing finance-related words. The dataset was collected in raw form, and was subjected to natural language processing by way of data preprocessing. Response variable labeling was then applied to the standardized dataset, where the response variables were divided into two classes: “1” indicated an increase in the exchange rate and “ −1” indicated a decrease in it. To better represent the dataset, we used linear discriminant analysis and principal component analysis to visualize the data in three-dimensional vector space. Clusters that were obtained using a sampling approach were then used for data optimization. Five machine learning classifiers—the simple logistic classifier, the random forest, bagging, naïve Bayes, and the support vector machine—were applied to the optimized dataset. The results show that the simple logistic classifier yielded the highest accuracy of 82.14% for the USD and the PKR exchange rates forecasting.
Source: openalex_inverted_index · Quality: baseline

Research context

OpenAlex topics: Stock Market Forecasting Methods · Market Dynamics and Volatility · Sentiment Analysis and Opinion Mining

SciVX discovery tags are terminology-based. OpenAlex topics are source-provided classifications.

References (26)

Show source-provided references
1. Sentiment analysis: A review and comparative analysis of web services10.1016/j.ins.2015.03.040 ↗
2. Sentic computing for social media marketing10.1007/s11042-011-0815-0 ↗
3. M. L. Faulkner and A. Nierenberg, Networking for Every College Student and Graduate: Starting your Career off Right, New Jersey, United States: FT Press, 2013. [Online]. Available: http://ptgmedia.pearsoncmg.com/images/9780133741131/-samplepages/0133741133.pdf.
4. Milton Friedman and the case for flexible exchange rates and monetary rules
5. Finance and business cycles: The credit-driven household demand channel10.1257/jep.32.3.31 ↗
6. Does foreign direct investment generate economic growth? A new empirical approach applied to Spain10.1080/00130095.2017.1393312 ↗
7. Channels of US monetary policy spillovers to international bond markets10.1016/j.jfineco.2019.04.007 ↗
8. Social media sentiment in international stock returns and trading activity
9. Leveraging twitter to maximize the radiology meeting experience10.1016/j.jacr.2017.10.022 ↗
10. Social media signal detection using tweets volume, hashtag, and sentiment analysis10.1007/s11042-018-6437-z ↗
11. Credibility in online social networks: A survey10.1109/ACCESS.2018.2886314 ↗
12. S. Bird, E. Klein and E. Loper, Natural Language Processing with Python: Analyzing Text with the Natural Language Toolkit, Massachusetts, United States: O’Reilly Media, Inc., 2009. [Online]. Available: http://nltk.org/book_1ed/.
13. Linear discriminant analysis a brief tutorial
14. Principal component analysis10.1016/0169-7439(87)80084-9 ↗
15. Price movement prediction of cryptocurrencies using sentiment analysis and machine learning10.3390/e21060589 ↗
16. Sentiment analysis-based direction prediction in bitcoin using deep learning algorithms and word embedding models10.18201/ijisae.2020261585 ↗
17. Cryptocurrency price prediction using tweet volumes and sentiment analysis
18. Real-time sentiment analysis of Twitter streaming data for stock prediction10.1016/j.procs.2018.05.111 ↗
19. Predicting vehicle sales by sentiment analysis of Twitter data and stock market values10.1109/ACCESS.2018.2873730 ↗
20. Conceptual framework for stock market classification model using sentiment analysis on Twitter based on hybrid naïve Bayes classifiers10.14419/ijet.v7i2.14.11156 ↗
21. An efficient deep learning-based model to predict interest rate using Twitter sentiment10.3390/su12041660 ↗
22. Using twitter trust network for stock market analysis10.1016/j.knosys.2018.01.016 ↗
23. Impact of Twitter sentiment related to bitcoin on stock price returns10.31026/j.eng.2020.06.05 ↗
24. Sentiment analysis on Twitter data of world cup soccer tournament using machine learning10.3390/iot1020014 ↗
25. A boosting-aided adaptive cluster-based under sampling approach for treatment of class imbalance problem10.4018/IJDWM.2020070104 ↗
26. Simple logistic hybrid system based on greedy stepwise algorithm for feature analysis to diagnose Parkinson’s disease according to gender10.1007/s13369-020-04357-1 ↗