Hyperparameter-Tuned Stacked LSTM for Time-Series Forecasting of ANTMStock Prices

Authors

  • Dwi Puspita Anggraeni Teknik Informatika, Fakultas Teknologi Informasi, Universitas Budi Luhur

Keywords:

Long Short-Term Memory; Hyperparameter Optimization; Stock Price Forecasting; Time Series

Abstract

Stock price forecasting remains challenging because financial time-series data exhibit dynamic and nonlinear price movements. Although recent studies increasingly employ hybrid and attention-based deep learning architectures, the empirical evaluation of selected training and regularization hyperparameters in standalone LSTM models for individual Indonesian equities remains limited. This study aims to develop and evaluate a Long Short-Term Memory (LSTM) model with systematic hyperparameter tuning for ANTM stock price forecasting. A quantitative time-series approach was applied to 3,051 daily observations of ANTM stock prices obtained from Yahoo Finance from January 1, 2014, to June 6, 2026, using open, high, low, and close (OHLC) variables. The model consists of three LSTM layers with dropout and a dense output layer, while Grid Search was used to evaluate combinations of batch size and dropout rate. Model performance was assessed using MAPE, RMSE, and R². The best configuration, with a batch size of 32 and dropout rate of 0.3, achieved a validation loss of 0.000617. On the testing data, the model obtained a MAPE of 6.62%, RMSE of 257.40, and R² of 0.9351. The resulting model was further used to generate a 12-month point forecast, which indicated a gradual downward trajectory from Rp3,117.31 in June 2026 to Rp2,820.05 in May 2027. The findings provide empirical evidence on the performance of a systematically tuned standalone LSTM for ANTM stock price forecasting and highlight the importance of configuration selection in financial time-series modelling.

References

M. M. Kumbure, C. Lohrmann, P. Luukka, and J. Porras, “Machine learning techniques and data for stock market forecasting: A literature review,” Expert Systems with Applications, vol. 197, p. 116659, 2022, doi: 10.1016/j.eswa.2022.116659.

O. B. Sezer, M. U. Gudelek, and A. M. Ozbayoglu, “Financial time series forecasting with deep learning: A systematic literature review: 2005–2019,” Applied Soft Computing, vol. 90, p. 106181, 2020, doi: 10.1016/j.asoc.2020.106181.

W. Chen, W. Hussain, F. Cauteruccio, and X. Zhang, “Deep learning for financial time series prediction: A state-of-the-art review of standalone and hybrid models,” Computer Modeling in Engineering & Sciences, vol. 139, no. 1, pp. 187–224, 2024, doi: 10.32604/cmes.2023.031388.

J. Qiu, B. Wang, and C. Zhou, “Forecasting stock prices with long-short term memory neural network based on attention mechanism,” PLoS ONE, vol. 15, no. 1, p. e0227222, 2020, doi: 10.1371/journal.pone.0227222.

S. Hochreiter and J. Schmidhuber, “Long short-term memory,” Neural Computation, vol. 9, no. 8, pp. 1735–1780, 1997, doi: 10.1162/neco.1997.9.8.1735.

T. Kim and H. Y. Kim, “Forecasting stock prices with a feature fusion LSTM-CNN model using different representations of the same data,” PLoS ONE, vol. 14, no. 2, p. e0212320, 2019, doi: 10.1371/journal.pone.0212320.

W. Bao, J. Yue, and Y. Rao, “A deep learning framework for financial time series using stacked autoencoders and long-short term memory,” PLoS ONE, vol. 12, no. 7, p. e0180944, 2017, doi: 10.1371/journal.pone.0180944.

W. Budiharto, “Data science approach to stock prices forecasting in Indonesia during Covid-19 using Long Short-Term Memory (LSTM),” Journal of Big Data, vol. 8, p. 47, 2021, doi: 10.1186/s40537-021-00430-0.

J. Shen and M. O. Shafiq, “Short-term stock market price trend prediction using a comprehensive deep learning system,” Journal of Big Data, vol. 7, p. 66, 2020, doi: 10.1186/s40537-020-00333-6.

A. Lawi, H. Mesra, and S. Amir, “Implementation of Long Short-Term Memory and Gated Recurrent Units on grouped time-series data to predict stock prices accurately,” Journal of Big Data, vol. 9, p. 89, 2022, doi: 10.1186/s40537-022-00597-0.

C. Stoean, W. Paja, R. Stoean, and A. Sandita, “Deep architectures for long-term stock price prediction with a heuristic-based strategy for trading simulations,” PLoS ONE, vol. 14, no. 10, p. e0223593, 2019, doi: 10.1371/journal.pone.0223593.

N. Srivastava, G. Hinton, A. Krizhevsky, I. Sutskever, and R. Salakhutdinov, “Dropout: A simple way to prevent neural networks from overfitting,” Journal of Machine Learning Research, vol. 15, no. 56, pp. 1929–1958, 2014.

J. Bergstra and Y. Bengio, “Random search for hyper-parameter optimization,” Journal of Machine Learning Research, vol. 13, pp. 281–305, 2012.

J. Snoek, H. Larochelle, and R. P. Adams, “Practical Bayesian optimization of machine learning algorithms,” in Advances in Neural Information Processing Systems, vol. 25, 2012, pp. 2951–2959.

Y. Li, H. Bu, J. Li, and J. Wu, “The role of text-extracted investor sentiment in Chinese stock price prediction with the enhancement of deep learning,” International Journal of Forecasting, vol. 36, no. 4, pp. 1541–1562, 2020, doi: 10.1016/j.ijforecast.2020.05.001.

K. R. Dahal, N. R. Pokhrel, S. Gaire, S. Mahatara, R. P. Joshi, A. Gupta, H. R. Banjade, and J. Joshi, “A comparative study on effect of news sentiment on stock price prediction with deep learning architecture,” PLoS ONE, vol. 18, no. 4, p. e0284695, 2023, doi: 10.1371/journal.pone.0284695.

X. Wei, H. Ouyang, and M. Liu, “Stock index trend prediction based on TabNet feature selection and long short-term memory,” PLoS ONE, vol. 17, no. 12, p. e0269195, 2022, doi: 10.1371/journal.pone.0269195.

M. Idrees, M. H. Sial, and N. U. Hassan, “Forecasting stock prices using long short-term memory involving attention approach: An application of stock exchange industry,” PLoS ONE, vol. 20, no. 3, p. e0319679, 2025, doi: 10.1371/journal.pone.0319679.

Downloads

Published

2026-08-29

How to Cite

Anggraeni, D. P. (2026). Hyperparameter-Tuned Stacked LSTM for Time-Series Forecasting of ANTMStock Prices. Journal Of Data Science, 4(01), 51–63. Retrieved from https://ejournal.seaninstitute.or.id/index.php/visualization/article/view/9046