BILSTM Model for Machine Learning Stock Prediction and Portfolio Construction in the Context of Covid-19 Pandemic

Authors

  • Kaiting Li

DOI:

https://doi.org/10.61173/q8zeqe61

Keywords:

Stocks prediction, Machine learning, Investment portfolio

Abstract

This study used Bidirectional Long Short Term Memory (BiLSTM) neural network model to learn the stock prices of six representative companies from different industries, and evaluated their performance during the period significantly affected by the COVID-19 pandemic from 2019 to 2021. These companies represent industries such as finance, industrial manufacturing, energy, technology, biopharmaceuticals, and consumer goods. A set of characteristic indicators, such as moving averages, momentum indicators, and trading volume based indices, were designed based on historical stock data to provide input data for the BiLSTM model and enhance its ability to capture temporal dynamics of data. The predictive ability of the model is evaluated through performance indicators such as mean square error. This study also applies Monte Carlo simulation to construct investment portfolios based on model predictions, exploring the optimal asset allocation to maximize Sharpe’s ratio or minimize volatility at different stages of the COVID-19 crisis. The research results indicate that the BiLSTM model effectively predicts stock price trends, especially when market conditions are stable, by utilizing its ability to simultaneously process past and future input data. Despite facing challenges in predicting accuracy during extreme market fluctuations, such as those experienced in the stage of the outbreak of the pandemic, the overall performance of the model is good. The investment portfolio constructed using these predictions performs better than the S&P 500 index, demonstrating superiority in both return and risk levels, highlighting the effectiveness of combining machine learning technology with financial investment portfolio management strategies.

References

[1] Sheth, D., Shah, M. Predicting stock market using machine learning: best and accurate way to know future stock prices. Int J Syst Assur Eng Manag 14, 1–18 (2023).

[2] Zhang, X., Gu, N., Chang, J., & Ye, H. (2021). Predicting stock price movement using a DBN-RNN. Applied Artificial Intelligence, 35(12), 876–892.

[3] Chen, Wei, et al. “Mean–variance portfolio optimization using machine learning-based stock price prediction.” Applied Soft Computing 100 (2021): 106943.

[4] Hochreiter, Sepp, and Jürgen Schmidhuber. “Long short-term memory.” Neural computation 9.8 (1997): 1735-1780.

[5] Moghar, Adil, and Mhamed Hamiche. “Stock market prediction using LSTM recurrent neural network.” Procedia computer science 170 (2020): 1168-1173.

[6] Widiputra, Harya, Adele Mailangkay, and Elliana Gautama. “Multivariate cnn-lstm model for multiple parallel financial time-series prediction.” Complexity 2021 (2021): 1-14.

[7] Yang, Mo, and Jing Wang. “Adaptability of financial time series prediction based on BiLSTM.” Procedia Computer Science 199 (2022): 18-25.

[8] Zhang, Jilin, Lishi Ye, and Yongzeng Lai. “Stock price prediction using CNN-BiLSTM-Attention model.” Mathematics 11.9 (2023): 1985.

[9] Yun, Kyung Keun, Sang Won Yoon, and Daehan Won. “Prediction of stock price direction using a hybrid GA-XGBoost algorithm with a three-stage feature engineering process.” Expert Systems with Applications 186 (2021): 115716.

[10] Yun, Kyung Keun, Sang Won Yoon, and Daehan Won. “Interpretable stock price forecasting model using genetic algorithm-machine learning regressions and best feature subset selection.” Expert Systems with Applications 213 (2023): 118803.

[11] Iqbal, Roihans Muhammad, and Hari Purwanto. “Risk analysis of investment costs in PPP projects using Monte Carlo simulation.” Logic: Jurnal Rancang Bangun dan Teknologi 22.1 (2022): 13-21.

Downloads

Published

2024-08-14