Perbandingan Algoritma LSTM, Bi-LSTM, GRU, dan Bi-GRU untuk Prediksi Harga Saham Berbasis Deep Learning


  • Muthia Tshamaroh * Mail Universitas Islam Negeri Sultan Syarif Kasim Riau, Pekanbaru, Indonesia
  • Inggih Permana Universitas Islam Negeri Sultan Syarif Kasim Riau, Pekanbaru, Indonesia
  • Febi Nur Salisah Universitas Islam Negeri Sultan Syarif Kasim Riau, Pekanbaru, Indonesia
  • Fitriani Muttakin Universitas Islam Negeri Sultan Syarif Kasim Riau, Pekanbaru, Indonesia
  • M Afdal Universitas Islam Negeri Sultan Syarif Kasim Riau, Pekanbaru, Indonesia
  • (*) Corresponding Author
Keywords: Stock Price Prediction; Deep Learning; LSTM; GRU; Bi-GRU; Bi-LSTM

Abstract

Stock price prediction is an important component in making investment decisions. This study aims to compare the performance of four deep learning models, namely LSTM, Bi-LSTM, GRU, and Bi-GRU, in predicting stock prices, in order to find the most optimal model for the implementation of an accurate stock price prediction system. Five years of historical data undergoes normalization, windowing, and is separated into training data, validation data, and test data. Model training is conducted with different settings of batch size, timestep, and three kinds of optimizers (Adam, SGD, RMSprop). Performance assessment employs MSE, RMSE, MAE, and R² measurements. The findings indicate that the Bi-GRU model utilizing Adam optimizer settings, a batch size of 8, and a timestep of 21 yields the highest performance, achieving an MSE of 0.0003, an RMSE of 0.0169, an MAE of 0.0129, and an R² of 0.9438. This model demonstrates a strong capability to identify intricate patterns and long-term temporal relationships, outperforming other models in accuracy. The results advocate for the establishment of a predictive system that aids investors and firms in making strategic decisions based on data.

Downloads

Download data is not yet available.

References

W. Hastomo, A. S. B. Karno, N. Kalbuana, E. Nisfiani, and L. ETP, “Optimasi Deep Learning untuk Prediksi Saham di Masa Pandemi Covid-19,” J. Edukasi dan Penelit. Inform., vol. 7, no. 2, p. 133, 2021, doi: 10.26418/jp.v7i2.47411.

R. Moerdianto, A. S. U. Anto, Y. P. Gazali, Kartini, and Y. Rura, “Pengaruh Return On Asset Dan Earning Per Share Terhadap Harga Saham Perusahaan Sektor Energi Yang Terdaftar Di Bursa Efek Indonesia.,” J. Ekon. Dan Bisnis, vol. 11, no. 4, pp. 251–259, 2022, doi: 10.34308/eqien.v11i04.1237.

S. Kusmawaningsih, R. Saputri, and A. Khoirudin, “Analisis Harga Saham Dalam Perspektif Ekonomi Islam,” J. Iqtishaduna Econ. Doctrin., vol. 6, no. 1, pp. 7–14, 2023, doi: 10.53888/iqtishaduna.v6i1.651.

M. R. Wijaya, “Inovasi Model Intrusion Detection System ( IDS ) menggunakan Double Layer Gated Recurrent Unit ( GRU ) dengan Fitur Berbasis Fusion,” J. Ilm. Edutic, vol. 12, no. 1, pp. 10–21, 2025, doi: 10.21107/edutic.v12i1.28822.

D. Sawitri, “Peran Deep Learning Dan Big Data Dalam Mendekteksi Masalah Peran Deep Learning Dan Big Data Dalam Mendekteksi Masalah Keuangan,” J. Teknol. Inf., vol. 6, no. April, 2025, doi: 10.46576/djtechno.

H. Hartini and D. Marhandrie, “Pengaruh Profitabilitas, Risiko Finansial dan Harga Saham Terhadap Nilai Perusahaan Bank Syariah Indonesia (BSI) Di BEI Periode Tahun 2014 - 2021,” J. Ilm. Ekotrans Erud., vol. 2, no. 1, pp. 104–111, 2022, doi: 10.69989/9wgz3f07.

Isra Miraltamirus, Fadhilah Fitri, Dodi Vionanda, and Dony Permana, “Prediksi Harga Saham PT Bank Syariah Indonesia Tbk Menggunakan Support Vector Regression,” UNP J. Stat. Data Sci., vol. 1, no. 3, pp. 112–119, 2023, doi: 10.24036/ujsds/vol1-iss3/43.

Y. Sujatna et al., “Stacked LSTM-GRU Long-Term Forecasting Model for Indonesian Islamic Banks,” Knowl. Eng. Data Sci., vol. 6, no. 2, p. 215, 2023, doi: 10.17977/um018v6i22023p215-250.

P. L. Seabe, C. Rodrigue, B. Moutsinga, and E. Pindza, “Forecasting Cryptocurrency Prices Using LSTM, GRU, and Bi-Directional LSTM: A Deep Learning Approach,” Fractal Fract, vol. 7, no. 2, pp. 1–18, 2023, doi: 10.3390/fractalfract7020203.

M. Mushliha, “Implementasi CNN-BiLSTM untuk Prediksi Harga Saham Bank Syariah di Indonesia,” Jambura J. Math., vol. 6, no. 2, pp. 195–203, 2024, doi: 10.37905/jjom.v6i2.26509.

N. M. Tuan, “Machine Learning Performance on Predicting Banking Term Deposit,” Int. Conf. Enterp. Inf. Syst. ICEIS - Proc., vol. 1, no. April 2022, pp. 267–272, 2022, doi: 10.5220/0011096600003179.

Khalis Sofi, Aswan Supriyadi Sunge, Sasmitoh Rahmad Riady, and Antika Zahrotul Kamalia, “Perbandingan Algoritma Linear Regression, Lstm, Dan Gru Dalam Memprediksi Harga Saham Dengan Model Time Series,” Seminastika, vol. 3, no. 1, pp. 39–46, 2021, doi: 10.47002/seminastika.v3i1.275.

M. R. Luthfi and R. D. Syah, “Model Deep Learning Untuk Analisis Prediksi Harga Saham Menggunakan Metode Long Short-Term Memory (Lstm),” J. Ilm. Ekon. Bisnis, pp. 201–213, 2025, doi: 10.35760/eb.2025.v30i1.11870 201.

F. Ramadhan and J. Hernadi, “Evaluasi optimizer adam dan rmsprop pada arsitektur vgg-19 klasifikasi ekspresi wajah manusia,” JIPI (Jurnal Ilm. Penelit. dan Pembelajaran Inform., vol. 10, no. 2, pp. 1414–1426, 2025, doi: 10.29100/jipi.v10i2.6197.

Yahoo Finance, “BRIS.JK - Bank Syariah Indonesia Tbk.” Accessed: May 13, 2025. [Online]. Available: https://finance.yahoo.com/quote/BRIS.JK/

R. S. Andromeda, N. Anisa, and S. Winarsih, “Perbandingan Kinerja Metode LSTM dan GRU dalam Prediksi Harga Close Cryptocurrency Performance Comparison of LSTM and GRU Methods in Predicting Cryptocurrency Closing Prices,” J. Sist. Inf., vol. 14, pp. 366–379, 2025, doi: 10.32520/stmsi.v14i1.4880.

Galih Adhi Putratama, Satya Maulana Fahreza, and Yudhistira Rakha Ramandhani, “Evaluasi Komparatif Metode Machine Learning Untuk Memprediksi Perubahan Harga Saham,” Antivirus J. Ilm. Tek. Inform., vol. 17, no. 2, pp. 278–285, 2024, doi: 10.35457/antivirus.v17i2.2871.

E. Koo and G. Kim, “Prediction of Bitcoin price based on manipulating distribution strategy,” Elsevier, vol. 110, 2021, doi: 10.1016/j.asoc.2021.107738.

A. Foresta et al., “Heart Beat Prediction Based on Lstm Model on Raspberry Pi,” J. Teknol. Inf., vol. 10, no. 7, pp. 1555–1562, 2023, doi: 10.25126/jtiik.2024118015.

R. Erzitha, D. Novaliendry, and K. Budayawan, “Analysis Of Dropout And Learning Rate On Bilstm- Ann Performance In Hate Speech Detection,” Lentera:MultidisciplinaryStudies, vol. 3, no. 2, pp. 221–232, 2025, doi: 10.57096/lentera.v3i2.142.

N. N. Aung, J. Pang, M. C. H. Chua, and H. X. Tan, “A novel bidirectional LSTM deep learning approach for COVID-19 forecasting,” Sci. Rep., vol. 13, no. 1, pp. 1–11, 2023, doi: 10.1038/s41598-023-44924-8.

P. Singla, M. Duhan, and S. Saroha, “An ensemble method to forecast 24-h ahead solar irradiance using wavelet decomposition and BiLSTM deep learning network,” Earth Sci. Informatics, vol. 15, no. 1, pp. 291–306, 2022, doi: 10.1007/s12145-021-00723-1.

M. N. Taukid, Y. V. Via, and E. Y. Puspaningrum, “Implementasi Bilstm Dan Cuckoo Search Optimization Pada Aplikasi Prediksi Harga Emas Antam,” JATI (Jurnal Mhs. Tek. Inform., vol. 9, no. 3, 2025, doi: 10.36040/jati.v9i3.14310.

K. E. ArunKumar, D. V. Kalaga, C. M. S. Kumar, M. Kawaji, and T. M. Brenza, “Forecasting of COVID-19 using deep layer Recurrent Neural Networks (RNNs) with Gated Recurrent Units (GRUs) and Long Short-Term Memory (LSTM) cells,” Chaos, Solitons and Fractals, vol. 146, p. 110861, 2021, doi: 10.1016/j.chaos.2021.110861.

F. Meng, T. Song, X. Danya, P. Xie, and Y. Li, “Forecasting tropical cyclones wave height using bidirectional gated recurrent unit,” Ocean Eng., vol. 234, 2021, doi: 10.1016/j.oceaneng.2021.108795.

L. D. Soares, A. de S. Queiroz, G. P. López, E. M. Carreño-Franco, J. M. López-Lezama, and N. Muñoz-Galeano, “BiGRU-CNN Neural Network Applied to Electric Energy Theft Detection,” Electron., vol. 11, no. 5, pp. 1–13, 2022, doi: 10.3390/electronics11050693.

D. Chicco, M. J. Warrens, and G. Jurman, “The coefficient of determination R-squared is more informative than SMAPE, MAE, MAPE, MSE and RMSE in regression analysis evaluation,” PeerJ Comput. Sci., vol. 7, pp. 1–24, 2021, doi: 10.7717/PEERJ-CS.623.


Bila bermanfaat silahkan share artikel ini

Berikan Komentar Anda terhadap artikel Perbandingan Algoritma LSTM, Bi-LSTM, GRU, dan Bi-GRU untuk Prediksi Harga Saham Berbasis Deep Learning

Dimensions Badge
Article History
Submitted: 2025-04-30
Published: 2025-06-01
Abstract View: 43 times
PDF Download: 20 times
How to Cite
Tshamaroh, M., Permana, I., Salisah, F., Muttakin, F., & Afdal, M. (2025). Perbandingan Algoritma LSTM, Bi-LSTM, GRU, dan Bi-GRU untuk Prediksi Harga Saham Berbasis Deep Learning. Building of Informatics, Technology and Science (BITS), 7(1), 191-200. https://doi.org/10.47065/bits.v7i1.7252
Section
Articles

Most read articles by the same author(s)

1 2 3 > >>