It is no doubt challenging to forecast the stock market accurately in reality due to the ever-changing market. Ever since Artificial Neural Networks (ANNs) have been recognized as universal approximators, they are extensively used in forecasting albeit not having a systematic approach in identifying optimal input. The appropriate number of significant lags of a time series corresponds to the optimal input in time series forecasting. Hence, this study aims to compare the effect of several approaches in determining the input lag for ANNs prior to stock market forecasting, based on the autocorrelation function, the partial autocorrelation function, the Box–Jenkins model and forward selection. The forecast performances of the ANNs were compared with benchmark models, namely the naïve and Box–Jenkins models, in terms of error magnitudes and trend change error. In this study, all ANNs were found to outperform the benchmark models such that the neural network model trained with lags selected from forward selection of lag 1 and lag 31 (ANN4) is the best model as it achieved the highest accuracy with the lowest mean absolute percentage error and mean absolute error. Contrary to expectations, all models performed poorly in forecasting the trend change of the stock series. The ANNs with different inputs are viable in quantitative stock market forecasting yet more research is required to better understand other trend change measurements and improve the performance of forecasting the trend change of stock market.
- Phuoc T., Anh P. T. K., Tam P. H., Nguyen C. V. Applying machine learning algorithms to predict the stock price trend in the stock market – The case of Vietnam. Humanities and Social Sciences Communications. 11, 393 (2024).
- Bustos O., Pomares-Quimbaya A. Stock market movement forecast: A Systematic review. Expert Systems with Applications. 156, 113464 (2020).
- Dokuchaev N. On statistical indistinguishability of complete and incomplete discrete time market models. Decisions in Economics and Finance. 46, 461–475 (2023).
- Rodriguez F. S., Norouzzadeh P., Anwar Z., Snir E., Rahmani B. A machine learning approach to predict the S&P 500 absolute percent change. Discover Artificial Intelligence. 4, 8 (2024).
- Hiransha M., Gopalakrishnan E. A., Menon V. K., Soman K. P. NSE Stock Market Prediction Using Deep-Learning Models. Procedia Computer Science. 132, 1351–1362 (2018).
- Naeini M. P., Taremian H., Hashemi H. B. Stock market value prediction using neural networks. 2010 International Conference on Computer Information Systems and Industrial Management Applications (CISIM). 132–136 (2010).
- Tanuwijaya R., Saputra K. V. I., Ferdinand F. V. Comparison of ARIMA, ARFIMA and Artificial Neural Network Models for Indonesian Stocks Market. ICIC Express Letters, Part B: Applications. 14 (10), 1095–1106 (2023).
- Kalliola J., Kapočiūtė-Dzikienė J., Damaševičius R. Neural Network Hyperparameter Optimization for Prediction of Real Estate Prices in Helsinki. PeerJ Computer Science. 7, e444 (2021).
- Rahman N. H. A., Yin C. H., Zulkafli H. S. Activation functions performance in multilayer perceptron for time series forecasting. AIP Conference Proceedings. 3123 (1), 070001 (2024).
- Bowden G. J., Dandy G. C., Maier H. R. Input determination for neural network models in water resources applications. Part 1 – Background and methodology. Journal of Hydrology. 301 (1–4), 75–92 (2005).
- Sánchez-Sánchez P. A., García-González J. R., Coronell L. H. P. Encountered Problems of Time Series with Neural Networks: Models and Architectures. Recent Trends in Artificial Neural Networks – from Training to Prediction. 1–17 (2019).
- Zhang G., Patuwo B. E., Hu M. Y. Forecasting with artificial neural networks: The state of the art. International Journal of Forecasting. 14 (1), 35–62 (1998).
- Pandey V. S., Bajpai A. Predictive Efficiency of ARIMA and ANN Models: A Case Analysis of Nifty Fifty in Indian Stock Market. International Journal of Applied Engineering Research. 14 (2), 232–244 (2019).
- BuHamra S., Smaoui N., Gabr M. The Box–Jenkins analysis and neural networks: prediction and time series modelling. Applied Mathematical Modelling. 27 (10), 805-815 (2003).
- Siqueira H., Macedo M., Tadano Y. d. S., Alves T. A., Stevan S. L. (Jr.), Oliveira D. S. (Jr.), et al. Selection of Temporal Lags for Predicting Riverflow Series from Hydroelectric Plants Using Variable Selection Methods. Energies. 13 (16), 4236 (2020).
- https://finance.yahoo.com
- Sarle W. S. Neural Networks and Statistical Models. Proceedings of the Nineteenth Annual SAS Users Group International Conference, Cary, NC: SAS Institute, USA. 1538–1550 (1994).
- Demir S., Sahin E. K. The effectiveness of data pre-processing methods on the performance of machine learning techniques using RF, SVR, Cubist and SGB: a study on undrained shear strength prediction. Stochastic Environmental Research and Risk Assessment. 38, 3273–3290 (2024).
- Witten I. H., Frank E., Hall M. A., Pal C. J. Data Mining Practical Machine Learning Tools and Techniques. Elsevier Science; 4th edition (2016).
- Cowpertwait P. S. P., Metcalfe A. V. Introductory Time Series with R. Biometrics. 67 (1), 328–329 (2011).
- May R., Dandy G., Maier H. Review of Input Variable Selection Methods for Artificial Neural Networks. Artificial Neural Networks - Methodological Advances and Biomedical Applications. Vol. 2 (2011).
- Hyndman R., Athanasopoulos G. Forecasting: Principles and Practice. Otexts; 2nd edition (2018).
- Haw L. K., Nor M. E., Shab N. F. M. The Impact of Government Policy Changes on Stock Market Forecasting. Proceedings of the 8th International Conference on the Applications of Science and Mathematics. 301–315 (2023).
- Kingma D. P., Ba J. Adam: A Method for Stochastic Optimization. Conference Paper at the 3rd International Conference for Learning Representations, San Diego (2015).