Improving Forecasting Accuracy of Stock Market Indices Utilizing Attention-Based LSTM Networks with a Novel Asymmetric Loss Function
Open Access
Abstract
This study presents a novel approach to financial time series forecasting by introducing asymmetric loss functions. This is specifically designed to enhance directional accuracy across major stock indices (S&P 500, DJI, and NASDAQ Composite) over a 33-year time period. We integrate these loss functions into an attention-based Long Short-Term Memory (LSTM) framework. The proposed loss functions are evaluated against traditional metrics such as Mean Squared Error (MSE), Mean Absolute Error (MAE), and other recent research-based losses. Our approach consistently achieves superior test-time directional accuracy, with gains of 3.4–6.1 percentage points over MSE/MAE and 2.0–4.5 percentage points over prior asymmetric losses, which are either non-differentiable or require extensive hyperparameter tuning. Furthermore, proposed models also achieve an F1 score of up to 0.74, compared to 0.63–0.68 for existing methods, and maintain competitive MAE values within 0.01–0.03 of the baseline. The optimized asymmetric loss functions improve specificity to above 0.62 and ensure a better balance between precision and recall. These results underscore the potential of directionally aware loss design to enhance AI-driven financial forecasting systems.Keywords
This publication has 24 references indexed in Scilit:
- Mean Absolute Directional Loss as a new loss function for machine learning problems in algorithmic investment strategiesJournal of Computational Science, 2024
- Forecasting Directional Movement of Stock Prices using Deep LearningAnnals of Data Science, 2022
- Forecasting directional movements of stock prices for intraday trading using LSTM and random forestsFinance Research Letters, 2022
- Deep learning with long short-term memory networks for financial market predictionsEuropean Journal of Operational Research, 2018
- Predicting stock market index using fusion of machine learning techniquesExpert Systems with Applications, 2015
- Properties of optimal forecasts under asymmetric loss and nonlinearityJournal of Econometrics, 2007
- Forecasting stock market movement direction with support vector machineComputers & Operations Research, 2005
- Financial time series forecasting using support vector machinesNeurocomputing, 2003
- Outline of forecast theory using generalized cost functionsSpanish Economic Review, 1999
- Generalized autoregressive conditional heteroskedasticityJournal of Econometrics, 1986