Abstract:
"The Colombo Stock Exchange (CSE), a pivotal entity in Sri Lanka's emerging market, is
characterized by its diverse sector representation and the complex, dynamic nature of its
stock market trends. This study delves into the intricacies of predicting these trends, focusing
on the significance of incorporating multivariate time series analysis and the influence of
external factors, particularly the USD/LKR exchange rate, on forecasting accuracy. The
challenge of enhancing model understandability and trust through Explainable Artificial
Intelligence (XAI) is also addressed, highlighting the importance of transparency in financial
modeling.
To tackle the forecasting challenges, this research employs a Bidirectional Long Short-Term
Memory (LSTM) model, leveraging its ability to process data sequences in both forward and
backward directions. This approach is augmented by the inclusion of dense layers and a
Lambda layer for output scaling, aiming to capture and interpret complex temporal
relationships within the market data effectively. The technical framework is designed to
consider the USD/LKR exchange rate as an exogenous variable, acknowledging its
significant impact on the CSE dynamics. Moreover, the application of XAI principles enables
a deeper understanding of the model's decisions, fostering trust and facilitating critical
evaluation by end-users.
The evaluation across forecasting models for the Colombo Stock Exchange underscored the
LSTM model's standout accuracy, evidenced by the lowest Mean Absolute Error (MAE) of
12.89 and Mean Squared Error (MSE) of 335.24, marking it as exceptionally precise in
predicting market trends. In comparison, models such as Random Forest, ElasticNet, Lasso,
XGBoost, and Gradient Boosting displayed higher MAE and MSE figures, with XGBoost
recording the highest MSE at 421.33, indicating varying degrees of predictive accuracy.
Notably, the LSTM model also excelled in the Mean Absolute Percentage Error (MAPE) at
8.00% and achieved the lowest Theil's U statistic at 0.812, underscoring its superior
forecasting capability. This comprehensive performance establishes the LSTM as the most
effective and reliable model for navigating the complexities of stock market forecasts in this
analysis."