Comparison Of Long Short-Term Memory and Gated Recurrent Unit Methods with RMSProp Optimization in Forecasting Stock Closing Prices
DOI:
https://doi.org/10.15294/ujm.v14i2.28271Keywords:
Forecasting, Long Short Term Memory, Gated Recurrent UnitAbstract
Retail sector stocks are one of the key indicators supporting consumer growth. PT Sumber Alfaria Trijaya Tbk, as the operator of the Alfamart minimarket chain, is one of the leading retail issuers on the Indonesia Stock Exchange, listed in the LQ45 index with a Return on Equity (ROE) of 23.5%. The seasonal, volatile, and macroeconomic-sensitive nature of retail stocks makes them difficult to predict using conventional methods. This study aims to compare the performance of the Long Short-Term Memory (LSTM) and Gated Recurrent Unit (GRU) methods with RMSprop optimization in forecasting the closing price of PT Sumber Alfaria Trijaya Tbk shares. The data used consists of daily stock prices from January 2, 2020, to December 30, 2024. Evaluation was conducted using the RMSE and MAPE metrics. The results of the study indicate that the optimal architecture for LSTM is achieved with a combination of a time step of 60, batch size of 8, units of 100, and epochs of 50, yielding an RMSE of 56.948 and a MAPE of 1.409%. Meanwhile, GRU showed better performance at a time step of 30, batch size of 8, units of 50, and epoch of 150 with an RMSE of 52.689 and MAPE of 1.343%. Thus, GRU with RMSprop optimization is considered more effective in capturing dynamic and nonlinear patterns.