Sliding Window-Based Randomized K-Fold Dynamic ANN for Next-Day Stock Trend Forecasting
Abstract
:1. Introduction
- Providing comprehensive mathematical details regarding the Levenberg–Marquardt (L-M) algorithm for its implementation in the proposed model.
- Introducing a novel randomized k-fold cross-validation methodology.
- Developing a new ANN model that incorporates a variable number of nodes in the hidden layer with each K-days window shift.
- Forecasting the opening and closing prices for the under-researched stocks, along with the correct price trend.
- Assessing and analyzing the efficacy of the proposed dynamic model in comparison to established advanced models, using performance metrics such as rmse, mae, and R-value.
2. Literature Survey
Problem Statement
3. Methodology
3.1. Mathematical Derivation of Levenberg–Marquardt Algorithm
Levenberg–Marquardt Algorithm
- Initial value: Start with a moderate value: A common starting point is . Adjust based on problem characteristics: If the problem is known to be highly nonlinear, a larger initial value might be appropriate.
- Adaptive Updates:(i) Increase if the step size is not improving: If the sum of squared residuals increases after a step, it indicates that the step size could be too large. Increase to take a smaller and more cautious step.(ii) Decrease if the step size is consistently improving: If the sum of squared residuals decreases consistently after multiple steps, it suggests that the step size is appropriate. Decrease to allow for larger steps.
3.2. Data Collection
3.3. Normalization
3.4. Artificial Neural Networks
- (a)
- Compute the net value at the hidden node and outputs for all nodes in the hidden layer:
- (b)
- Utilize the first-layer neurons’ outputs as the inputs for every neuron in the output layer, calculate the net values for the output node in a similar manner, and output from them can be expressed as:
- (c)
- Calculate the loss function which is defined in Equations (1) and (2). After the forward calculation, The Jacobian, along with the loss vector and the damping parameter , is used in the L-M update rule to calculate how much to adjust each weight in the network.The backward calculation may be structured as follows:
- (d)
- The matrix has dimensions , where is the number of training sequences, is the number of output neurons, and is the total number of biases and weights in the network. Therefore, for the training sequence with the output neuron and the weight/bias, the entry in the matrix will be:
- (e)
- Back-propagation from the output layer to the hidden layer: If is a weight connecting the hidden layer to the output layer (), then:
- (f)
- After the calculating the back-propagation at each layer, the L-M update:
- (g)
- Update the rule for new weights and biases as:
3.5. Training Process Design
- Assess the total loss value using the first obtained random weights.
- Execute an update as specified by Equation (4) to modify weights.
- Utilize the updated weights to compute the overall loss value.
- If the updated total loss value increases, reverse the step (restore the weight vector to its prior value) and boost by a factor of 10. Proceed to step 2 and attempt the update once again.
- If the updated total loss value is lower, accept the step by retaining the new weight vector as the current one and reduce by a factor of 10.
- Proceed to step 2 with the updated weights until the current overall loss value is less than the specified threshold.
- For regularization: We keep an eye on validation performance, and if the loss function stagnates or gets worse over the sequence of six iterations, we halt the training to prevent becoming stuck at local minima.
3.6. Random k-Fold Cross-Validation
3.7. Sliding Window Technique
3.8. Selection Criteria for Nodes in Hidden Layer for the Dynamic Neural Network Architecture
4. Results
- Predicted trend of the day on the day t, defined as:() = Predicted closing price of day − Predicted opening price of day.
- Actual trend of the day, defined as:() = Actual closing price of the day − Actual opening price of the day.
- Correct pattern prediction :
- (a)
- Case 1: Same direction: If , then:
- (b)
- Case 2: Opposite direction, within tolerance (T) level: If and and , then:
- (c)
- Case 3: Opposite direction, beyond tolerance (T): If and and , then:
- (d)
- Case 4: AT is zero: If , then if then else .
- Total number of predictions =
5. Discussion
Practical Feasibility of Deploying the Model
6. Conclusions
Author Contributions
Funding
Informed Consent Statement
Data Availability Statement
Acknowledgments
Conflicts of Interest
Appendix A
Appendix A.1. Steepest Descent Algorithm (S-D)
Appendix A.2. Newton’s Method
Appendix A.3. Gauss–Newton Method
References
- Bulkowski, T.N. Encyclopedia of Chart Patterns; John Wiley & Sons: Hoboken, NJ, USA, 2021. [Google Scholar]
- Tealab, A. Time Series Forecasting Using Artificial Neural Networks Methodologies: A Systematic Review. Future Comput. Inform. J. 2018, 3, 334–340. [Google Scholar] [CrossRef]
- Smith, J.S.; Wu, B.; Wilamowski, B.M. Neural Network Training with Levenberg–Marquardt and Adaptable Weight Compression. IEEE Trans. Neural Netw. Learn. Syst. 2018, 30, 580–587. [Google Scholar] [CrossRef]
- Han, H.; Liu, Z.; Barrios Barrios, M. Time series forecasting model for non-stationary series pattern extraction using deep learning and GARCH modeling. J. Cloud Comput. 2024, 13, 2. [Google Scholar] [CrossRef]
- Zhang, Y. Deep learning models for price forecasting of financial time series: A review of recent advancements: 2020–2022. WIREs Data Min. Knowl. Discov. 2024, 14, e1519. [Google Scholar] [CrossRef]
- Zhan, Z.; Kim, S.K. Versatile Time-Window Sliding Machine Learning Techniques for Stock Market Forecasting. Artif. Intell. Rev. 2024, 57, 209. [Google Scholar] [CrossRef]
- May, B. A soft landing may be in sight, but expect turbulence. Econ. Outlook 2024, 48, 29–32. [Google Scholar] [CrossRef]
- Jahan, I.; Sajal, S.Z.; Nygard, K.E. Prediction Model Using Recurrent Neural Networks. In Proceedings of the 2019 IEEE International Conference on Electro Information Technology (EIT), Brookings, SD, USA, 20–22 May 2019; IEEE: Piscataway, NJ, USA, 2019; pp. 1–6. [Google Scholar] [CrossRef]
- Pai, P.F.; Liu, C.H. Predicting Vehicle Sales by Sentiment Analysis of Twitter Data and Stock Market Values. IEEE Access 2018, 6, 57655–57662. [Google Scholar] [CrossRef]
- Yang, F.; Chen, Z.; Li, J.; Tang, L. A Novel Hybrid Stock Selection Method with Stock Prediction. Appl. Soft Comput. 2019, 80, 820–831. [Google Scholar] [CrossRef]
- Chouhan, S.S.; Kaul, A.; Singh, U.P. Image Segmentation Using Computational Intelligence Techniques: Review. Arch. Comput. Methods Eng. 2019, 26, 533–596. [Google Scholar] [CrossRef]
- Adebiyi, A.A.; Adewumi, A.O.; Ayo, C.K. Comparison of ARIMA and Artificial Neural Networks Models for Stock Price Prediction. J. Appl. Math. 2014, 2014, 614342. [Google Scholar] [CrossRef]
- Kristjanpoller, W.; Minutolo, M.C. A hybrid volatility forecasting framework integrating GARCH, artificial neural network, technical analysis and principal components analysis. Expert Syst. Appl. 2018, 109, 1–11. [Google Scholar] [CrossRef]
- Sakhre, V.; Singh, U.P.; Jain, S. FCPN Approach for Uncertain Nonlinear Dynamical System with Unknown Disturbance. Int. J. Fuzzy Syst. 2017, 19, 452–469. [Google Scholar] [CrossRef]
- Gu, S.; Kelly, B.; Xiu, D. Empirical Asset Pricing via Machine Learning. Rev. Financ. Stud. 2020, 33, 2223–2273. [Google Scholar] [CrossRef]
- Zhou, X.; Zhou, H.; Long, H. Forecasting the Equity Premium: Do Deep Neural Network Models Work? Mod. Financ. 2023, 1, 1–11. [Google Scholar] [CrossRef]
- Atsalakis, G.S.; Valavanis, K.P. Forecasting stock market short-term trends using a neuro-fuzzy based methodology. Expert Syst. Appl. 2009, 36, 10696–10707. [Google Scholar] [CrossRef]
- Box, G.; Jenkins, G.; Reinsel, G.; Ljung, G. Time Series Analysis: Forecasting and Control; John Wiley & Sons: Hoboken, NJ, USA, 2015. [Google Scholar]
- D’Angelo, G.; Tipaldi, M.; GlieL-Mo, L.; Rampone, S. Spacecraft autonomy modeled via Markov decision process and associative rule-based machine learning. In Proceedings of the 4th IEEE International Workshop on Metrology for AeroSpace, MetroAeroSpace 2017—Proceedings, Padua, Italy, 21–23 June 2017; pp. 324–329. [Google Scholar] [CrossRef]
- Roodschild, M.; Gotay Sardiñas, J.; Will, A. A new approach for the vanishing gradient problem on sigmoid activation. Prog. Artif. Intell. 2020, 9, 351–360. [Google Scholar] [CrossRef]
- Cui, L.; Yang, S.; Chen, F.; Ming, Z.; Lu, N.; Qin, J. A survey on application of machine learning for Internet of Things. Int. J. Mach. Learn. Cybern. 2018, 9, 1399–1417. [Google Scholar] [CrossRef]
- Rong, G.; Mendez, A.; Assi, E.B.; Zhao, B.; Sawan, M. Artificial Intelligence in Healthcare: Review and Prediction Case Studies. Engineering 2020, 6, 291–301. [Google Scholar] [CrossRef]
- Tang, Y.; Chau, K.-Y.; Li, W.; Wan, T. Forecasting Economic Recession through Share Price in the Logistics Industry with Artificial Intelligence (AI). Computation 2020, 8, 70. [Google Scholar] [CrossRef]
- Manohar, B.; Das, R. Artificial Neural Networks for Prediction of COVID-19 in India by Using Backpropagation. Expert Syst. 2023, 40, e13105. [Google Scholar] [CrossRef]
- Marquardt, D.W. An Algorithm for Least-Squares Estimation of Nonlinear Parameters. SIAM J. Appl. Math. 1963, 11, 431–441. [Google Scholar] [CrossRef]
- Golovachev, S. Forecasting the U.S. Stock Market via Levenberg-Marquardt and Haken Artificial Neural Networks Using ICA&PCA Pre-processing Techniques. In Pattern Recognition and Machine Intelligence; Springer: Berlin/Heidelberg, Germany, 2011; pp. 460–467. [Google Scholar] [CrossRef]
- Manohar, B.; Das, R.; Lakshmi, M.; Prajapati, J.I.; Reddy, K.M. Artificial Neural Network-Based Stock Price Prediction Using Levenberg-Marquardt Algorithm. In Artificial Intelligence Based Solutions for Industrial Applications; CRC Press: Boca Raton, FL, USA, 2024; pp. 315–337. [Google Scholar]
- Selvamuthu, D.; Kumar, V.; Mishra, A. Indian Stock Market Prediction Using Artificial Neural Networks on Tick Data. Financ. Innov. 2019, 5, 16. [Google Scholar] [CrossRef]
- Goel, H.; Som, B.K. Stock market prediction, COVID-19 pandemic and neural networks: An SCG algorithm application. Bus. Perspect. Res. 2023, 11, 271–287. [Google Scholar] [CrossRef]
- Zhou, R.; Wu, D.; Fang, L.; Xu, A.; Lou, X. A Levenberg–Marquardt Backpropagation Neural Network for Predicting Forest Growing Stock Based on the Least-Squares Equation Fitting Parameters. Forests 2018, 9, 757. [Google Scholar] [CrossRef]
- Nawi, N.M.; Khan, A.; Rehman, M.Z. CSLM: Levenberg Marquardt based Back Propagation Algorithm Optimized with Cuckoo Search. J. ICT Res. Appl. 2013, 7, 103–116. [Google Scholar] [CrossRef]
- Tiwari, A.K.; Jana, R.K.; Das, D.; Roubaud, D. Informational Efficiency of Indian Stock Market: Evidence from High-Frequency Data Using LSTM Model. Phys. A Stat. Mech. Its Appl. 2019, 516, 114–124. [Google Scholar] [CrossRef]
- Dey, P.; Hossain, E.; Hossain, M.I.; Chowdhury, M.A.; Alam, M.S.; Hossain, M.S.; Andersson, K. Comparative Analysis of Recurrent Neural Networks in Stock Price Prediction for Different Frequency Domains. Algorithms 2021, 14, 251. [Google Scholar] [CrossRef]
- Wei, W.; Wang, J. Stock Price Prediction Based on Information Entropy and Artificial Neural Network. PeerJ Comput. Sci. 2022, 8, e915. [Google Scholar] [CrossRef]
- Yao, J.; Tan, C.L. A Case Study on Using Neural Networks to Perform Technical Forecasting of Forex. Neurocomputing 2000, 34, 79–98. [Google Scholar] [CrossRef]
- Kara, Y.; Boyacioglu, M.A.; Baykan, Ö.K. Predicting Direction of Stock Price Index Movement Using Artificial Neural Networks and Support Vector Machines: The Sample of the Istanbul Stock Exchange. Expert Syst. Appl. 2011, 38, 5311–5319. [Google Scholar] [CrossRef]
- Garrido, D.R.; Lorenzo, M.S. Application of the Sliding Window Method to the Short Range Prediction System for the Correction of Precipitation Forecast Errors. Environ. Sci. Proc. 2022, 19, 53. [Google Scholar] [CrossRef]
- Thu, H.G.T.; Thanh, T.N.; Le Quy, T. A Neighborhood Deep Neural Network Model Using Sliding Window for Stock Price Prediction. In Proceedings of the 2021 IEEE International Conference on Big Data and Smart Computing (BigComp), Jeju Island, Republic of Korea, 17–20 January 2021; pp. 69–74. [Google Scholar] [CrossRef]
- Wang, J.; Wang, J.; Zhang, Z.; Guo, S. Forecasting Stock Indices with Back Propagation Neural Network. Expert Syst. Appl. 2012, 38, 14346–14355. [Google Scholar] [CrossRef]
- Atsalakis, G.S.; Valavanis, K.P. Surveying Stock Market Forecasting Techniques – Part II: Soft Computing Methods. Expert Syst. Appl. 2009, 36, 5932–5941. [Google Scholar] [CrossRef]
- Ballings, M.; Van den Poel, D.; Hespeels, N.; Gryp, R. Evaluating Multiple Classifiers for Stock Price Direction Prediction. Expert Syst. Appl. 2015, 42, 7046–7056. [Google Scholar] [CrossRef]
- Fischer, T.; Krauss, C. Deep Learning with Long Short-Term Memory Networks for Financial Market Predictions. Eur. J. Oper. Res. 2018, 270, 654–669. [Google Scholar] [CrossRef]
- Teixeira, D.M.; Barbosa, R.S. Stock Price Prediction in the Financial Market Using Machine Learning Models. Computation 2025, 13, 3. [Google Scholar] [CrossRef]
- Nelson, D.M.; Pereira, A.C.M.; de Oliveira, R.A. Stock Market’s Price Movement Prediction with LSTM Neural Networks. Expert Syst. Appl. 2017, 84, 67–78. [Google Scholar] [CrossRef]
- Cao, J.; Li, Z.; Li, J. Financial Time Series Forecasting Model Based on CEEMDAN and GRU. Appl. Soft Comput. 2021, 101, 107049. [Google Scholar] [CrossRef]
Window Shift | Nodes in Hidden Layer | Random k-Fold | rTrain | rVal | rTest | rAll | rmseTrain | rmseVal | rmseTest | rmseAll | maeTrain | maeVal | maeTest | maeAll |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1 | 6 | 3 | 0.9830 | 0.8718 | 0.5091 | 0.9476 | 1.1746 | 3.0729 | 4.1236 | 2.1074 | 0.9249 | 1.5382 | 1.8375 | 1.1740 |
2 | 6 | 2 | 0.9621 | 0.8227 | 0.8340 | 0.9471 | 1.8720 | 3.3692 | 5.5221 | 2.8208 | 1.0246 | 1.7217 | 2.0924 | 1.4217 |
3 | 20 | 8 | 1.0000 | 0.9019 | 0.7041 | 0.9839 | 0.0000 | 3.1538 | 4.4780 | 1.9683 | 0.0521 | 1.5659 | 1.8739 | 0.8821 |
4 | 26 | 6 | 1.0000 | 0.9279 | 0.7808 | 0.9748 | 0.0000 | 4.4489 | 6.1927 | 2.7414 | 0.0323 | 1.8643 | 2.3201 | 1.0731 |
5 | 22 | 4 | 1.0000 | 0.9622 | 0.1743 | 0.9871 | 0.0005 | 3.8980 | 4.6546 | 2.1903 | 0.0569 | 1.7534 | 1.8883 | 0.9332 |
6 | 11 | 8 | 1.0000 | 0.9747 | 0.5385 | 0.9922 | 0.0000 | 3.0213 | 3.8339 | 1.7585 | 0.0000 | 1.5182 | 1.7802 | 0.8444 |
7 | 22 | 10 | 1.0000 | 0.9665 | 0.8147 | 0.9859 | 0.0085 | 3.0583 | 4.1433 | 1.8526 | 0.0822 | 1.5277 | 1.7521 | 0.8424 |
8 | 9 | 6 | 0.9966 | 0.9417 | 0.6432 | 0.9877 | 0.8719 | 3.1345 | 2.8860 | 1.7183 | 0.7938 | 1.5082 | 1.5582 | 1.0397 |
9 | 9 | 3 | 0.9915 | 0.9038 | 0.8818 | 0.9870 | 1.5391 | 3.1654 | 2.2111 | 1.9329 | 1.0940 | 1.4896 | 1.2984 | 1.1826 |
10 | 29 | 7 | 1.0000 | 0.9458 | 0.7701 | 0.9882 | 0.0468 | 4.3363 | 2.8941 | 1.9063 | 0.1792 | 1.7959 | 1.4564 | 0.8557 |
11 | 9 | 2 | 0.9965 | 0.9714 | 0.5131 | 0.9855 | 1.0548 | 3.2386 | 3.5833 | 1.9667 | 0.9116 | 1.5337 | 1.6641 | 1.1324 |
12 | 6 | 6 | 0.9961 | 0.9794 | 0.6841 | 0.9858 | 0.9897 | 2.6305 | 3.7645 | 1.8562 | 0.8611 | 1.4489 | 1.6968 | 1.0933 |
13 | 5 | 5 | 0.9924 | 0.9781 | 0.7344 | 0.9859 | 1.2147 | 1.9064 | 3.1267 | 1.6763 | 0.9804 | 1.2442 | 1.6170 | 1.1174 |
14 | 6 | 8 | 0.9931 | 0.9643 | 0.7599 | 0.9782 | 1.1944 | 3.1048 | 4.0405 | 2.1020 | 0.9621 | 1.6301 | 1.6267 | 1.1742 |
15 | 12 | 5 | 1.0000 | 0.9709 | 0.6563 | 0.9844 | 0.0000 | 3.1356 | 4.0787 | 1.8524 | 0.0000 | 1.6180 | 1.8204 | 0.8799 |
16 | 20 | 1 | 1.0000 | 0.8408 | 0.5250 | 0.9810 | 0.0297 | 3.4762 | 3.6275 | 1.8185 | 0.1422 | 1.7323 | 1.7313 | 0.8957 |
17 | 26 | 5 | 1.0000 | 0.8923 | 0.4915 | 0.9442 | 0.0205 | 3.2045 | 5.2711 | 2.2103 | 0.1107 | 1.5723 | 2.1171 | 0.9520 |
Window Shift | Nodes in Hidden Layer | Random k-Fold | rTrain | rVal | rTest | rAll | rmseTrain | rmseVal | rmseTest | rmseAll | maeTrain | maeVal | maeTest | maeAll |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1 | 11 | 6 | 0.9996 | 0.8019 | 0.6680 | 0.9377 | 0.1785 | 2.7597 | 3.3368 | 1.7783 | 0.3298 | 1.5120 | 1.6453 | 0.9432 |
2 | 11 | 10 | 0.9835 | 0.4648 | 0.2800 | 0.9479 | 1.1027 | 2.5097 | 3.0030 | 1.8402 | 0.8459 | 1.4393 | 1.5720 | 1.1088 |
3 | 8 | 10 | 1.0000 | 0.9387 | 0.8139 | 0.9586 | 0.0000 | 1.9568 | 2.7263 | 1.3950 | 0.0000 | 1.2270 | 1.4554 | 0.7774 |
4 | 2 | 1 | 0.9799 | 0.8899 | 0.6486 | 0.9476 | 0.9604 | 3.2273 | 5.7366 | 2.9084 | 0.8400 | 1.6101 | 2.1601 | 1.3130 |
5 | 4 | 3 | 0.9975 | 0.9438 | 0.3591 | 0.9890 | 0.6212 | 2.5195 | 2.6049 | 1.5431 | 0.6155 | 1.4340 | 1.4904 | 0.9740 |
6 | 18 | 7 | 0.9982 | 0.9743 | 0.5093 | 0.9881 | 0.7916 | 1.9599 | 3.4582 | 1.8108 | 0.7870 | 1.2019 | 1.6350 | 1.0626 |
7 | 16 | 2 | 0.9997 | 0.9133 | 0.8079 | 0.9819 | 0.2336 | 3.1081 | 2.5383 | 1.5763 | 0.4408 | 1.5264 | 1.4248 | 0.9043 |
8 | 12 | 7 | 0.9993 | 0.6739 | 0.5953 | 0.9219 | 0.2230 | 3.2635 | 3.1647 | 1.8207 | 0.4137 | 1.6388 | 1.6676 | 0.9974 |
9 | 8 | 6 | 0.9938 | 0.5482 | 0.7932 | 0.9250 | 0.3980 | 2.7715 | 2.0986 | 1.3821 | 0.5274 | 1.5366 | 1.3203 | 0.9061 |
10 | 2 | 1 | 0.9038 | 0.6437 | 0.4686 | 0.8038 | 1.9132 | 2.1354 | 3.0609 | 2.2159 | 1.2349 | 1.3278 | 1.5758 | 1.3211 |
11 | 21 | 9 | 0.9823 | 0.8803 | 0.7045 | 0.9452 | 0.6986 | 3.0247 | 2.3540 | 1.5931 | 0.7113 | 1.6476 | 1.3192 | 1.0089 |
12 | 21 | 1 | 1.0000 | 0.8855 | 0.8850 | 0.9439 | 0.0012 | 2.1513 | 2.9578 | 1.5183 | 0.0299 | 1.3815 | 1.6039 | 0.8626 |
13 | 26 | 5 | 0.9972 | 0.8102 | 0.0909 | 0.9532 | 0.3075 | 1.7599 | 2.7274 | 1.3870 | 0.4387 | 1.2074 | 1.4525 | 0.8531 |
14 | 10 | 10 | 0.9899 | 0.9679 | 0.5921 | 0.9556 | 0.8048 | 1.4260 | 4.0472 | 1.9901 | 0.7656 | 1.0906 | 1.8584 | 1.1100 |
15 | 22 | 1 | 1.0000 | 0.9721 | 0.6071 | 0.9916 | 0.0289 | 1.9288 | 1.8748 | 1.0724 | 0.1394 | 1.2305 | 1.2565 | 0.7146 |
16 | 21 | 10 | 1.0000 | 0.9696 | 0.4630 | 0.9862 | 0.0142 | 1.9255 | 2.2231 | 1.1973 | 0.0925 | 1.2240 | 1.3800 | 0.7527 |
17 | 20 | 4 | 0.9846 | 0.7408 | 0.7795 | 0.9335 | 0.8987 | 3.3132 | 4.3512 | 2.3776 | 0.8370 | 1.7115 | 1.8786 | 1.2384 |
18 | 9 | 10 | 0.9825 | 0.9287 | 0.7515 | 0.9411 | 0.9462 | 2.6783 | 2.5463 | 1.6632 | 0.8320 | 1.4594 | 1.3543 | 1.0455 |
19 | 8 | 10 | 0.9881 | -0.1981 | 0.3653 | 0.9222 | 0.7978 | 3.0065 | 2.7782 | 1.7496 | 0.8060 | 1.3602 | 1.5150 | 1.0596 |
20 | 30 | 1 | 1.0000 | 0.2057 | 0.6186 | 0.9388 | 0.0198 | 2.6710 | 2.9098 | 1.5968 | 0.1030 | 1.4235 | 1.4814 | 0.8302 |
Window Shift | Nodes in Hidden Layer | Random k-Fold | rTrain | rVal | rTest | rAll | rmseTrain | rmseVal | rmseTest | rmseAll | maeTrain | maeVal | maeTest | maeAll |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1 | 23 | 2 | 1.0000 | 0.9155 | 0.7070 | 0.9708 | 0.0001 | 4.2528 | 3.5339 | 2.0272 | 0.0013 | 1.9030 | 1.6235 | 0.9177 |
2 | 6 | 7 | 0.9507 | 0.9425 | 0.6550 | 0.9220 | 2.4938 | 2.9255 | 9.6783 | 4.3604 | 1.3632 | 1.4206 | 2.5213 | 1.5879 |
3 | 2 | 9 | 0.9770 | 0.8713 | 0.6412 | 0.9843 | 2.3846 | 4.1438 | 7.8081 | 3.8807 | 1.3356 | 1.7996 | 2.6360 | 1.6458 |
4 | 15 | 7 | 1.0000 | 0.9539 | 0.7680 | 0.9883 | 0.0658 | 6.1101 | 6.0553 | 3.1688 | 0.2167 | 2.1491 | 2.2607 | 1.1654 |
5 | 2 | 1 | 0.9874 | 0.9872 | 0.5924 | 0.9730 | 3.7013 | 3.1698 | 10.5128 | 5.2020 | 1.6438 | 1.5474 | 2.7606 | 1.8344 |
6 | 6 | 5 | 0.9992 | 0.9955 | 0.3366 | 0.9944 | 0.8923 | 2.4659 | 6.1146 | 2.5890 | 0.8360 | 1.3937 | 2.2803 | 1.2254 |
7 | 15 | 5 | 1.0000 | 0.9798 | 0.6795 | 0.9939 | 0.1271 | 4.0509 | 3.3589 | 1.9322 | 0.3183 | 1.7610 | 1.6064 | 0.9171 |
8 | 19 | 4 | 1.0000 | 0.9384 | 0.4742 | 0.9633 | 0.0001 | 5.4808 | 6.1400 | 3.0410 | 0.0084 | 2.0688 | 2.2174 | 1.1193 |
9 | 8 | 7 | 0.9935 | 0.8459 | 0.6343 | 0.9896 | 1.0432 | 3.6586 | 3.8642 | 2.1557 | 0.9103 | 1.7160 | 1.8277 | 1.2081 |
10 | 15 | 3 | 1.0000 | 0.9678 | 0.6576 | 0.9855 | 0.0001 | 3.7542 | 5.1327 | 2.3613 | 0.0001 | 1.7793 | 2.0605 | 1.0068 |
11 | 26 | 4 | 1.0000 | 0.9729 | 0.0627 | 0.9864 | 0.0001 | 3.1701 | 4.5313 | 2.0556 | 0.0006 | 1.5901 | 1.8997 | 0.9169 |
12 | 10 | 4 | 0.9902 | 0.9759 | 0.7244 | 0.9806 | 1.8837 | 2.8553 | 3.9303 | 2.4166 | 1.1919 | 1.5237 | 1.8189 | 1.3439 |
13 | 23 | 8 | 1.0000 | 0.9517 | 0.6145 | 0.9839 | 0.0134 | 4.3055 | 2.9516 | 1.9048 | 0.0952 | 1.8298 | 1.5628 | 0.8866 |
14 | 23 | 7 | 1.0000 | 0.9068 | 0.3747 | 0.9793 | 0.0003 | 4.1147 | 3.9275 | 2.0929 | 0.0146 | 1.8187 | 1.7477 | 0.9283 |
15 | 7 | 5 | 0.9916 | 0.9430 | 0.8540 | 0.9775 | 1.4169 | 4.0533 | 6.2570 | 3.0279 | 1.0357 | 1.9103 | 2.2464 | 1.4041 |
16 | 6 | 5 | 0.9944 | 0.9602 | 0.1182 | 0.9864 | 1.4033 | 3.9595 | 4.2563 | 2.4573 | 1.0359 | 1.8686 | 1.7771 | 1.2969 |
17 | 21 | 9 | 1.0000 | 0.9443 | 0.5080 | 0.9912 | 0.1229 | 3.6950 | 3.4038 | 1.8497 | 0.2964 | 1.8173 | 1.6913 | 0.9472 |
18 | 15 | 6 | 0.9995 | 0.9507 | 0.4649 | 0.9900 | 0.4474 | 3.2109 | 3.7319 | 1.8604 | 0.5351 | 1.5512 | 1.7002 | 0.9649 |
K-Window Size | AMAZON | APPLE | |
---|---|---|---|
30 | 66.67 | 71.90 | 70.00 |
40 | 60.50 | 73.00 | 70.00 |
50 | 64.21 | 69.47 | 73.16 |
60 | 71.11 | 63.89 | 70.00 |
70 | 69.42 | 72.33 | 75.29 |
80 | 68.75 | 68.12 | 73.75 |
Stock | LSTM | GRU | Proposed Model | |||
---|---|---|---|---|---|---|
rmse | mae | rmse | mae | rmse | mae | |
APPLE | 7.4849 | 6.1997 | 6.7798 | 5.3719 | 2.0282 | 1.0291 |
6.9836 | 5.6475 | 6.8672 | 5.0158 | 1.7208 | 0.9892 | |
AMAZON | 8.9498 | 6.7350 | 9.4086 | 6.7741 | 2.6880 | 1.1843 |
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. |
© 2025 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 (https://creativecommons.org/licenses/by/4.0/).
Share and Cite
Prajapati, J.I.; Das, R. Sliding Window-Based Randomized K-Fold Dynamic ANN for Next-Day Stock Trend Forecasting. Computation 2025, 13, 141. https://doi.org/10.3390/computation13060141
Prajapati JI, Das R. Sliding Window-Based Randomized K-Fold Dynamic ANN for Next-Day Stock Trend Forecasting. Computation. 2025; 13(6):141. https://doi.org/10.3390/computation13060141
Chicago/Turabian StylePrajapati, Jaykumar Ishvarbhai, and Raja Das. 2025. "Sliding Window-Based Randomized K-Fold Dynamic ANN for Next-Day Stock Trend Forecasting" Computation 13, no. 6: 141. https://doi.org/10.3390/computation13060141
APA StylePrajapati, J. I., & Das, R. (2025). Sliding Window-Based Randomized K-Fold Dynamic ANN for Next-Day Stock Trend Forecasting. Computation, 13(6), 141. https://doi.org/10.3390/computation13060141