Submitted:
26 March 2024
Posted:
27 March 2024
You are already at the latest version
Abstract
Keywords:
1. Introduction
2. Related Works
3. Methodologies
3.1. Autoencoder (AE)

3.2. Stacked AE-LSTM and AE-GRU Architecture
3.2.1. AE-LSTM

| Algorithm 1 AE-LSTM |
|
3.2.2. AE-GRU
| Algorithm 2 AE-GRU |
|
3.2.3. Hyperparameter Consideration
3.3. Activation Functions

3.3.1. ReLU
3.3.2. ELU
3.3.3. Tanh
4. Experiments and Results
4.1. Dataset Consideration
4.2. Exploratory Data Analysis


4.3. Evaluation Metrics
4.3.1. Mean Squared Error (MSE)
4.3.2. Root Mean Squared Error (RMSE)
4.3.3. Mean Absolute Error (MAE)
4.3.4. R-squared (R2) Score
4.3.5. Mean Absolute Percentage Error (MAPE)
4.4. Predictions by AE-LSTM vs AE-GRU
4.4.1. Predictions for Individual Stock
4.4.2. Predictions for the Stock Index- S&P
4.4.3. Predictions for the Cryptocurrency- Bitcoin
5. Conclusions
6. Future Works
Acknowledgments
Appendix A
Appendix A.1. LSTM

Appendix A.2. GRU

References
- Metghalchi, M.; Marcucci, J.; Chang, Y.H. Are moving average trading rules profitable? Evidence from the European stock markets. Applied Economics 2012, 44, 1539–1559. [CrossRef]
- Banerjee, D. Forecasting of Indian stock market using time-series ARIMA model. 2014 2nd international conference on business and information management (ICBIM). IEEE, 2014, pp. 131–135. [CrossRef]
- McMillan, D.G. Non-linear predictability of UK stock market returns. Oxford Bulletin of Economics and Statistics 2003, 65, 557–573. [CrossRef]
- Hiransha, M.; Gopalakrishnan, E.A.; Menon, V.K.; Soman, K. NSE stock market prediction using deep-learning models. Procedia computer science 2018, 132, 1351–1362. [CrossRef]
- Sirisha, U.M.; Belavagi, M.C.; Attigeri, G. Profit prediction using Arima, Sarima, and LSTM models in time series forecasting: A Comparison. IEEE Access 2022, 10, 124715–124727. [CrossRef]
- Kumbure, M.M.; Lohrmann, C.; Luukka, P.; Porras, J. Machine learning techniques and data for stock market forecasting: A literature review. Expert Systems with Applications 2022, 197, 116659. [CrossRef]
- Cakra, Y.E.; Distiawan Trisedya, B. Stock price prediction using linear regression based on sentiment analysis. 2015 International Conference on Advanced Computer Science and Information Systems (ICACSIS), 2015, pp. 147–154. [CrossRef]
- Lawal, Z.K.; Yassin, H.; Zakari, R.Y. Stock market prediction using supervised machine learning techniques: An overview. 2020 IEEE Asia-Pacific Conference on Computer Science and Data Engineering (CSDE). IEEE, 2020, pp. 1–6. [CrossRef]
- Hindrayani, K.M.; Fahrudin, T.M.; Aji, R.P.; Safitri, E.M. Indonesian stock price prediction including covid19 era using decision tree regression. 2020 3rd International Seminar on Research of Information Technology and Intelligent Systems (ISRITI). IEEE, 2020, pp. 344–347. [CrossRef]
- Chen, J. Analysis of bitcoin price prediction using machine learning. Journal of Risk and Financial Management 2023, 16, 51. [CrossRef]
- Khedr, A.M.; Arif, I.; El-Bannany, M.; Alhashmi, S.M.; Sreedharan, M. Cryptocurrency price prediction using traditional statistical and machine-learning techniques: A survey. Intelligent Systems in Accounting, Finance and Management 2021, 28, 3–34. [CrossRef]
- Shahi, T.B.; Shrestha, A.; Neupane, A.; Guo, W. Stock price forecasting with deep learning: A comparative study. Mathematics 2020, 8, 1441. [CrossRef]
- Pintelas, E.; Livieris, I.E.; Stavroyiannis, S.; Kotsilieris, T.; Pintelas, P. Investigating the problem of cryptocurrency price prediction: a deep learning approach. Artificial Intelligence Applications and Innovations: 16th IFIP WG 12.5 International Conference, AIAI 2020, Neos Marmaras, Greece, June 5–7, 2020, Proceedings, Part II 16. Springer, 2020, pp. 99–110.
- Liou, C.Y.; Cheng, W.C.; Liou, J.W.; Liou, D.R. Autoencoder for words. Neurocomputing 2014, 139, 84–96. [CrossRef]
- Gu, S.; Kelly, B.; Xiu, D. Autoencoder asset pricing models. Journal of Econometrics 2021, 222, 429–450. [CrossRef]
- Xia, K.; Huang, J.; Wang, H. LSTM-CNN architecture for human activity recognition. IEEE Access 2020, 8, 56855–56866. [CrossRef]
- Pierre, A.A.; Akim, S.A.; Semenyo, A.K.; Babiga, B. Peak Electrical Energy Consumption Prediction by ARIMA, LSTM, GRU, ARIMA-LSTM and ARIMA-GRU Approaches. Energies 2023, 16, 4739. [CrossRef]
- Selby, N.; Taparia, A.; others. An Efficient Stock Price Prediction Mechanism Using Multivariate Sequential LSTM Autoencoder 2023.
- Zhong, X.; Enke, D. Forecasting daily stock market return using dimensionality reduction. Expert Systems with Applications 2017, 67, 126–139. [CrossRef]
- Kohli, P.; Zargar, S.; Arora, S.; Gupta, P. Stock Prediction Using Machine Learning Algorithms. Applications of Artificial Intelligence Techniques in Engineering. Springer, Singapore, 2019, pp. 1–38. [CrossRef]
- Hu, Z.; Zhao, Y.; Khushi, M. A Survey of Forex and Stock Price Prediction Using Deep Learning. Applied System Innovation 2021, 4, 9. [CrossRef]
- Jiang, W. Applications of deep learning in stock market prediction: Recent progress. Expert Systems with Applications 2021, 184, 115537. [CrossRef]
- Nikou, M.; Mansourfar, G.; Bagherzadeh, J. Stock Price Prediction using Deep Learning Algorithm and its Comparison with Machine Learning Algorithms. Intelligent Systems in Accounting, Finance and Management 2019, 26, 164–174. [CrossRef]
- Sheth, D.; Shah, M. Predicting Stock Market Using Machine Learning: Best and Accurate Way to Know Future Stock Prices. International Journal of Systems Assurance Engineering and Management 2023, 14, 1–18. [CrossRef]
- Ali, M.; Khan, D.M.; Alshanbari, H.M.; El-Bagoury, A.A.H. Prediction of Complex Stock Market Data Using an Improved Hybrid EMD-LSTM Model. Applied Sciences 2023, 13, 1429. [CrossRef]
- Qi, C.; Ren, J.; Su, J. GRU Neural Network Based on CEEMDAN–Wavelet for Stock Price Prediction. Applied Sciences 2023, 13, 7104. [CrossRef]
- Karmiani, D.; Kazi, R.; Nambisan, A.; Shah, A.; Kamble, V. Comparison of Predictive Algorithms: Backpropagation, SVM, LSTM and Kalman Filter for Stock Market. 2019 Amity International Conference on Artificial Intelligence (AICAI), 2019, pp. 228–234. [CrossRef]
- Jiang, Q.; Tang, C.; Chen, C.; Wang, X.; Huang, Q. Stock Price Forecast Based on LSTM Neural Network. Proceedings of the Twelfth International Conference on Management Science and Engineering Management. ICMSEM 2018; Xu, J.; Cooke, F.; Gen, M.; Ahmed, S., Eds. Springer, 2019, pp. 403–412.
- Fang, Z.; Ma, X.; Pan, H.; Yang, G.; Arce, G.R. Movement Forecasting of Financial Time Series Based on Adaptive LSTM-BN Network. Expert Systems with Applications 2023, 213, 119207. [CrossRef]
- Gupta, P.; Gao, Y.; Wang, R.; Zhou, E. Stock Prediction Based on Optimized LSTM and GRU Models. Scientific Programming 2021, p. 4055281. [CrossRef]
- Kim, J.; Kim, S.; Wimmer, H.; Liu, H. A cryptocurrency prediction model using LSTM and GRU algorithms. 2021 IEEE/ACIS 6th International Conference on Big Data, Cloud Computing, and Data Science (BCD). IEEE, 2021, pp. 37–44. [CrossRef]
- Gradxs, G.P.B.; Rao, D.N. Behaviour Based Credit Card Fraud Detection: Design and Analysis by Using Deep Stacked Autoencoder Based Harris Grey Wolf (HGW) Method. Scandinavian Journal of Information Systems 2023, 35, 1–8.
- Fanai, H.; Abbasimehr, H. A Novel Combined Approach Based on Deep Autoencoder and Deep Classifiers for Credit Card Fraud Detection. Expert Systems with Applications 2023, 217, 119562. [CrossRef]
- Zhao, H.; Li, X.; Xu, J.; Fu, X.; Chen, J. Financial Time Series Data Prediction by Combination Model Adaboost-KNN-LSTM. 2023 International Joint Conference on Neural Networks (IJCNN); IEEE: Gold Coast, Australia, 2023; pp. 1–8. [CrossRef]
- Kwak, N.; Lim, D. Financial Time Series Forecasting using AdaBoost-GRU Ensemble Model. Journal of the Korean Data And Information Science Society 2021, 32, 267–281. [CrossRef]
- Shen, G.; Tan, Q.; Zhang, H.; Zeng, P.; Xu, J. Deep Learning with Gated Recurrent Unit Networks for Financial Sequence Predictions. Procedia Computer Science 2018, 131, 895–903. [CrossRef]
- Hossain, M.A.; Karim, R.; Thulasiram, R.; Bruce, N.D.B.; Wang, Y. Hybrid Deep Learning Model for Stock Price Prediction. Proc. 2018 IEEE Symposium on Computational Intelligence in Financial Engineering and Economics (CIFEr), Symposium Series on Computational Intelligence; IEEE: Bangalore, India, 2018. [CrossRef]
- Song, H.; Choi, H. Forecasting Stock Market Indices Using Recurrent Neural Network Based Hybrid Models: CNN-LSTM, GRU-CNN, and Ensemble Models. Applied Sciences 2023, 13, 4644. [CrossRef]
- Petrovic, A.; Strumberger, I.; Bezdan, T.; Jassim, H.S.; Nassor, S.S. Cryptocurrency price prediction by using hybrid machine learning and beetle antennae search approach. 2021 29th Telecommunications Forum (TELFOR). IEEE, 2021, pp. 1–4. [CrossRef]
- Lu, X.; Tsao, Y.; Matsuda, S.; Hori, C. Speech enhancement based on deep denoising autoencoder. Interspeech, 2013, Vol. 2013, pp. 436–440.
- Saad, O.M.; Chen, Y. Deep denoising autoencoder for seismic random noise attenuation. Geophysics 2020, 85, V367–V376. [CrossRef]
- Vaswani, A.; Shazeer, N.; Parmar, N.; Uszkoreit, J.; Jones, L.; Gomez, A.N.; Kaiser, .; Polosukhin, I. Attention is all you need. Advances in neural information processing systems 2017, 30.
- Graves, A.; Graves, A. Long short-term memory. Supervised sequence labelling with recurrent neural networks 2012, pp. 37–45.
- Yang, S.; Yu, X.; Zhou, Y. Lstm and gru neural network performance comparison study: Taking yelp review dataset as an example. 2020 International workshop on electronic communication and artificial intelligence (IWECAI). IEEE, 2020, pp. 98–101. [CrossRef]
| 1 | |
| 2 | |
| 3 | |
| 4 | |
| 5 |



| Assets | Average Volatility |
|---|---|
| Apple | 35.96 |
| Johnson & Johnson | 17.60 |
| JP Morgan Chase | 31.28 |
| Chevron | 24.34 |
| S&P | 16.71 |
| Bitcoin | 52.48 |
| Components | Metric | Algorithms | |
|---|---|---|---|
| AE-GRU | AE-LSTM | ||
| AAPL | MSE | 0.37 | 1.22 |
| RMSE | 0.61 | 1.10 | |
| MAE | 0.53 | 0.97 | |
| R-Squared | 0.999 | 0.996 | |
| MAPE | 0.3% | 0.6% | |
| JNJ | MSE | 0.01 | 0.07 |
| RMSE | 0.12 | 0.26 | |
| MAE | 0.1 | 0.2 | |
| R-Squared | 0.9997 | 0.9987 | |
| MAPE | 0.07% | 0.12% | |
| JPM | MSE | 0.33 | 4.79 |
| RMSE | 0.58 | 2.18 | |
| MAE | 0.55 | 2.17 | |
| R-Squared | 0.996 | 0.94 | |
| MAPE | 0.4% | 1.51% | |
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content. |
© 2024 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (http://creativecommons.org/licenses/by/4.0/).