Next Article in Journal
Recent Development in Fintech: Non-Fungible Token
Previous Article in Journal
Hybrid Uncertainty-Goal Programming Model with Scaled Index for Production Planning Assessment
 
 
Font Type:
Arial Georgia Verdana
Font Size:
Aa Aa Aa
Line Spacing:
Column Width:
Background:
Article

Long Short-Term Memory Network for Predicting Exchange Rate of the Ghanaian Cedi

by
Adebayo Felix Adekoya
,
Isaac Kofi Nti
* and
Benjamin Asubam Weyori
Department of Computer Science and Informatics, University of Energy and Natural Resources, Sunyani BS0000, Ghana
*
Author to whom correspondence should be addressed.
FinTech 2022, 1(1), 25-43; https://doi.org/10.3390/fintech1010002
Submission received: 21 September 2021 / Revised: 22 November 2021 / Accepted: 3 December 2021 / Published: 9 December 2021

Abstract

:
An accurate prediction of the Exchange Rate (ER) serves as the basis for effective financial management, monetary policies, and long-term strategic decision making worldwide. A stable and competitive ER enables economic diversification. Economists, researchers, and investors have conducted several studies to predict trends and facts that influence the ER’s rise or fall. This paper used the Long Short-Term Memory Networks (LSTM) framework to predict the weekly exchange rate of one Ghanaian Cedis (GH₵) to three different currencies (United States Dollar, British Pound, and Euro), using Google Trends and historical macroeconomic data. We fused past exchange rates, fundamental macroeconomic variables, commodity prices (cocoa, gold, and crude oil) and public search queries (Google Trends) as input parameters. An empirical analysis using publicly available ER data from the Bank of Ghana (BoG) from January 2004 to October 2019 showed satisfactory results. We observed that the proposed LSTM model outperformed the Support Vector Regressor (SVR) and Back-propagation Neural Network (BPNN) models in accuracy and closeness metrics. That is, our LSTM model obtained (MAE = 0.033, MSE = 0.0035, RMSE = 0.0551, R2 = 0.9983, RMSLE = 0.0129 and MAPE = 0.0121) compared with SVR (MAE = 0.05, MAE = 0.005, RMSE = 0.0683, R2 = 0.9973, RMSLE = 0.0191 and MAPE = 0.0241) and BPNN (MAE = 0.04, MAE = 0.0056, RMSE = 0.0688, R2 = 0.9974, RMSLE = 0.0172 and MAPE = 0.0168). Moreover, we observed a strong positive correction (0.98–0.99) between Google Trends on the currency of focus and its exchange rate to the Ghanaian cedis. The study results show the importance of incorporating public search queries from search engines to predict the ER accurately.

1. Introduction

The exchange rate is considered the relative price, indicating a local currency’s value in terms of another currency. One of the significant issues in the discussion of the world economy today is centred around the ER. Practically, every economy in this 21st century relies massively on the Foreign Exchange Rate (ER) to determine its monetary policies [1]. An upsurge in monetary policy uncertainty causes the depreciation of foreign currencies against the local currency [2,3]. Therefore, understanding the relationship between ER and monetary policies uncertainty is a fundamental requirement for establishing an appropriate monetary policy [2,3]. In addition, the production rate of a country and the barometer of its international attractiveness or competitiveness, portfolio allocation, and management are greatly influenced by ER [4,5,6,7,8]. Thus, volatility in the ER has far-reaching severe consequences on countries, investors, companies, policymakers, and consumers [9,10]. For example, variations in ER make returns on investment undefined, negatively affecting investment decisions. Therefore, there is a need for efficient and reliable predictive models that can track the current dynamics of the ER and predict its future behaviour, particularly in periods where the ER frequently fluctuates [4].
Nevertheless, the foreign currency exchange market (Forex) is volatile and sophisticated, making its prediction challenging [4,6,11,12]. On the other hand, predicting the ER is essential for policymaking. It has a substantial effect on economic variables, such as interest rate, unemployment rate, oil price, the level of economic growth, and wages [1]. The negative impact of ER on the economy has resulted in several studies [1,3,6,8,9,10,11,13]. Notwithstanding, the number of studies, predicting, and forecasting techniques applicable in ER research so far can be clustered into two general categories, namely, classical and modern techniques.
The classical techniques include statistical extrapolations, conventional mathematical programming, and econometrics-based methods, while the modern technique employs Artificial Intelligence (AI) and soft-computing algorithms. Several techniques such as metaheuristic algorithms, fuzzy inference and neural networks, and support vector machines have been applied in this field to achieve some success using historical data [14,15,16]. However, many current studies argue that the fusion of quantitative and qualitative data is the possible future solution to improve prediction accuracy [14,17,18,19,20,21]. Since internal economic fundamentals cause ER fluctuations, namely, political, monetary, and external (uncertain) economic factors [10]; also, [22] pointed out that online users’ queries such as Google Trends can be effectively used in predicting ER. The study argues that the Google Trends index depicts users’ expectations because their search phrases are geared towards the information they sought to learn or are concerned about. In [23], it was revealed that textual data and public sentiments house confidential information, which, when extracted, can be effectively be used to enhance predicting accuracies of machine-learning models.
Notwithstanding, several studies used mathematical indicators constructed from the historical macroeconomic and exchange rate [3,6,11,13,24]. Others, [22], exploited the evidence recovered from news and public sentiments. The rivalry amid these schools of thought has engendered several thought-provoking achievements; however, no acceptable result has been found and agreed upon by all [25].
Given the above discussions, we seek to examine the uncertain relationship and volatility between public search queries (Google Trends) and macroeconomic variables (such as inflation rates, interest rates, unemployment rate, and composite consumer price) and exchange rate. As well as to propose a deep learning technique, Long Short-Term Memory networks (LSTM) framework to predict the weekly exchange rate of one Ghanaian Cedis (GH₵) to three different currencies (United States Dollar, British Pound, and Euro) based on features mentioned earlier. This paper adopted the LSTM because, according to Chen et al. [26], it can achieve better predictive performance than the autoregressive integrated moving average, support vector regression, and adaptive network fuzzy inference system [26]. Additionally, LSTM algorithms are reported to outperform state-of-the-art techniques regarding noise tolerance and accuracy for time-series classification [27].
Our study contributes to the literature by examining the uncertain relationships between Google Trends (public sentiments), macroeconomic variables (such as inflation rates, interest rates, unemployment rate, and composite consumer price) on one Ghanaian Cedis (GH₵) to three different currencies (United State Dollar, British Pound, and Euro) for the period January 2004 to October 2019. Moreover, we explored the philosophy that historical macroeconomic variables combined with investors and experts’ thoughts through search queries (fundamental analysis) will give better exchange range prediction accuracy. We seek to answer some questions concerning the dynamics of ER in Ghana, a developing economy. Again, what enrichment can be achieved in exchange rate predictability using information fusion from historical data and public search queries (Google Trends).
To the best of our knowledge, no previous study examined exchange rate dynamics in Ghana based on public search queries (Google Trends) and fundamental economic variables. This paper seeks to close this gap in the literature on the predictability of ER using information fusion from historical data (fundamental economic variables) and public search queries (Google Trends). Furthermore, we employ a more advanced soft-computing paradigm, deep learning technique, and Long Short-Term Memory networks (LSTM). As a result, we find answers to whether the ER fluctuation in Ghana depends on public search queries (Google Trends) or historical macroeconomic data.
Ghana was chosen as the case study of the current study because the Ghanaian Cedis (GH₵) has been several times considered as one of the worst currencies in the world [10]. Again, the extraordinary degree of instability in the Ghana cedi exchange rate is another influential factor. Furthermore, the continual depreciation in the Ghanaian currency has resulted in losing confidence, which contributes to a great extent of dollarisation in the economy. Moreover, the literature shows that most Ghanaian entrepreneurs’ significant concern is the ER’s instability between the Ghanaian Cedis and the United States (US) dollar, impacting their business negatively [5,28].
Therefore, this paper addresses the relationship between fundamental macroeconomic variables, commodity prices (cocoa, gold, and crude oil), and public search queries (Google Trends) from a machine learning and data science perspective; on ER’s characterisation and behavioural performance in Ghana. Thus, to the best of our knowledge, this work is the first attempt to address this issue from soft computing and machine learning paradigms based on public search queries, commodity prices, and fundamental economic variables to predict Ghana’s exchange rate. It will, therefore, serve as a reference point for the comparison of future studies on predicting the exchange rate of the Ghanaian Cedis based on soft computing techniques. We hypothesise that:
(i)
Enhancement can be achieved in exchange rate predictability using information fusion from historical microeconomic data and public search queries (Google Trends).
(ii)
The long short-term memory offers a better prediction accuracy than the traditional statistical models.
The remaining sections of the current study are presented as follows. Section 2 presents a review of pertinent literature. In Section 3, we present details of the methods and techniques adopted for this study. Section 4 presents the results and discussion, and finally, in Section 5, we present the conclusion of this study.

2. Related Works

The act of predicting ER has been in existence for countless centuries, where diverse models yield different predicting results, either out-of-sample or in-sample [29]. However, the current financial chaos around the world establishes the ER’s perfect information [1]. As a result, many studies have examined the causes and impact of ER fluctuations. Table 1 shows a summary of pertinent literature to this study. The review was categorised based on (i) the techniques adopted by a study, (ii) study origin, and (iii) accuracy and closeness metrics for evaluation.
Our partial search of the literature shows that several studies [5,9,10,12,22,28,30,31] have looked at the impact of essential macroeconomic variables such as current account balance, inflation, annual gross domestic product (GDP), growth rate, monetary policy-rate, quasi money supply per GDP, and the total external debt on the exchange rate of the local currency against foreign currencies. As seen in Table 1, a high percentage of these studies used conventional time series models. However, literature shows that these techniques suffer from two common defects (i) restrictive assumptions and (ii) limited predictive power. Notwithstanding the improvement made on these techniques by different researchers to boost their accuracy, their key drawbacks still undermine their reliability [16,32]. They also do not support the easy-automation process, as they require adjustment and adaptation at every stage, calling for certain standardisations and the static nature of the target data [14,33].
Other studies [12,16,24,31,34,35,36,37] applied soft computing paradigms to examine the predictability of ER as a means of overcoming the deficiencies in the conventional time series models. However, they examined ER predictability based on other macroeconomic variables, leaving enough information hidden in public views.
Subsequently, the adopted models used in [12,38] are prone to long-term dependency problems because they do not have a memory block and cannot store their previous values in a sequence dataset [16]. Therefore, they struggle to learn fluctuating datasets, such as the exchange rate. Accordingly, any neural architecture with a memory to store previous data can handle long-term dependency problems and help diminish this error and improve prediction accuracy.
Table 1. A Comparison of Related Works.
Table 1. A Comparison of Related Works.
Ref.AlgorithmData SourceEvaluation MetricStudy Origin
[22]PPP, Random walk, Monetary model, interest parityGTMSPENS
[5]PLSSEMMVR2, f2, Q2 and SGTGhana
[28]Multivariate GARCH DCC and BEKK models usingMVCorrelationGhana
[1]ARIMAMVRMSE, MAE, MPE, MAPENigeria
[12]Neural NetworkMVRMSENS
[10]Morlet wavelet transformMVMean, variance, skewness, kurtosisGhana
[30]ARIMAMVMAPE, RMSEGhana
[13]SVARMV UK
[11]Taylor rules fundamentals, yield curve factorsMVMSENS
[4]FFVAR,
Bayesian vector auto-regression
MVMSEUS
[31]ARIMA and Random walkMVCorrelationGhana
[38]Neural networkMVMSE, MAPEIndian
[9]PDFMVSkewness, p-value, KurtosisGhana
[39]RNN and CNNMVRMSEChina
[40]SVM, ANN and LSTMMVAccuracyIndia
[37]LSTMMVRMSE, accuracyNS
[41] Public sentimentsRMSE, MAEKorea
[24]Extreme Learning Machines (ELMs) and the Jaya optimisation techniqueMVMAPE, Theil’s U, ARV, and MAEIndia
Proposed modelLSTMGT + MVRMSE, MAE, AccuracyGhana
MSPE = mean square prediction error, PPP = Purchasing Power Parity, PLSSEM = Partial Least Squares Structural Equation Modelling, effect sizes (f2), Q2 = predictive relevance, SGT = Stone–Geisser test, MV = Macroeconomic Variables, NS = Not Stated, SVAR = structural Vector Autoregression, FFVAR = forgetting factor vector auto-regression, MSE = Mean square error, ARIMA = Autoregressive Integrated Moving Average, GT = Google Trends, PDF = probability distribution function, RNN: Recurrent Neural Network, CNN: Convolutional Neural Network, MAPE: Mean Absolute Percentage Error.

3. Materials and Methods

This section presents the methods and techniques adopted for data collection and modelling of the dataset.

3.1. Study Framework

Figure 1 shows the workflow diagram, which provides the framework of the proposed ER prediction model. The framework has four phases, namely: (i) data download and integration, (ii) data pre-processing and partition, (iii) LSTM model, and (iv) model evaluation phase.

3.1.1. Data Download and Integration

Exchange Rate Data: The daily exchange rate data of one Ghanaian Cedis (GH₵ 1) to three different currencies, i.e., United State Dollar (USD), British Pound (GBP), and Euro (EUR) from January 2004 to November 2019 was downloaded from Bank of Ghana (BoG) official website is used. We selected these three currencies for this study because, at the time of the study, they were the top daily interbank forex rates (https://societegenerale.com.gh/en/your-bank/foreign-exchange-rates/, https://www.bog.gov.gh/treasury-and-the-markets/daily-interbank-fx-rates/, accessed on 20 December 2019) in Ghana compared with other currencies. The ER dataset was approximately 4445 days, which included buying-price, selling-price, and mid-rate. We calculated the weekly ER return E R d of the buying-price, using Equation (1) as defined by Owusu et al. [10], where E R d . is the weekly compounded return, P d . is the current buying price and P d 5 is the previous week buying price. Our weekly estimation excluded the weekends (Saturdays and Sundays). The E R d . labels are denoted by y = y d , where y d represents the ER return class on a date (d).
E R d = ln ( R d + 5 ) = ln ( P d ) ln P d 5
Google Trends Data (GTD): Google Trends is a service provided by Google that offers a time series index of the volume of Internet search queries on search phrases entered by its users into the Google search engine. The search index data are provided weekly and monthly; the index data provided is in the range of (0–100), where zero represents the lowest and 100 a maximum value for the search date. A total of 283 records was downloaded from Google Trends using the Pytrends API and Python. For this study, the geographical area of the trend was limited to Ghana. The dataset is from January 2004 to November 2019. Google Trends index is selected as one of our input features for this study because it has been proven to be a good predictor in financial analysis. For example, in exchange rate [22], sck market analysis [42,43,44,45] and exchange rate prediction [46,47]. The GT dataset is represented by a vector G L × B , where B = features of GTI G I D , d , I , GID = unique ID assigned to each GTI record, d = GTI date, I = quantitative value of GT.
Macroeconomic Data (MD): The literature [5,9,21,22] has shown that fluctuations in ER in the short or long run are deeply impacted by macroeconomic fundamentals such as inflation, price level, composite consumer price, and interest rates. The MD was downloaded from the official websites of the Bank of Ghana (BoG). A total of thirty-three (33) monthly macroeconomic variables were selected initially, and a detailed description is shown (Table A1 Appendix A). The MD is represented by a vector M d a t a P × Q for each M d a t a its quantitative feature is represented by where x Q = x Q 1 , x Q 2 , x Q 3 , , x Q P   on   date   ( d ) , where Q is the number of feature, x p Q = values on Qth feature, and P is the number of records. Next, we integrated the two datasets G T . and M D . using the date variable as the index with the Pandas library and Python to get our new dataset D S . Let vector φ holds the final combination of the GT and MD defined vectors above. Finally, we apply a tactic to merge all features of GT and MD as a single vector, which is defined as φ d = β i d , i 1 , , d , where β i is the combined dataset observed on the day (d + 1). The prediction was modelled mathematically as a function f φ y t + d , i.e., the combined data is expressed as φ d M × N .

3.1.2. Data Pre-Processing and Partitioning

The accuracy of machine learning algorithms depends on data quality [21]. Hence, for better performance, we replaced all missing values in D S with an average value. Seasonality is relatively typical in economic time series, which may obscure the signal to be model, and in turn, may give a strong signal to the forecast model. Hence, we visualised the study data to identify patterns of seasonality and trend. We then adopted a differencing over rolling mean function in Pandas (https://pandas.pydata.org/ accessed on 9 September 2021) to treat identified seasonal components. The differencing was performed by subtracting the previous observation ( x t 1 ) from the current observation (x). The clean data was then scaled in the range of [0,1], using Equation (2). Thus, we divide each value x i in the dataset with the maximum value ( x m a x ) in our dataset to get a new value ( x n e w i ) . We partitioned the clean dataset into two sets, 80% for training the model and 20% for testing the model, using the skirt-learn (https://scikit-learn.org/stable/ accessed on 9 September 2021) library and Python (https://www.python.org/ accessed on 9 September 2021).
x n e w i = x i x max

3.1.3. Machine-Learning Model

There are numerous machine learning algorithms applicable to analysing financial data. However, the Long Short-Term Memory networks (LSTM) algorithm is adopted for this study. The choice to use LSTM was based on its competence to learn long-term dependencies, overcome the gradient vanishing problem, better predict the effect, learn past ER price data, and find out the relationship between time series [18,35,37,40]. The Long Short-Term Memory networks (LSTM) was introduced in 1997 by Hochreiter and Schmidhuber [48]. It came as a solution to the gradient vanishing problem faced by the Recurrent Neural Network (RNNs). Since then, it has received several advancements by different researchers [48]. LSTM has been applied in many areas to solve complex problems due to avoiding long-term dependency problems capabilities. Figure 2 shows a single LSTM block, having a memory cell represented as C t and three gates. Thus, forget the gate f t 0 , 1 , the input gate i t 0 , 1 , . and the output gate o t 0 , 1 . The flow of information in the LSTM block passes through the write operation from the input gate, deleting at the forget gate, and reading from the cell’s memory state by the output gate. The input gate selects information from the candidate memory cell ( C t ) to update the cell state. With its output gate serving as a filter, the LSTM block selects only pertinent information at its output. Using a Sigmoid function (Equation (3)), the forget gate f t [ 0 , 1 ] (as expressed in Equation (4)) chooses what information must be discarded from the state over the inputs Y t 1 and X t .
S ( σ ) = 1 1 + e ( 1 )
f t = σ ( w f . x t + U f . Y t 1 + b f )
where Y t 1 is the output from the preceding hidden layer and X t . which aids as the input from outside the network.
The next step chooses which new information is to be stored in the cell state. Thus, a Sigmoid layer i t (expressed by Equation (5)) outputs the updating value, and a hyperbolic tangent ( tanh ) layer (expressed by Equation (5)) creates a vector value a t (expressed in Equation (7)).
i t = σ w i . x t + U i . Y t 1 + b i
tanh = e x e x e x + e x
a t = tanh w a . x t + U a . Y t 1 + b a
Element-wise multiplication of these two layers was used while updating the cell state C t 1 and C t . This process is accomplished by adding the multiplication of the old state C t 1 and f t with i t × c ˇ . The final phase is the output operation, where the filtering version of the cell stage represents the output. The first output gate chooses which value of the cell state reaches the output (expressed by Equation (8)).
c t = f t . c t 1 + i t . a t
The cell state is then passed through tanh layer o t (expressed by Equation (9)) and multiply with the output gate’s outcome to get the ultimate output Y t (expressed by Equation (10)). For practical applications, an appropriate quantity of LSTM blocks is combined to form a layer.
i t = σ w o . x o + U o . Y t 1 + b o
Y t = o t . tanh c t
Choosing the right optimiser is crucial for an LSTM model because it significantly affects the algorithm’s convergence rate [21]. For this study, the Adam (Adaptive Moment Estimation) optimiser was adopted for model optimisation. The Adam was adopted because it combines the strength of two other optimisers, namely ADAgrad and RMSprop. Furthermore, Tikhonov regularisation was adopted to prevent the overfitting of our model during training [16]. Finally, the back-propagation training algorithm was employed to train our LSTM. The input data size and time steps impact the complexity and performance of the LSTM network.
Consequently, we designed each LSTM layer to accommodate 20 LSTM blocks, with each block linking to a timestep in the dataset to be supplied into the network. Table 2 shows the hyperparameters setting of our LSTM model for the current study. The Kares library and Python was used in the implementation of the LSTM.

3.2. Theoretical Background of Benchmark Models

This section gives a brief description of two machine-learning algorithms used as benchmark models for comparing the performance of our proposed deep LSTM model. Namely, Support Vector Regressor (SVR) and Back-propagation Neural Network (BPNN).

3.2.1. Support Vector Regressor

Cortes and Vapnik (1995) introduced the support vector regressor with a minor modification but used the same principles as the support vector classifier [49]. Thus, it can be effectively be applied in solving linear and nonlinear tasks when data points and their features are limited. A training dataset (DS) with N data points is given, as defined in Equation (11).
D s = x i , y i | x i R d , y i 1 , 1 i = 1 N
where xi = input independent variable, yi = correspondent dependent output, and d = dimension of the input space. The application of the SVR gives a linear regression function as defined in Equation (12).
y = f x = w T β x + b
where f(x) = predicted values, β(x) = a linear function in terms of x, and WT = weight factor and b = bias parameter.

3.2.2. Back-Propagation Neural Network (BPNN)

BP (Back-Propagation) neural network (BPNN) algorithm is among the commonly and popularly used supervised techniques for optimising the training of feed-forward neural networks [50,51]. It was proposed Rumelhart, Hinton, and Williams in 1986 cited in [50], the BPNN learns by computing the errors of the NN output layer to discover the errors in its hidden layers; this makes the BPNN suitable in solving problems for which no association can be found amid the output and inputs. Thus, the BPNN has become the favourite technique for training a multilayer perceptron (MLP) [50,51,52].

3.2.3. Evaluation Metrics

Several statistical techniques are available for measuring the performance of machine learning models. However, for this study, we used two closeness metrics, namely: Root Mean Square Error (RMSE) (expressed by Equation (13)), Mean-Absolute-Error (MAE) (expressed by Equation (14)), Correlation Coefficient (R2) (expressed by Equation (15)) Mean absolute percentage error (MAPE) (expressed by Equation (16)), Mean Square Error (MSE) (expressed by Equation (17)), and Root Mean Squared Log Error (RMSLE) (expressed by Equation (18)). These metrics directly explain measurement units, giving better goodness of fit and efficiency.
R M S E = 1 n i = 1 n t i y i 2
M A E = 1 n i = 1 n | t i y i t i |
R = i = 1 n t i t ^ × y i y ^ i = 1 n t i t ^ 2 × i = 1 n y i y ^ 2
M A P E = 1 n i = 1 n t i y i t i
M S E = 1 n i = 1 n t i y i 2
R M S L E = 1 n i = 1 n log y i + 1 log t i + 1 2
where   t ^ = 1 n i = 1 n t i   and   y ^ = 1 n i = 1 n y i are the average values of t i and y i , respectively.
y i = the predicted value produced by the model, t i = the actual value, and n is the total number of testing data.

4. Results and Discussions

We experimented with our proposed framework for ER prediction to evaluate its performance. All experiments were carried out on an HP laptop (Spectre x360) eight Generation Intel® Core™ i7 processor 16.0 GB RAM. We present the experimental results and discussions in two parts; the visualisation and statistical analysis of study data are presented, followed by our exchange rate prediction outcome.

4.1. Dataset Visualisation

Figure 3a shows a plot of the Google Trends (GT) dataset used in this study from January 2004 to October 2019. As can be observed, the US dollar was very popular against the Euros and British Pounds from 2004 to early 2014. However, the reverse was seen from the later part of 2014 to the later part of 2019. A standard deviation of 18.67, 10.09, and 27.18 was observed within the GT dataset for Euro, USD, and BP, respectively. Figure 3b shows a plot of 1 GHS against USD, EUR, and GBP. As seen, the Ghanaian Cedis exchange rate to USD, EUR, and GBP keeps increasing from 2004 to 30 October 2019. However, from 2014 to 2016, we observed a sharp variation in all three currencies against the GH₵ (Figure 3b). Consequently, the GBP declined against the GH₵ around the year 2017, and then raised again. The outcome (Figure 3b) shows a high fluctuation rate of the GH₵ against the USD, EUR, and GBP, which affirm literature [5,9,10,28,31,53].
Table 3 shows a statistical analysis of the study data. It was observed that from January 2004 to October 2019, the exchange rate of USD to GHS varied between GH (0.8124 and 5.3399). While EUR to GHS was within GHS (1.2207–5.9845) and GBP to GHS was GHS (1.5353–6.9521). This result shows that, on average, there is a monthly rise of GH 0.0254 in USD to GHS, GH 0.02676 in EUR to GHS, and GH 0.03043 in GBP to GHS exchange rates.
Figure 4 shows the correlation matrix plot of our dataset. We observed a strong positive correlation (0.98–0.99) between exchange rate values. Moreover, an excellent positive association (0.3–0.85) between the Google trend and exchange rate in Ghana concerning. For example, from Figure 4, it is seen that the exchange rate of EUR to GH₵ correlates positively within (0.38–0.99) with GBP to GH₵, USD to GH₵, Google Trends concerning Euro (GT: EUR) and Google Trends concerning British Ponds (GT: GBP). The correlation matrix plots suggest that as more queries are made on search engines such as Google Trends concerning the exchange rate of a currency, the demand of the said currency causes a rise in the currency value against the local currency.

4.2. Model Performance Measure

This section presents the feature selection, the predicted results of our predictive model.

4.2.1. Automatic Feature Selection

We applied random forest techniques to rank the 33 initially selected Macroeconomic Features (MF) (Table A1 Appendix A) based on their RMSE values. Figure 5 shows the ranking outcome of these variables in predicting GH₵ 1 to EUR 1. It was observed that Foreign Currency Deposits (FCD), Claims on Private Sector (CPS), Net Domestic Assets (NDA) and Reserve Money (RM) were the top-most features. Figure 6 shows the ranking of MF based on the GHS to GBP exchange rate. Similarly, we observed that Foreign Currency Deposits (FCD), Claims on Private Sector (CPS), Net Domestic Assets (NDA), and Reserve Money (RM) were the top-most features. It was further observed that Total Liquidity (TLM2+) is a good predictor of the exchange rate between the Ghanaian cedis and the GBP than the EUR. Figure 7 shows the ranking of MF based on the USD. Again, we observed that Foreign Currency Deposits (FCD), Claims on Private Sector (CPS), Net Domestic Assets (NDA), and Currency Outside Banks (COB) were the top-most predictors. Thus, unlike the MF ranking on EUR and GBP, the exchange rate between GH₵ and the USD is affected by currency outside banks than the reserve money.
Thus, the results obtained (Figure 5, Figure 6 and Figure 7) show that the exchange rate between the Ghanaian Cedis and GBP, USD, and EUR are not equally affected by the same macroeconomic variables. Additionally, the inflation rate affects the Ghanaian Cedis’ exchange rate to EUR, GBP, and USD (Figure 5 and Figure 6); however, not as deep as reported in [28,53]. On the other hand, the study outcome affirms Adusei and Gyapong’s [5] claims that the monetary survey has a positive relationship with the Ghanaian cedi USD exchange rate. Therefore, we group the remaining outcome of this paper into two sub-sections: prediction outcome with only Macroeconomic Dataset (MD) as input variables and combination of Google Trends Dataset (GTD) and MD as the input dataset.

4.2.2. Prediction with Macroeconomic Variables

We sought to examine the predictability of one Ghanaian cedi to three other foreign currencies based on the internal and external economic factors. Ten (10) top-most features out of the 33 macroeconomic variables were selected as input to our predictive model. Figure 8 shows the model prediction plot and the actual exchange rate of GH₵ 1 to USD 1. Likewise, Figure 9 and Figure 10 show the model prediction plot and the actual exchange rate of GH₵ 1 to EUR 1 and GH₵ 1 to GBP 1. The actual and predicted is defined in this study as: (i) the actual values represent the true values (y); in this case, the exchange rate of a giving day (di); and (ii) predicted values are the values our model estimates (y’) on giving day (di). The results show that the exchange rate between the Ghanaian cedi and the USD can be predicted with a modest accuracy rate. Hence, like other previous studies [5] and [10,28,31,53], the outcome of this study also affirms the association between exchange rate variations and fundamental macroeconomic factors.

4.2.3. Prediction with Macroeconomic Variables and Google Trend

The Google Trends index was integrated with ten (10) selected macroeconomic features to constitute the input dataset for better prediction accuracy. Figure 11 shows the prediction outcome (GHS to USD) with a macroeconomic variable and Google Trends as input dataset to a predictive model. The results show a close margin between the actual and predicted values for some instances and the reverse for others. However, as discussed in Section 4.1, the Google index was less than one (GT < 1) in some months, as observed in Figure 3a. The consequence of these low index values was detected to impact the prediction outcome in January 2005, July 2007, April 2010, and November 2018 (Figure 11). The results show that public queries made on the Google search engine on the USD against the GH₵ are highly associated with the exchange rate. Furthermore, with the addition of the Google Trends data, we observed slight signs of improved performance in the model’s performance (Figure 11) compared with macroeconomic data only (Figure 8).
Figure 12 shows a plot of actual values against predicted values of GH₵ 1 to EUR 1 based on MD and GTD. Figure 13 shows actual values against predicted values of GH₵ 1 to GBP 1 based on MD and GTD. The results showed that the Google trend to the macroeconomic variable contributed to a slight improvement in performance (Figure 12) compared to that observed in the USD (Figure 11). Hence, it can be deduced that Google Trends cannot always serve as an indicator to predict variation in the GH₵ to all foreign currencies. However, with the evidence seen in Figure 11, we believe that these results necessitate further study in this area to explore the additional value one can get from Google Trends.
Table 4 shows the results of closeness metric (error values) of three different models, Long Short-Term Memory network (LSTM), Support Vector Regressor (SVR), and Back-propagation Neural Network (BPNN) for a 30-day ahead exchange rate prediction of GH₵1 against three different currencies. For the SVR and BPNN, no parameter tuning was carried out in this study, i.e., we used the Scikit learn default values; SVR (C = 1.0, kernel = ‘rbf’, gamma = ‘scale’, tol = 0.001) and BPNN (hidden_layer_sizes = 100, activation =’relu’, solver = ‘adam’, learning_rate = ‘constant, batch_size =’auto, learning_rate_init = 0.001). These two algorithms were chosen as a benchmark due to their performance and efficacy in time series analysis [14,15,54]. It was observed that our LSTM model obtained MAE (0.033), MSE (0.0035), RMSE (0.0551), R2 (0.9983), RMSLE (0.0129), and MAPE (0.0121) in predicting the EUR compared with SVR (MAE = 0.05, MAE = 0.005, RMSE = 0.0683, R2 = 0.9973, RMSLE = 0.0191, and MAPE = 0.0241) and BPNN (MAE = 0.04, MAE = 0.0056, RMSE = 0.0688, R2 = 0.9974, RMSLE = 0.0172, and MAPE = 0.0168). From Table 4, it can be seen that the BPNN slightly outperformed the SVR. However, in some cases, the performance metrics of the BPNN compared with SVR were almost the same. In total, the LSTM outperformed both the BPNN and SVR. The outperformance of LSTM over SVR and BPNN can be attributed to the memories that LSTM has over SVR and BPNN. Thus, the performance of a machine-learning model is partially based on the input datasets characteristics.
Moreover, the fluctuation nature of exchange rate data needs more time to comprehend patterns and update weights and adjust the model accordingly. The outcome shows that the LSTM can conveniently handle the variation in exchange rate data without difficulty because of its distinct features, gated input and output, and memory block. The outcome implies that context-aware selection of machine-learning algorithms is meaningful in picking the best algorithms.

5. Conclusions

The stability of a county’s currency against other foreign currencies is believed to be a good indicator of a stable economy and effective monetary policies. Hence, predicting the future exchange rate and managing its stability are crucial factors for economic decision making. However, the exchange rate’s stochastic nature makes it difficult to predict future variation, especially when its fluctuation rates are uncertain. Nevertheless, numerous studies have attempted to use several statistical techniques to predict one currency exchange rate against another. This study sought to predict a 30-day-ahead exchange rate of the Ghanaian cedi to three different currencies (i.e., USD, EUR, and GBP). However, unlike previous studies that employed only essential macroeconomic variables to predict the exchange rate, we used the combined effect of Google Trends and macroeconomic variables in predicting the exchange rate for examination based on the LSTM predictive framework. We experimented with the proposed framework dataset from January 2004 to October 2019 from the Bank of Ghana (BoG) and Google.
We observed a degree of association between macroeconomic variables such as inflation, monthly monetary survey, commodity prices, interest rates, and exchange rates from the experiment carried out. Therefore, we deduced that the stability of the inflation rate and interest rates does not wholly guarantee stability in exchange rates. Furthermore, the results show that the Google trend is associated with the Ghanaian Cedis’ exchange rate fluctuation to some foreign currencies and can be effectively used to predict these exchange rates. Finally, the outcome shows that the LSTM can conveniently handle the variation in exchange rate data without any difficulty and offer lesser error in prediction than SVR and BPNN algorithms. The improvement in accuracy and decrement in error achieved with the combined dataset suggest that future financial analysis studies should explore additional information sources such as Google Trends, public sentiment, and financial news, to enhance prediction accuracy. Again, the performance of the LSTM creates the opening for examining the probability of accuracy enhancement by different deep learning neural network techniques such as stateful, Stateless, Deep Reinforcement Learning (DRL) in predicting exchange rate.

Author Contributions

Conceptualisation, A.F.A. and I.K.N.; methodology, A.F.A., I.K.N. and B.A.W.; software, I.K.N.; validation A.F.A., I.K.N. and B.A.W.; formal analysis, I.K.N.; investigation, A.F.A., I.K.N. and B.A.W.; resources, A.F.A., I.K.N. and B.A.W.; data curation, I.K.N.; writing—original draft preparation, A.F.A., I.K.N. and B.A.W.; writing—review and editing, A.F.A., I.K.N. and B.A.W.; visualisation, A.F.A., I.K.N. and B.A.W.; supervision, A.F.A. and B.A.W. All authors have read and agreed to the published version of the manuscript.

Funding

This research received no external funding.

Institutional Review Board Statement

Not applicable.

Informed Consent Statement

Not applicable.

Data Availability Statement

The data used is publicly available.

Acknowledgments

We express our gratitude to everyone who contributed to the development of this paper.

Conflicts of Interest

The authors declare no conflict of interest.

Appendix A

Table A1. Initial macroeconomic Features Selected.
Table A1. Initial macroeconomic Features Selected.
S/NMACROECONOMIC VARIABLESAbbreviation
MONTHLY MONETARY SURVEY
1.Net Foreign AssetsNFA
2.BOGBOG
3.DMBsDMB
4.Net Domestic AssetsNDA
5.Claims on Gov’tCoG
6.Govt. DepositsGD
7.Claims on private sectorCPS
8.Other Items (net)OI
9.Total AssetsTA
10.Currency outside banksCOB
11.Demand depositsDD
12.Savings & Time depositsSTD
13.Foreign currency depositsFCD
14.Total LiabilitiesTL
15.Reserve Money (RM)RM
16.Narrow Money (M1)M1
17.Broad Money (M2)M2+
18.Total Liquidity (M2+)TLM2+
MONTHLY INTEREST RATES
19.Monetary Policy RateMPR
20.91-Day Treasury Bill Interest Rate Equivalent91-Tbill
21.Inter-Bank Weighted AverageIBWA
22.Average Commercial Banks Lending RateACBLR
23.Average Savings Deposits RateASDR
24.Average Time Deposits Rate (3-Month)ATD
COMMODITY PRICES MONTHLY
25.International Cocoa Price (US$/Tonne)CP
26.International Gold (US$/fine ounce)GP
27.International Brent Crude Oil (US$/Barrel)BCOP
INFLATION
28.Headline InflationHF
29.Food InflationFI
31.Non-Food InflationNFI
32.Bank of Ghana Composite Index of Economic Activity (Nominal Growth)BGCIEA_NG
33.Bank of Ghana Composite Index of Economic Activity (Real Growth)BGCIEA_RG

References

  1. Nyoni, T. Modeling and Forecasting Naira/USD Exchange Rate in Nigeria: A Box-Jenkins ARIMA Approach; MPRA Paper No 88622; Munich Personal RePEc Archive, 2018; pp. 6–25. Available online: https://mpra.ub.uni-muenchen.de/88622/ (accessed on 27 February 2020).
  2. Auclert, A. Monetary policy and the redistribution channel. Am. Econ. Rev. 2019, 109, 2333–2367. [Google Scholar] [CrossRef] [Green Version]
  3. Mueller, P.; Tahbaz-Salehi, A.; Vedolin, A. Exchange Rates and Monetary Policy Uncertainty. J. Financ. 2017, 72, 1213–1252. [Google Scholar] [CrossRef] [Green Version]
  4. Abbate, A.; Marcellino, M. Point, interval and density forecasts of exchange rates with time varying parameter models. J. R. Stat. Soc. Ser. A Stat. Soc. 2018, 181, 155–179. [Google Scholar] [CrossRef] [Green Version]
  5. Adusei, M.; Gyapong, E.Y. The impact of macroeconomic variables on exchange rate volatility in Ghana: The Partial Least Squares Structural Equation Modelling approach. Res. Int. Bus. Financ. 2017, 42, 1428–1444. [Google Scholar] [CrossRef]
  6. Byrne, J.P.; Korobilis, D.; Ribeiro, P.J. On the Sources of Uncertainty in Exchange Rate Predictability. Int. Econ. Rev. (Phila.) 2018, 59, 329–357. [Google Scholar] [CrossRef] [Green Version]
  7. Samanhyia, S.; Oware, K.M.; Anisom-yaansah, F. Financial Distress and Bankruptcy Prediction: Evidence from Ghana. Expert J. Financ. 2016, 4, 52–65. [Google Scholar]
  8. Ernest, K.; Theophilus, A.-K.; Amoah, P.; Emmanuel, B.B. Identifying key economic indicators influencing tender price index prediction in the building industry: A case study of Ghana. Int. J. Constr. Manag. 2019, 19, 106–112. [Google Scholar] [CrossRef]
  9. Sarpong, S. Estimating the probability distribution of the exchange rate between Ghana Cedi and American dollar. J. King Saud Univ.-Sci. 2019, 31, 177–183. [Google Scholar] [CrossRef]
  10. Owusu, P.J.; Tweneboah, G.; Adam, A.M. Interdependence of Major Exchange Rates in Ghana: A Wavelet Coherence Analysis. J. Afr. Bus. 2019, 20, 407–430. [Google Scholar] [CrossRef]
  11. Cheung, Y.-W.; Chinn, M.D.; Pascual, A.G.; Zhang, Y. Exchange rate prediction redux: New models, new data, new currencies. J. Int. Money Financ. 2019, 95, 332–362. [Google Scholar] [CrossRef] [Green Version]
  12. Shahbazi, N.; Memarzadeh, M.; Gryz, J. Forex Market Prediction Using NARX Neural Network with Bagging. MATEC Web Conf. 2016, 68, 19001. [Google Scholar] [CrossRef] [Green Version]
  13. Forbes, K.; Hjortsoe, I.; Nenova, T. The shocks matter: Improving our estimates of exchange rate pass-through. J. Int. Econ. 2018, 114, 255–275. [Google Scholar] [CrossRef] [Green Version]
  14. Nti, I.K.; Adekoya, A.F.; Weyori, B.A. A systematic review of fundamental and technical analysis of stock market predictions. Artif. Intell. Rev. 2019, 53, 3007–3057. [Google Scholar] [CrossRef]
  15. Rezaee, M.J.; Jozmaleki, M.; Valipour, M. Integrating dynamic fuzzy C-means, data envelopment analysis and artificial neural network to online prediction performance of companies in stock exchange. Phys. A Stat. Mech. Appl. 2018, 489, 78–93. [Google Scholar] [CrossRef]
  16. Nti, I.K.; Adekoya, A.F.; Weyori, B.A. Random Forest Based Feature Selection of Macroeconomic Variables for Stock Market Prediction. Am. J. Appl. Sci. 2019, 16, 200–212. [Google Scholar] [CrossRef]
  17. Agarwal, S.; Kumar, S.; Goel, U. Stock market response to information diffusion through internet sources: A literature review. Int. J. Inf. Manag. 2019, 45, 118–131. [Google Scholar] [CrossRef]
  18. Pandurang, G.D.; Kumar, K. Ensemble Computations on Stock Market: A Standardized Review for Future Directions. In Proceedings of the 2019 IEEE International Conference on Electrical, Computer and Communication Technologies (ICECCT), Coimbatore, India, 20–22 February 2019; pp. 1–6. [Google Scholar] [CrossRef]
  19. Nguyen, T.; Yoon, S. A Novel Approach to Short-Term Stock Price Movement Prediction using Transfer Learning. Appl. Sci. 2019, 9, 4745. [Google Scholar] [CrossRef] [Green Version]
  20. Thakkar, A.; Chaudhari, K. Fusion in stock market prediction: A decade survey on the necessity, recent developments, and potential future directions. Inf. Fusion 2021, 65, 95–107. [Google Scholar] [CrossRef] [PubMed]
  21. Nti, I.K.; Adekoya, A.F.; Weyori, B.A. A novel multi-source information-fusion predictive framework based on deep neural networks for accuracy enhancement in stock market prediction. J. Big Data 2021, 8, 17. [Google Scholar] [CrossRef]
  22. Bulut, L. Google Trends and the forecasting performance of exchange rate models. J. Forecast. 2018, 37, 303–315. [Google Scholar] [CrossRef]
  23. Nti, I.K.; Adekoya, A.F.; Weyori, B.A. Predicting Stock Market Price Movement Using Sentiment Analysis: Evidence from Ghana. Appl. Comput. Syst. 2020, 25, 33–42. [Google Scholar] [CrossRef]
  24. Das, S.R.; Mishra, D.; Rout, M. A hybridized ELM-Jaya forecasting model for currency exchange prediction. J. King Saud Univ.-Comput. Inf. Sci. 2020, 32, 345–366. [Google Scholar] [CrossRef]
  25. Picasso, A.; Merello, S.; Ma, Y.; Oneto, L.; Cambria, E. Technical analysis and sentiment embeddings for market trend prediction. Expert Syst. Appl. 2019, 135, 60–70. [Google Scholar] [CrossRef]
  26. Chen, W.; Xu, H.; Jia, L.; Gao, Y. Machine learning model for Bitcoin exchange rate prediction using economic and technology determinants. Int. J. Forecast. 2021, 37, 28–43. [Google Scholar] [CrossRef]
  27. Karim, F.; Majumdar, S.; Darabi, H. Insights into lstm fully convolutional networks for time series classification. IEEE Access 2019, 7, 67718–67725. [Google Scholar] [CrossRef]
  28. Nortey, E.N.N.; Ngoh, D.D.; Doku-Amponsah, K.; Ofori-Boateng, K. Modeling inflation rates and exchange rates in Ghana: Application of multivariate GARCH models. Springerplus 2015, 4, 86. [Google Scholar] [CrossRef] [PubMed] [Green Version]
  29. Meese, R.; Rogoff, K.S. The Out-of-Sample Failure of Empirical Exchange Rate Models: Sampling Error or Misspecification? National Bureau of Economic Research: Cambridge, MA, USA, 1982; Volume 1982, ISBN 0226262502. [Google Scholar]
  30. Adetunde, I.A.; Appiah, S.T. Forecasting Exchange Rate Between the Ghana Cedi and the Us Dollar Using Time Series Analysis. Afr. J. Basic Appl. Sci. 2011, 3, 255–264. [Google Scholar]
  31. Ayekple, Y.E.; Harris, E.; Frempong, N.K.; Amevialor, J. Time Series Analysis of the Exchange Rate of the Ghanaian Cedi to the American Dollar. J. Math. Res. 2015, 7, 46–53. [Google Scholar] [CrossRef] [Green Version]
  32. Caiani, A.; Godin, A.; Caverzasi, E.; Gallegati, M.; Kinsella, S.; Stiglitz, J.E. Journal of Economic Dynamics & Control Agent based-stock flow consistent macroeconomics: Towards a benchmark model. J. Econ. Dyn. Control. 2016, 69, 375–408. [Google Scholar] [CrossRef] [Green Version]
  33. Bisoi, R.; Dash, P.K. A hybrid evolutionary dynamic neural network for stock market trend analysis and prediction using unscented Kalman filter. Appl. Soft Comput. J. 2014, 19, 41–56. [Google Scholar] [CrossRef]
  34. Galeshchuk, S. Neural networks performance in exchange rate prediction. Neurocomputing 2016, 172, 446–452. [Google Scholar] [CrossRef]
  35. Galeshchuk, S.; Mukherjee, S. Deep networks for predicting direction of change in foreign exchange rates. Intell. Syst. Account. Financ. Manag. 2017, 24, 100–110. [Google Scholar] [CrossRef]
  36. Galeshchuk, S.; Mukherjee, S. Deep Learning for Predictions in Emerging Currency Markets. In Proceedings of the 9th International Conference on Agents and Artificial Intelligence, Porto, Portugal, 24–26 February 2017; Volume 2: NO. ICAART. SCITEPRESS—Science and Technology Publications: Setúbal, Portugal, 2017; pp. 681–686. [Google Scholar] [CrossRef]
  37. Qu, Y.; Zhao, X. Application of LSTM Neural Network in Forecasting Foreign Exchange Price. J. Phys. Conf. Ser. 2019, 1237, 042036. [Google Scholar] [CrossRef]
  38. Singh, U.P.; Jain, S. Optimization of neural network for nonlinear discrete time system using modified quaternion firefly algorithm: Case study of Indian currency exchange rate prediction. Soft Comput. 2018, 22, 2667–2681. [Google Scholar] [CrossRef]
  39. Ni, L.; Li, Y.; Wang, X.; Zhang, J.; Yu, J.; Qi, C. Forecasting of Forex Time Series Data Based on Deep Learning. Proced. Comput. Sci. 2019, 147, 647–652. [Google Scholar] [CrossRef]
  40. Nagpure, A.R. Prediction of multi-currency exchange rates using deep learning. Int. J. Innov. Technol. Explor. Eng. 2019, 8, 316–322. [Google Scholar]
  41. 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. [Google Scholar] [CrossRef] [Green Version]
  42. Hu, H.; Tang, L.; Zhang, S.; Wang, H. Predicting the direction of stock markets using optimized neural networks with Google Trends. Neurocomputing 2018, 285, 188–195. [Google Scholar] [CrossRef]
  43. Fan, M.-H.; Chen, M.-Y.; Liao, E.-C. A deep learning approach for financial market prediction: Utilization of Google trends and keywords. Granul. Comput. 2021, 6, 207–216. [Google Scholar] [CrossRef]
  44. Maneejuk, P.; Yamaka, W. Predicting Contagion from the US Financial Crisis to International Stock Markets Using Dynamic Copula with Google Trends. Mathematics 2019, 7, 1032. [Google Scholar] [CrossRef] [Green Version]
  45. Bock, J. Quantifying Macroeconomic Expectations in Stock Markets Using Google Trends. SSRN Electron. J. 2018, 1805.00268. Available online: https://ssrn.com/abstract=3218912 (accessed on 22 March 2018).
  46. Ito, T.; Masuda, M.; Naito, A.; Takeda, F. Application of Google Trends-based sentiment index in exchange rate prediction. J. Forecast. 2021, 40, 1154–1178. [Google Scholar] [CrossRef]
  47. Wilcoxson, J.; Follett, L.; Severe, S. Forecasting Foreign Exchange Markets Using Google Trends: Prediction Performance of Competing Models. J. Behav. Financ. 2020, 21, 412–422. [Google Scholar] [CrossRef]
  48. Appiah, A.Y.; Zhang, X.; Ayawli, B.B.K.; Kyeremeh, F. Long Short-Term Memory Networks based Automatic Feature Extraction for Photovoltaic Array Fault Diagnosis. IEEE Access 2019, 7, 30089–30101. [Google Scholar] [CrossRef]
  49. Vapnik, V.; Golowich, S.E.; Smola, A. Support vector method for function approximation, regression estimation, and signal processing. In Advances in Neural Information Processing Systems; MIT Press: Cambridge, MA, USA, 1997; pp. 281–287. [Google Scholar]
  50. Nawi, N.M.; Khan, A.; Rehman, M.Z. A new back-propagation neural network optimized with cuckoo search algorithm. In Computational Science and Its Applications–ICCSA 2013; Springer: Berlin/Heidelberg, Germany, 2013; Volume 7971 LNCS, Part 1; pp. 413–426. [Google Scholar] [CrossRef] [Green Version]
  51. Cai, X.; Qian, Y.; Bai, Q.; Liu, W. Exploration on the financing risks of enterprise supply chain using Back Propagation neural network. J. Comput. Appl. Math. 2020, 367, 112457. [Google Scholar] [CrossRef]
  52. Wang, L.; Zeng, Y.; Chen, T. Back propagation neural network with adaptive differential evolution algorithm for time series forecasting. Expert Syst. Appl. 2015, 42, 855–863. [Google Scholar] [CrossRef]
  53. Techie Quaicoe, M.; Twenefour, F.B.K.; Baah, E.M.; Nortey, E.N.N. Modeling variations in the cedi/dollar exchange rate in Ghana: An autoregressive conditional heteroscedastic (ARCH) models. Springerplus 2015, 4, 329. [Google Scholar] [CrossRef] [Green Version]
  54. Nti, I.K.; Adekoya, A.F.; Weyori, B.A. A comprehensive evaluation of ensemble learning for stock-market prediction. J. Big Data 2020, 7, 20. [Google Scholar] [CrossRef]
Figure 1. Workflow diagram of the proposed exchange rate prediction.
Figure 1. Workflow diagram of the proposed exchange rate prediction.
Fintech 01 00002 g001
Figure 2. A single LSTM block containing a forget, input and output gates.
Figure 2. A single LSTM block containing a forget, input and output gates.
Fintech 01 00002 g002
Figure 3. Visualisation of study datasets.
Figure 3. Visualisation of study datasets.
Fintech 01 00002 g003
Figure 4. Correlation matrix plot of dataset.
Figure 4. Correlation matrix plot of dataset.
Fintech 01 00002 g004
Figure 5. Macroeconomic features ranking based on EUR.
Figure 5. Macroeconomic features ranking based on EUR.
Fintech 01 00002 g005
Figure 6. Macroeconomic features ranking based on GBP.
Figure 6. Macroeconomic features ranking based on GBP.
Fintech 01 00002 g006
Figure 7. Macroeconomic features ranking based on USD.
Figure 7. Macroeconomic features ranking based on USD.
Fintech 01 00002 g007
Figure 8. Prediction result GH 1 to USD 1 with MD.
Figure 8. Prediction result GH 1 to USD 1 with MD.
Fintech 01 00002 g008
Figure 9. Prediction result GH 1 to EUR 1 with MD.
Figure 9. Prediction result GH 1 to EUR 1 with MD.
Fintech 01 00002 g009
Figure 10. Prediction outcome GH1 to GBP 1 with MD.
Figure 10. Prediction outcome GH1 to GBP 1 with MD.
Fintech 01 00002 g010
Figure 11. Prediction result GH1 to USD 1 with MD and GTD.
Figure 11. Prediction result GH1 to USD 1 with MD and GTD.
Fintech 01 00002 g011
Figure 12. Prediction result GH 1 to EUR 1 with MD and GTD.
Figure 12. Prediction result GH 1 to EUR 1 with MD and GTD.
Fintech 01 00002 g012
Figure 13. Prediction result GH 1 to GBP 1 with MD and GTD.
Figure 13. Prediction result GH 1 to GBP 1 with MD and GTD.
Fintech 01 00002 g013
Table 2. A summary of hyperparameters.
Table 2. A summary of hyperparameters.
HyperparameterValue
Input time steps20
Input feature dimension10
Learning rate0.002
Adam optimiser β 1 = 0.9 , β 2 = 0.999
Batch size128
# Epochs100
# nodes in LSTM input layer34
# nodes in LSTM output layer1
Output layersingle value prediction
Table 3. Descriptive statistics of study data.
Table 3. Descriptive statistics of study data.
USD–GH₵EUR–GH₵GBP–GH₵
Mean2.3216274512.9016453.434115
Standard Error0.023082520.0236750.02839
Median1.58592.15332.4558
Mode0.91221.91761.7076
Standard Deviation1.4464841151.4836021.779061
Sample Variance2.0923162952.2010763.165059
Kurtosis−1.09615245−1.05057−1.37613
Skewness0.6716443460.6619810.541371
Range4.52755.06255.4178
Minimum0.81240.9221.5343
Maximum5.33995.98456.9521
Sum9117.03111,394.7613,485.77
Confidence Level (95.0%)0.0452548590.0464160.05566
Table 4. Thirty-day-ahead prediction of GH1 to three different currencies using three different models.
Table 4. Thirty-day-ahead prediction of GH1 to three different currencies using three different models.
CurrencyModelsMAEMSERMSER2RMSLEMAPE
EURLSTM0.03270.00350.05510.99830.01290.0121
BPNN0.04330.00560.06880.99740.01720.0168
SVR0.05080.00510.06830.99730.01910.0241
USDLSTM0.08050.01720.12080.99390.02180.0218
BPNN0.09730.02170.14060.99160.02740.0287
SVR0.0950.02380.1460.99110.02750.0269
GBPLSTM0.06340.00960.09230.99530.02680.0257
BPNN0.07940.01390.11350.9930.03290.0328
SVR0.09280.01720.12550.99140.03330.0362
Publisher’s Note: MDPI stays neutral with regard to jurisdictional claims in published maps and institutional affiliations.

Share and Cite

MDPI and ACS Style

Adekoya, A.F.; Nti, I.K.; Weyori, B.A. Long Short-Term Memory Network for Predicting Exchange Rate of the Ghanaian Cedi. FinTech 2022, 1, 25-43. https://doi.org/10.3390/fintech1010002

AMA Style

Adekoya AF, Nti IK, Weyori BA. Long Short-Term Memory Network for Predicting Exchange Rate of the Ghanaian Cedi. FinTech. 2022; 1(1):25-43. https://doi.org/10.3390/fintech1010002

Chicago/Turabian Style

Adekoya, Adebayo Felix, Isaac Kofi Nti, and Benjamin Asubam Weyori. 2022. "Long Short-Term Memory Network for Predicting Exchange Rate of the Ghanaian Cedi" FinTech 1, no. 1: 25-43. https://doi.org/10.3390/fintech1010002

Article Metrics

Back to TopTop