Stock Price Prediction Using Long Short-Term Memory (LSTM) and Gated Recurrent Unit (GRU) Methods

  • Riza Akhsani Setyo Prayoga Universitas Negeri Surabaya
  • Fery Almas Ariansyah Universitas Pembangunan Nasional Veteran, Jawa Timur, Surabaya, Indonesia
  • Muhammad Falikhuddin Daffa Universitas Pembangunan Nasional Veteran, Jawa Timur, Surabaya, Indonesia
  • Laqma Dica Fitrani Universitas Pembangunan Nasional Veteran Jawa Timur
  • Masti Fatchiyah Maharani Universitas Pembangunan Nasional “Veteran” Jawa Timur
  • Angga Lisdiyanto Universitas Pembangunan Nasional “Veteran” Jawa Timur
  • Steven Angkawidjaja Universitas Pembangunan Nasional Veteran, Jawa Timur, Surabaya, Indonesia
Keywords: Stock Price Prediction, LSTM, GRU

Abstract

This research aims to improve the accuracy of stock price prediction through the application of Long Short-Term Memory (LSTM) and Gated Recurrent Unit (GRU) methods, focusing on stocks from the Composite Stock Price Index (CSPI) referred to as the IDX Composite. The research process includes comprehensive steps, including data collection and preprocessing, dataset creation with emphasis on stock closing prices, and division of the dataset into training and test data. The LSTM and GRU models were designed with a recurrent layer and a Dense layer and then trained for 100 epochs with a batch size of 32. Model evaluation was performed by comparing key metrics such as Root Mean Squared Error (RMSE), Mean Squared Error (MSE), and Mean Absolute Error (MAE) on the test set. The EPOCH-RMSE graph provides an overview of the changes in the RMSE value during training. The best result of the LSTM model was achieved at the 96th epoch with RMSE 40.36, MSE 1385.97, and MAE 30.09, while GRU achieved peak performance at the 92nd epoch with RMSE 37.33, MSE 908.29, and MAE 25.42. In conclusion, GRU can be considered as a more effective option in predicting JCI stock prices based on performance evaluation using various metrics such as RMSE, MSE, and MAE.

Published
2025-11-05
How to Cite
Riza Akhsani Setyo Prayoga, Ariansyah, F. A., Daffa, M. F., Laqma Dica Fitrani, Masti Fatchiyah Maharani, Angga Lisdiyanto, & Angkawidjaja , S. (2025). Stock Price Prediction Using Long Short-Term Memory (LSTM) and Gated Recurrent Unit (GRU) Methods. IJCONSIST JOURNALS, 7(1), 7-16. https://doi.org/10.33005/ijconsist.v7i1.158
Section
Articles