Exploring Deep Learning on Apple Stock Volatility: Long Short-Term Memory and Gated Recurrent Unit Performance
DOI:
https://doi.org/10.57152/predatecs.v4i1.2109Keywords:
Apple Inc. (APPL), Deep Learning, Gated Recurrent Unit, Long Short-Term Memory, Stock VolatilityAbstract
Forecasting Apple Inc. (AAPL) stock prices is challenging due to the nonlinear and dynamic nature of financial data. This study compares the performance of Long Short-Term Memory (LSTM) and Gated Recurrent Unit (GRU) architectures in predicting AAPL stock volatility. Daily stock data from January 1, 2020, to May 5, 2025, were used to evaluate both models under various hyperparameters. Performance was assessed using Mean Absolute Error (MAE), Root Mean Squared Error (RMSE), and Mean Absolute Percentage Error (MAPE). The results show that GRU with the AdamW optimizer (learning rate 0.01, batch size 8) achieved the best performance (MAE: 3.4188, RMSE: 4.9261, MAPE: 1.5648). Beyond identifying optimal hyperparameters, this study highlights critical architectural differences. The findings reveal that GRU's streamlined gating mechanism adapts more effectively and more rapidly to sudden price fluctuations than LSTM's complex memory-retention structure. These results demonstrate GRU's distinct advantage for computationally agile and accurate stock forecasting under highly volatile market conditions.
References
Y. Gao, R. Wang, and E. Zhou, “Stock Prediction Based on Optimized LSTM and GRU Models,” Sci. Program., vol. 2021, 2021, doi: 10.1155/2021/4055281.
Y. Li and Y. Pan, “A novel ensemble deep learning model for stock prediction based on stock prices and news,” Int. J. Data Sci. Anal., vol. 13, no. 2, pp. 139–149, Mar. 2022, doi: 10.1007/s41060-021-00279-9.
K. Sako, B. N. Mpinda, and P. C. Rodrigues, “Neural Networks for Financial Time Series Forecasting,” Entropy, vol. 24, no. 5, May 2022, doi: 10.3390/e24050657.
V. Chang, Q. A. Xu, A. Chidozie, and H. Wang, “Predicting Economic Trends and Stock Market Prices with Deep Learning and Advanced Machine Learning Techniques,” Electronics (Switzerland), vol. 13, no. 17, Sep. 2024, doi: 10.3390/electronics13173396.
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 Journal, vol. 90, May 2020, doi: 10.1016/j.asoc.2020.106181.
W. Jiang, “Applications of deep learning in stock market prediction: Recent progress,” Expert Syst. Appl., vol. 184, Dec. 2021, doi: 10.1016/j.eswa.2021.115537.
B. Lim and S. Zohren, “Time-series forecasting with deep learning: A survey,” Apr. 05, 2021, Royal Society Publishing. doi: 10.1098/rsta.2020.0209.
G. Sonkavde, D. S. Dharrao, A. M. Bongale, S. T. Deokate, D. Doreswamy, and S. K. Bhat, “Forecasting Stock Market Prices Using Machine Learning and Deep Learning Models: A Systematic Review, Performance Analysis and Discussion of Implications,” Sep. 01, 2023, Multidisciplinary Digital Publishing Institute (MDPI). doi: 10.3390/ijfs11030094.
S. Zaheer et al., “A Multi Parameter Forecasting for Stock Time Series Data Using LSTM and Deep Learning Model,” Mathematics, vol. 11, no. 3, Feb. 2023, doi: 10.3390/math11030590.
J. K. Mutinda and A. K. Langat, “Stock price prediction using combined GARCH-AI models,” Sci. Afr., vol. 26, Dec. 2024, doi: 10.1016/j.sciaf.2024.e02374.
Z. Zhang, Q. Liu, Y. Hu, and H. Liu, “Multi-feature stock price prediction by LSTM networks based on VMD and TMFG,” J. Big Data, vol. 12, no. 1, Dec. 2025, doi: 10.1186/s40537-025-01127-4.
M. Ali, D. M. Khan, H. M. Alshanbari, and A. A. A. H. El-Bagoury, “Prediction of Complex Stock Market Data Using an Improved Hybrid EMD-LSTM Model,” Applied Sciences (Switzerland), vol. 13, no. 3, Feb. 2023, doi: 10.3390/app13031429.
Q. Liu, Z. Tao, Y. Tse, and C. Wang, “Stock market prediction with deep learning: The case of China,” Financ. Res. Lett., vol. 46, May 2022, doi: 10.1016/j.frl.2021.102209.
I. K. Nti, A. F. Adekoya, and B. A. Weyori, “A novel multi-source information-fusion predictive framework based on deep neural networks for accuracy enhancement in stock market prediction,” J. Big Data, vol. 8, no. 1, Dec. 2021, doi: 10.1186/s40537-020-00400-y.
S. Sang and L. Li, “A Novel Variant of LSTM Stock Prediction Method Incorporating Attention Mechanism,” Mathematics, vol. 12, no. 7, Apr. 2024, doi: 10.3390/math12070945.
Y. Zhang and H. D. Fill, “TS-GRU: A Stock Gated Recurrent Unit Model Driven via Neuro-Inspired Computation,” Electronics (Switzerland), vol. 13, no. 23, Dec. 2024, doi: 10.3390/electronics13234659.
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,” J. Big Data, vol. 9, no. 1, Dec. 2022, doi: 10.1186/s40537-022-00597-0.
Y. Touzani and K. Douzi, “An LSTM and GRU based trading strategy adapted to the Moroccan market,” J. Big Data, vol. 8, no. 1, Dec. 2021, doi: 10.1186/s40537-021-00512-z.
A. D. Kayit and M. T. Ismail, “Advancing stock price prediction through the development of hybrid ensembles: a comprehensive comparative analysis of machine learning approaches,” J. Big Data, vol. 12, no. 1, Dec. 2025, doi: 10.1186/s40537-025-01185-8.
B. Gülmez, “Stock price prediction with optimized deep LSTM network with artificial rabbits optimization algorithm,” Expert Syst. Appl., vol. 227, Oct. 2023, doi: 10.1016/j.eswa.2023.120346.
K. Noor and U. Fatima, “Meta Learning Strategies for Comparative and Efficient Adaptation to Financial Datasets,” IEEE Access, vol. 13, pp. 24158–24170, 2025, doi: 10.1109/ACCESS.2024.3516490.
S. Sang and L. Li, “A Stock Prediction Method Based on Heterogeneous Bidirectional LSTM,” Applied Sciences (Switzerland), vol. 14, no. 20, Oct. 2024, doi: 10.3390/app14209158.
F. Kamalov, “Forecasting significant stock price changes using neural networks,” Neural Comput. Appl., vol. 32, pp. 17655–17667, May 2020, doi: 10.1007/s00521-020-04942-3.
H. Zouaoui and M. N. Naas, “Option pricing using deep learning approach based on LSTM-GRU neural networks: Case of London stock exchange,” Data Science in Finance and Economics, vol. 3, no. 3, pp. 267–284, Aug. 2023, doi: 10.3934/DSFE.2023016.
J. Zhao, D. Zeng, S. Liang, H. Kang, and Q. Liu, “Prediction model for stock price trend based on recurrent neural network,” J. Ambient Intell. Humaniz. Comput., vol. 12, no. 1, pp. 745–753, Jan. 2021, doi: 10.1007/s12652-020-02057-0.
S. Hochreiter and J. ¨ Urgen Schmidhuber, “Long Short-Term Memory,” Neural Comput., vol. 9, no. 8, pp. 1735–1780, Nov. 1997, doi: 10.1162/neco.1997.9.8.1735.
K. Cho et al., “Learning Phrase Representations using RNN Encoder-Decoder for Statistical Machine Translation,” in Empirical Methods in Natural Language Processing (EMNLP), 2014, pp. 1724–1734. doi: 10.3115/v1/D14-1179.
D. P. Kingma and J. Ba, “Adam: A Method for Stochastic Optimization,” in International Conference on Learning Representations (ICLR), 2015. Accessed: Oct. 18, 2025. [Online]. Available: https://arxiv.org/abs/1412.6980
I. Loshchilov and F. Hutter, “Decoupled Weight Decay Regularization,” in International Conference on Learning Representations (ICLR), Jan. 2019. [Online]. Available: https://dblp.org/rec/conf/iclr/LoshchilovH19.html
I. Kasse, J. Kusuma, A. Lawi, and A. Rahim, “Enhancing Stock Price Forecasting Accuracy Through Compositional Learning of Recurrent Architectures: A Multi-Variant RNN Approach,” IEEE Access, vol. 13, pp. 161073–161102, 2025, doi: 10.1109/ACCESS.2025.3602721.
J. Sen, S. Mehtab, and A. Dutta, “Stock Price Prediction Using Machine Learning and LSTM-Based Deep Learning Models,” Aug. 2021, doi: 10.36227/techrxiv.15103602.v1.
S. Ji, J. Kim, and H. Im, “A comparative study of bitcoin price prediction using deep learning,” Mathematics, vol. 7, no. 10, Oct. 2019, doi: 10.3390/math7100898.
A. Dutta, S. Kumar, and M. Basu, “A Gated Recurrent Unit Approach to Bitcoin Price Prediction,” Journal of Risk and Financial Management, vol. 13, no. 2, Feb. 2020, doi: 10.3390/jrfm13020023.
I. Javid, R. Ghazali, I. Syed, M. Zulqarnain, and N. A. Husaini, “Study on the Pakistan stock market using a new stock crisis prediction method,” PLoS One, vol. 17, no. 10 October, Oct. 2022, doi: 10.1371/journal.pone.0275022.
H. Song and H. Choi, “Forecasting Stock Market Indices Using the Recurrent Neural Network Based Hybrid Models: CNN-LSTM, GRU-CNN, and Ensemble Models,” Applied Sciences (Switzerland), vol. 13, no. 7, Apr. 2023, doi: 10.3390/app13074644.
J. Xiao, T. Deng, and S. Bi, “Comparative Analysis of LSTM GRU and Transformer Models for Stock Price Prediction,” in Proceedings of International Conference on Digital Economy, Blockchain and Artificial Intelligence, DEBAI 2024, Association for Computing Machinery, Inc, Dec. 2024, pp. 103–108. doi: 10.1145/3700058.3700075.
Downloads
Published
How to Cite
Issue
Section
License
Copyright (c) 2026 Kia Kurniawan, Ikhwan Ash-Siddiqi; Rutul Trivedi, Reylita Putri Ramadhan

This work is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License.
Copyright © by Author; Published by Institut Riset dan Publikasi Indonesia (IRPI)
This Public Research Journal of Engineering, Data Technology and Computer Science is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License.









