Application of Recurrent Neural Network Bi-Long Short-Term Memory, Gated Recurrent Unit and Bi-Gated Recurrent Unit for Forecasting Rupiah Against Dollar (USD) Exchange Rate
DOI:
https://doi.org/10.57152/predatecs.v2i1.1094Keywords:
Bi-LSTM, Bi-GRU, Foreign Exchange Rate, Gated Recurrent Unit, PredictionAbstract
Foreign exchange rates have a crucial role in a country's economic development, influencing long-term investment decisions. This research aims to forecast the exchange rate of Rupiah to the United States Dollar (USD) by using deep learning models of Recurrent Neural Network (RNN) architecture, especially Bi-Long Short-Term Memory (Bi-LSTM), Gated Recurrent Unit (GRU), and Bi-Gated Recurrent Unit (Bi-GRU). Historical daily exchange rate data from January 1, 2013 to November 3, 2023, obtained from Yahoo Finance, was used as the dataset. The model training and evaluation process was performed based on various parameters such as optimizer, batch size, and time step. The best model was identified by minimizing the Mean Square Error (MSE), Root Mean Square Error (RMSE), Mean Absolute Error (MAE), and Mean Absolute Percentage Error (MAPE). Among the models tested, the GRU model with Nadam optimizer, batch size 16, and timestep 30 showed the best performance, with MSE 3741.6999, RMSE 61.1694, MAE 45.6246, and MAPE 0.3054%. The forecast results indicate a strengthening trend of the Rupiah exchange rate against the USD in the next 30 days, which has the potential to be taken into consideration in making investment decisions and shows promising economic growth prospects for Indonesia.
References
S. Naeem et al., “Machine Learning-based USD/PKR Exchange Rate Forecasting Using Sentiment Analysis of Twitter Data,” Computers, Materials and Continua, vol. 67, no. 3, pp. 3451–3461, 2021, doi: 10.32604/cmc.2021.015872.
F. Morina, E. Hysa, U. Ergün, M. Panait, and M. C. Voica, “The Effect of Exchange Rate Volatility on Economic Growth: Case of the CEE Countries,” Journal of Risk and Financial Management, vol. 13, no. 8, 2020, doi: 10.3390/jrfm13080177.
E. Boz et al., “Patterns of invoicing currency in global trade: New evidence,” J Int Econ, vol. 136, May 2022, doi: 10.1016/j.jinteco.2022.103604.
U. A. Sheikh, M. Asad, Z. Ahmed, and U. Mukhtar, “Asymmetrical relationship between oil prices, gold prices, exchange rate, and stock prices during global financial crisis 2008: Evidence from Pakistan,” Cogent Economics & Finance, vol. 8, no. 1, p. 1757802, Jan. 2020, doi: 10.1080/23322039.2020.1757802.
B. J. Liyanapathirana and R. P. K. C. M. Ranasinghe, “Stock Market Measures and Market Performance,” Journal of Economic Science Research, vol. 3, no. 2, pp. 31–37, 2020, doi: 10.30564/jesr.v3i2.1672.
P. F. Marschner and P. S. Ceretta, “Investor sentiment, economic uncertainty, and monetary policy in Brazi,” Revista Contabilidade e Financas, vol. 32, no. 87, pp. 528–540, 2021, doi: 10.1590/1808-057X202113220.
J. Wang, X. Wang, J. Li, and H. Wang, “A Prediction Model of CNN-TLSTM for USD/CNY Exchange Rate Prediction,” IEEE Access, vol. 9, pp. 73346–73354, 2021, doi: 10.1109/ACCESS.2021.3080459.
Nurhayati, F. Mintarsih, M. A. Rasyidi, W. Nurjannah, D. Khairani, and H. T. Sukmana, “LSTM Variants Comparison for Exchange Rate IDR/USD Forecasting with Rolling Window Cross Validation,” in 2023 Eighth International Conference on Informatics and Computing (ICIC), 2023, pp. 1–4. doi: 10.1109/ICIC60109.2023.10382094.
Z. Hu, Y. Zhao, and M. Khushi, “A survey of forex and stock price prediction using deep learning,” Applied System Innovation, vol. 4, no. 1, pp. 1–30, Mar. 2021, doi: 10.3390/ASI4010009.
G. Ma, P. Chen, Z. Liu, and J. Liu, “The Prediction of Enterprise Stock Change Trend by Deep Neural Network Model,” Comput Intell Neurosci, vol. 2022, 2022, doi: 10.1155/2022/9193055.
R. M. Roldán, M. R. Miranda, and V. G. Salcido, “Neuro-wavelet Model for price prediction in high-frequency data in the Mexican Stock market,” Revista Mexicana de Economia y Finanzas Nueva Epoca, vol. 17, no. 1, pp. 1–23, 2022, doi: 10.21919/remef.v17i1.570.
S. Hansun, F. P. Putri, A. Q. M. Khaliq, and H. Hugeng, “On searching the best mode for forex forecasting: bidirectional long short-term memory default mode is not enough,” IAES International Journal of Artificial Intelligence, vol. 11, no. 4, pp. 1596–1606, Dec. 2022, doi: 10.11591/ijai.v11.i4.pp1596-1606.
A. S. Saud and S. Shakya, “Analysis of look back period for stock price prediction with RNN variants: A case study on banking sector of NEPSE,” in Procedia Computer Science, Elsevier B.V., 2020, pp. 788–798. doi: 10.1016/j.procs.2020.03.419.
M. E. Karim and S. Ahmed, “A Deep Learning-Based Approach for Stock Price Prediction Using Bidirectional Gated Recurrent Unit and Bidirectional Long Short Term Memory Model,” in 2021 2nd Global Conference for Advancement in Technology (GCAT), 2021, pp. 1–8. doi: 10.1109/GCAT52182.2021.9587895.
R. Guanoluisa, D. Arcos-Aviles, M. Flores-Calero, W. Martinez, and F. Guinjoan, “Photovoltaic Power Forecast Using Deep Learning Techniques with Hyperparameters Based on Bayesian Optimization: A Case Study in the Galapagos Islands,” Sustainability (Switzerland), vol. 15, no. 16, 2023, doi: 10.3390/su151612151.
S. B. Primananda and S. M. Isa, “Forecasting Gold Price in Rupiah using Multivariate Analysis with LSTM and GRU Neural Networks,” Advances in Science, Technology and Engineering Systems Journal, vol. 6, no. 2, pp. 245–253, 2021, doi: 10.25046/aj060227.
H. S. Shin and J. K. Hong, “Performance Analysis of a Chunk-Based Speech Emotion Recognition Model Using RNN,” Intelligent Automation and Soft Computing, vol. 36, no. 1, pp. 235–248, 2023, doi: 10.32604/iasc.2023.033082.
R. S. Pontoh, S. Zahroh, and N. Sunengsih, “New normal policy on the Rupiah exchange rate using Long Short-Term Memory,” J Phys Conf Ser, vol. 1863, no. 1, 2021, doi: 10.1088/1742-6596/1863/1/012063.
M. S. Islam and E. Hossain, “Foreign exchange currency rate prediction using a GRU-LSTM hybrid network,” Soft Computing Letters, vol. 3, p. 100009, Dec. 2021, doi: 10.1016/j.socl.2020.100009.
D. H. D. Nguyen, L. P. Tran, and V. Nguyen, “Predicting Stock Prices Using Dynamic LSTM Models,” in Applied Informatics: Second International Conference, ICAI 2019, Madrid, Spain, November 7–9, 2019, Proceedings 2, Springer, 2019, pp. 199–212. doi: 10.1007/978-3-030-32475-9_15.
G. Ding and L. Qin, “Study on the prediction of stock price based on the associated network model of LSTM,” International Journal of Machine Learning and Cybernetics, vol. 11, no. 6, pp. 1307–1317, 2020, doi: 10.1007/s13042-019-01041-1.
C. Bormpotsis, M. Sedky, and A. Patel, “Predicting Forex Currency Fluctuations Using a Novel Bio-Inspired Modular Neural Network,” Big Data and Cognitive Computing, vol. 7, no. 3, p. 152, 2023, doi: 10.3390/bdcc7030152.
P. Maneejuk and W. Srichaikul, “Forecasting foreign exchange markets: further evidence using machine learning models,” Soft comput, vol. 25, no. 12, pp. 7887–7898, 2021, doi: 10.1007/s00500-021-05830-1.
N. R. Pokhrel et al., “Predicting NEPSE index price using deep learning models,” Machine Learning with Applications, vol. 9, p. 100385, 2022, doi: https://doi.org/10.1016/j.mlwa.2022.100385.
K. A. Althelaya, E.-S. M. El-Alfy, and S. Mohammed, “Evaluation of bidirectional LSTM for short-and long-term stock market prediction,” in 2018 9th International Conference on Information and Communication Systems (ICICS), 2018, pp. 151–156. doi: 10.1109/IACS.2018.8355458.
S. Liang, D. Wang, J. Wu, R. Wang, and R. Wang, “Method of bidirectional lstm modelling for the atmospheric temperature,” Intelligent Automation and Soft Computing, vol. 30, no. 2, pp. 701–714, 2021, doi: 10.32604/iasc.2021.020010.
H. Zhao, C. Hou, H. Alrobassy, and X. Zeng, “Recognition of Transportation State by Smartphone Sensors Using Deep Bi-LSTM Neural Network,” Journal of Computer Networks and Communications, vol. 2019, 2019, doi: 10.1155/2019/4967261.
F. Shahid, A. Zameer, and M. Muneeb, “Predictions for COVID-19 with deep learning models of LSTM, GRU and Bi-LSTM,” Chaos Solitons Fractals, vol. 140, p. 110212, 2020, doi: 10.1016/j.chaos.2020.110212.
R. K. Dewi, B. Tantular, J. Suprijadi, and A. Apriliyanti, “Analisis Sentimen Ulasan Pengguna Aplikasi E-Samsat Provinsi Jawa Barat Menggunakan Metode BiGRU,” vol. 3862, pp. 1–8, 2023, doi: 10.12962/j27213862.v1i1.19113.
Z. Zhang et al., “An Improved Bidirectional Gated Recurrent Unit Method for Accurate State-of-Charge Estimation,” IEEE Access, vol. 9, pp. 11252–11263, 2021, doi: 10.1109/ACCESS.2021.3049944.
S. Aryal, D. Nadarajah, D. Kasthurirathna, L. Rupasinghe, and C. Jayawardena, “Comparative analysis of the application of Deep Learning techniques for Forex Rate prediction,” in 2019 International Conference on Advancements in Computing, ICAC 2019, Institute of Electrical and Electronics Engineers Inc., Dec. 2019, pp. 329–333. doi: 10.1109/ICAC49085.2019.9103428.
J. S. Chou and T. T. H. Truong, “Sliding-window metaheuristic optimization-based forecast system for foreign exchange analysis,” Soft comput, vol. 23, no. 10, pp. 3545–3561, May 2019, doi: 10.1007/s00500-019-03863-1.
N. Malibari, I. Katib, and R. Mehmood, “Predicting Stock Closing Prices in Emerging Markets with Transformer Neural Networks: The Saudi Stock Exchange Case,” IJACSA) International Journal of Advanced Computer Science and Applications, vol. 12, no. 12, p. 2021, doi: 10.14569/IJACSA.2021.01212106.
D. Choi, C. J. Shallue, Z. Nado, J. Lee, C. J. Maddison, and G. E. Dahl, “On Empirical Comparisons of Optimizers for Deep Learning,” arXiv preprint arXiv:1910.05446, 2019, doi: 10.48550/arXiv.1910.05446.
I. Loshchilov and F. Hutter, “Decoupled weight decay regularization,” arXiv preprint arXiv:1711.05101, 2017, doi: 10.48550/arXiv.1711.05101.
Z. Zhuang, M. Liu, A. Cutkosky, and F. Orabona, “Understanding adamw through proximal methods and scale-freeness,” arXiv preprint arXiv:2202.00089, 2022, doi: 10.48550/arXiv.2202.00089.
D. Soydaner, “A Comparison of Optimization Algorithms for Deep Learning,” Intern J Pattern Recognit Artif Intell, vol. 34, no. 13, Dec. 2020, doi: 10.1142/S0218001420520138.
N. Maaroufi, M. Najib, and M. Bakhouya, “Predicting the Future is like Completing a Painting: Towards a Novel Method for Time-Series Forecasting,” IEEE Access, vol. 9, pp. 119918–119938, 2021, doi: 10.1109/ACCESS.2021.3101718.
N. W. Azani, C. P. Trisya, L. M. Sari, H. Handayani, and M. R. M. Alhamid, “Performance Comparison of ARIMA, LSTM and SVM Models for Electric Energy Consumption Analysis,” Public Research Journal of Engineering, Data Technology and Computer Science, vol. 1, no. 2, Feb. 2024, doi: 10.57152/predatecs.v1i2.869.
N. T. Luchia, E. Tasia, I. Ramadhani, A. Rahmadeyan, and R. Zahra, “Performance Comparison Between Artificial Neural Network, Recurrent Neural Network and Long Short-Term Memory for Prediction of Extreme Climate Change,” Public Research Journal of Engineering, Data Technology and Computer Science, vol. 1, no. 2, pp. 62–70, Feb. 2024, doi: 10.57152/predatecs.v1i2.864.
A. A. Salisu and X. V. Vo, “The behavior of exchange rate and stock returns in high and low interest rate environments,” International Review of Economics and Finance, vol. 74, pp. 138–149, Jul. 2021, doi: 10.1016/j.iref.2021.02.008.
R. Gunawan and A. Bawono, “The Effect of Inflation, Rupiah Exchange Rate, Interest Rate, Money Supply, Industry Production Index, Dow Jones Islamic Market Index in Malaysia and Japan on ISSI,” Annual International Conference on Islamic Economics and Business (AICIEB), vol. 1, no. 0, Dec. 2021, doi: https://doi.org/10.18326/aicieb.v1i0.12.
Haudi, H. Wijoyo, and Y. Cahyono, “Analysis of Most Influential Factors to Attract Foreign Investment,” Journal of Critical Reviews, vol. 7, no. 13, pp. 4128–4135, 2020, doi: 10.31838/jcr.07.13.627.
M. Fernandez, M. M. Almaazmi, and R. Joseph, “FOREIGN DIRECT INVESTMENT IN INDONESIA: AN ANALYSIS FROM INVESTORS PERSPECTIVE,” International Journal of Economics and Financial Issues, vol. 10, no. 5, pp. 102–112, Sep. 2020, doi: 10.32479/ijefi.10330.
Rosyadi, P. J. Hutagaol, and W. Putra, “The Effect of External Debt, Net Exports on Exchange Rates and Indonesia’s Economic Growth,” International Journal of Multidisciplinary Research and Analysis, vol. 05, no. 07, Jul. 2022, doi: 10.47191/ijmra/v5-i7-21.