Development of GRU Deep Learning Model for Predicting Daily United States Dollar to Tanzanian Shilling Exchange Rate Using Comparable Time-Lags Inputs

  • Isakwisa Gaddy Tende Dar es Salaam Institute of Technology
Keywords: United States Dollar (USD), Tanzanian Shilling (TZS), Exchange Rate Prediction, Gated Recurrent Unit (GRU), Time-Lag, Deep Learning
Share Article:

Abstract

To import goods and services into the country, Tanzania relies on foreign currencies, specifically the United States Dollar (USD). Failure to timely predict accurate USD to TZS exchange rates may result in several problems, including failure to import into the country critical services and goods timely manner, losses in foreign exchange markets and bad decisions in investments. To address these challenges, this study has developed a Gated Recurrent Unit (GRU) Deep Learning model to predict the next day’s USD to TZS exchange rate (output) using three different inputs (time-lags) of previous days' exchange rates. This study has also developed a Web User Interface (UI) which is integrated with the developed GRU Deep Learning model. The Web UI receives the previous days' exchange rates entered by a user as inputs, predicts the next day’s exchange rate (output) and displays it to the user. The findings reveal that, 5-days time-lag (input) is the optimal (best performing) time-lag with a Mean Absolute Percentage Error (MAPE) score of 0.11%, followed by 10 days time-lag with a MAPE score of 0.20%  and 15 days time-lag with a MAPE score of 1.12%, suggesting that the shorter the time-lag (input), the better the performance of the GRU model in predicting the next day’s USD to TZS exchange rate (output). Therefore, this study recommends that Artificial Intelligence (AI) researchers and software developers use an optimal 5-day time-lag input when predicting the USD to TZS exchange rate using previous days' exchange rates using the GRU Deep Learning model. This study’s major contributions include an operational GRU model and Web User Interface (UI) for allowing users to predict daily USD to TZS exchange rates and a pre-processed 12-year-long daily USD to TZS exchange rates dataset ready and suitable for usage in AI research and software development activities

Downloads

Download data is not yet available.

References

Moussaoui, H. (2022). The impact of Exports and Imports on Economic Growth in Tanzania. Asian Journal of Management, Entrepreneurship and Social Science, 2(04), 150-160.

Bank of Tanzania [BoT]. (2025). External Sector Statistics, Total Imports of Goods and Services. Retrieved March 18, 2025, from https://www.bot.go.tz/Statistics/externalstatistics?code=EXS3&TypeOption=Imports&variableOption=Total%20imports%20of%20goods%20and%20services

Torres, J., Hadjout, D., Sebaa, A., Martínez-Álvarez, F., Troncoso, A. (2021). Deep learning for time series forecasting: a survey. Big data, 9(1), 3-21.

Wang, Y., Liao, W., Chang, Y. (2018). Gated recurrent unit network-based short-term photovoltaic forecasting. Energies, 11(8), 2163.

Hochreiter, S., Schmidhuber, J. (1997). Long short-term memory. Neural computation, 9, 1735–1780.

Chen, C., Xue, L., Xing, W. (2023). Research on Improved GRU-Based Stock Price Prediction Method. Applied Sciences, 13(15), 8813. DOI: https://doi.org/10.3390/app13158813

Dip Das, J., Thulasiram, R., Henry, C., Thavaneswaran, A. (2024). Encoder–Decoder Based LSTM and GRU Architectures for Stocks and Cryptocurrency Prediction. Journal of Risk and Financial Management, 17(5), 200. DOI: https://doi.org/10.3390/jrfm17050200

Hussain, B., Afzal, M., Ahmad, S., Mostafa, A. (2021). Intelligent traffic flow prediction using optimized GRU model. IEEE Access, 9, 100736-100746.

Kristiani, E., Lin, H., Lin, J., Chuang, Y., Huang, C., Yang, C. (2022). Short-Term Prediction of PM2.5 Using LSTM Deep Learning Methods. Sustainability, 14(4), 2068. DOI: https://doi.org/10.3390/su14042068

Zhang, Y., Zhou, Z., Van Griensven Thé, J., Yang, S., Gharabaghi, B. (2023). Flood Forecasting Using Hybrid LSTM and GRU Models with Lag Time Preprocessing. Water, 15(22), 3982. DOI: https://doi.org/10.3390/w15223982

Ren, Y., Zeng, S., Liu, J., Tang, Z., Hua, X., Li, Z., Song, J., Xia, J. (2022). Mid- to Long-Term Runoff Prediction Based on Deep Learning at Different Time Scales in the Upper Yangtze River Basin. Water, 14(11), 1692. DOI: https://doi.org/10.3390/w14111692

Caicedo-Vivas, J., Alfonso-Morales, W. (2023). Short-Term Load Forecasting Using an LSTM Neural Network for a Grid Operator. Energies, 16(23), 7878. DOI: https://doi.org/10.3390/en16237878

Bouktif, S., Fiaz, A., Ouni, A., Serhani, M. (2019). Single and Multi-Sequence Deep Learning Models for Short and Medium Term Electric Load Forecasting. Energies, 12(1), 149. DOI: https://doi.org/10.3390/en12010149

Yu, T., Wang, J. (2021). A Spatiotemporal Convolutional Gated Recurrent Unit Network for Mean Wave Period Field Forecasting. Journal of Marine Science and Engineering, 9(4), 383. DOI: https://doi.org/10.3390/jmse9040383

Riaz, A., Rahman, H., Arshad, M., Nabeel, M., Yasin, A., Al-Adhaileh, M., Eldin, E., Ghamry, N. (2022). Augmentation of Deep Learning Models for Multistep Traffic Speed Prediction. Applied Sciences, 12(19), 9723. DOI: https://doi.org/10.3390/app12199723

Investing. (2025). USD/TZS - US Dollar Tanzanian Shilling, USD/TZS Historical Data. Retrieved March 20, 2025 from https://www.investing.com/currencies/usd-tzs-historical-data

Bezerra, F., Oliveira Neto, G., Cervi, G., Francesconi Mazetto, R., Faria, A., Vido, M., Lima, G., Araújo, S., Sampaio, M., Amorim, M. (2024). Impacts of Feature Selection on Predicting Machine Failures by Machine Learning Algorithms. Applied Sciences, 14(8), 3337. DOI: https://doi.org/10.3390/app14083337

Liu, C., Zhang, A., Xue, J., Lei, C., Zeng, X. (2023). LSTM-Pearson Gas Concentration Prediction Model Feature Selection and Its Applications. Energies, 16(5), 2318. DOI: https://doi.org/10.3390/en16052318

Ferreira, R., Canesche, M., Jamieson, P., Neto, O., Nacif, J. A. (2024). Examples and tutorials on using Google Colab and Gradio to create online interactive student‐learning modules. Computer Applications in Engineering Education, 32(4), e22729. DOI: https://doi.org/10.1002/cae.22729

Bisong, E. (2019). Google colaboratory. In Building machine learning and deep learning models on google cloud platform: a comprehensive guide for beginners. Berkeley, CA: Apress.

Published
9 May, 2025
How to Cite
Tende, I. (2025). Development of GRU Deep Learning Model for Predicting Daily United States Dollar to Tanzanian Shilling Exchange Rate Using Comparable Time-Lags Inputs. International Journal of Advanced Research, 8(1), 186-199. https://doi.org/10.37284/ijar.8.1.2977