Unnes Journal of Mathematics
Vol. 14 No. 2 (2025): Unnes Journal of Mathematics Volume 2, 2025

Comparison Of Long Short-Term Memory and Gated Recurrent Unit Methods with RMSProp Optimization in Forecasting Stock Closing Prices

Rani Anggraini (Universitas Negeri Semarang)
Arief Agoestanto (Universitas Negeri Semarang)



Article Info

Publish Date
21 Oct 2026

Abstract

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.

Copyrights © 2025






Journal Info

Abbrev

ujm

Publisher

Subject

Education Mathematics

Description

Unnes Journal of Mathematics is published by Universitas Negeri Semarang. This Journal receives and publishes research articles and development in mathematics theories and their ...