VIETNAM NATIONAL UNIVERSITY UNIVERSITY OF ECONOMICS & BUSINESS FACULTY OF FINANCE - BANKING GRADUATION THESIS DEEP LEARNING FOR PREDICTING STOCK MARKET INDEX Instructor: Dr. Nguyen Tien Chuong Student: Nguyen Quang Bac Student ID: 20050408 Class: QH2020E TCNH CLC 3 Course code: FIB4151 Ha Noi, 2023 VIETNAM NATIONAL UNIVERSITY UNIVERSITY OF ECONOMICS & BUSINESS FACULTY OF FINANCE - BANKING GRADUATION THESIS DEEP LEARNING FOR PREDICTING STOCK MARKET INDEX Instructor: Dr. Nguyen Tien Chuong Student: Nguyen Quang Bac Student ID: 20050408 Class: QH2020E TCNH CLC 3 Course code: FIB4151 Ha Noi, 2023 ACKNOWLEDGMENTS During the time of researching and implementing this research, I have received very enthusiastic help and valuable words of encouragement. With all respect and gratitude, I would like to express our sincere thanks to: The Board of Directors of the University of Economics and Business —Vietnam National University has built a learning environment that helps me as well as the students of the whole university to be motivated, opportunities to access and practice scientific research.
I sincerely thank the teachers and experts of the Faculty of Finance and Banking and other faculties in the university for taking the time to answer and analyze the questions, contributing to creating a foundation to help me confidently implement this research. I would like to express my deep gratitude to Dr. Nguyen Tien Chuong - the person. who directly guided me.
He is a very dedicated and enthusiastic teacher with new directions, detailed communication, frank suggestions and especially he is always conscious to show me the greatest value I receive after completing my research. I feel very fortunate to receive his support. TABLE OF CONTENT PART 1: INTRODUCTION. The relevance of the research topic.
SG SH HH ng ng 2 In. Research co ha. Materials ao nn ee. Expected research COntrIDUfIOIS.- s6 55 + S211 3 1E 9v re 3 In oi ố ố.
3 PART 2: THEORETICAL BASIS AND LITERATURE REVIEW. Overview of deep learning .- --- 1191991191 1v vn ng ngư, 72. Overview of Deep learning for predicting time S€T1€s.A review of related previous StUCIES. Review of research abroad .- - -- + xxx k9 9 th ng ngư 10 2.
Review of research in Vietnam. 14PART 3: RESEARCH METHODOLOGY .1 Long short-term memory (LSTM). Gated recurrent unit (GIRÙ). Convolution neural networks (CNN).
Data set and BIŠ0si 50:0 1E. Data denoising, normalization and input preparation. Feature SELECTION Strate VY 0. Model performance IT€fTICS.- 2 + + + k1 E91 1E kg vn ng g 313.6 Implementation DFOC€SS.
-- --- - + 119119911911 911 91191 1 nh gi ng ngà 34 PART 4: EXPERIMENT AND RESULTS. Single layer deep learning model reSuÏ(S. -- -- ¿+ +++<s++se++eex+sex+ze+ 36 4. Multilayer Deep learning r€SuÏ(S.
Comparison of single and multilayer deep learning models .- Ăn HH HH HH 00 0000600000800008 00647 5. Directions for future Studies .- 5 s3 3 HH HH nghiệt 48 REEERENCES. o5 G000 00005009609006 49 LIST OF ACRONYMS No ABBREVIATION EXPANSION Artificial intelligence oOla Deep Learning HAR Human activity recognition RNN Recurrent neural network LSTM Long short-term memory GRU Gated recurrent unit CNN Convolution neural network ARIMAX Autoregressive integrated moving average with exogenous inputs mm VNINDEX Vietnam stock market index RMSE Root Mean Square Error MAPE Mean Absolute Percentage Error ee. 1 LIST OF TABLES =T——= _—T- Table 4.1 List of the best hyperparameters for single-neurons LSTM, 37 GRU, and CNN models The performance scores of the single layer deep learning models in the test data Table 4.3 List of the best hyperparameters for multi-layer LSTM, GRU, and CNN models The performance scores of the best multi-layer deep learning models in the test data of the model’s performance.
il LIST OF FIGURES Fig.1 Long short-term memory (LSTM) architecture Fig 3.2 Gated Recurrent Unit (GRU) architecture m 19 CNN architecture with m filters for multivariate time series 22 prediction.4 Train, Validation and Test Split Dataset Fig.5 Correlation heatmap among the variables Fig 3.6 Schematic diagram of the proposed research framework 35 Fig.1 VNINDEX closing price along with moving averages 36 Fig 4.2 Average scores obtained from LSTM, GRU, and CNN models: Gs3)5 (a) RMSE, (b) MAPE, and (c) R on test dataset. Boxplots of metrics: (a) RMSE, (b) MAPE, and (c) R of the \o single-neurons LSTM, GRU, and CNN models True vs predicted plots of the single layer models: (a) LSTM, (b) GRU, and (c) CNN on test data. Time series plots of the true and predicted values obtained + fan) from GRU model with 150 neurons. Average scores obtained from multi-layer LSTM, GRU, and =NS) CNN models: (a) RMSE, (b) MAPE, and (c) R on test dataset.
Boxplots of metrics: (a) RMSE, (b) MAPE, and (c) R of the + oO best multi-layer LSTM, GRU, and CNN models True vs predicted plots of the best multi-layer models: (a) LSTM, (b) GRU, and (c) CNN on test data Time series plots of the true and predicted values obtained from GRU model with (100, 50) neurons. multilayer deep learning models. The relevance of the research topic The stock market, also known as the equity market, exerts a significant influence on today's economy. According to the efficient market hypothesis, stock prices are not predictable, and their movements are essentially random.
However, recent technical analysis has shown that most of the stock value is reflected in historical data; therefore, understanding trends is crucial for effective predictions (Akhter and Misir, 2005). Moreover, stock markets are subject to the influence of a wide array of economic factors, including political events, the overall economic climate, commodity price indices, investor expectations, movements in other stock markets, and investor psychology, among other factors (Miao et al. Different technical indicators are used to derive statistical data from stock prices (Lehoczky, Schervish, 2018). In general, stock market indices, derived from stock prices, are heavily influenced by investment activities in the market and often serve as indicators of a country's economic conditions.
The nature of stock price fluctuations is uncertain and presents risks for investors. The rise or fall in share prices plays a crucial role in determining an investor's profit. Predicting stock prices has always been a_ challenging problem, primarily due to its inherent unpredictability in the long term (Asadi et al, 2012). Forecasting stock prices is regarded as one of the most difficult tasks to accomplish in financial forecasting due to the complex nature of the stock market.
Prediction will continue to be an interesting area of research making researchers in the domain field always desiring to improve existing predictive models. The reason 1s that institutions and individuals are empowered to make investment decisions and ability to plan and develop effective strategies about their daily and future endeavors. The desire of many investors is to lay hold of any forecasting method that could guarantee easy profiting and minimize investment risk from the stock market. This remains a motivating factor for researchers to evolve and develop new predictive models (G.
1 The existing methods for stock price forecasting can be classified as follows: Fundamental Analysis, Technical Analysis, Time Series Forecasting. Fundamental analysis is a type of investment analysis where the share value of a company is estimated by analyzing its sales, earnings, profits and other economic factors. This method is most suited for long-term forecasting. Technical analysis uses the historical price of stocks for identifying the future price.
This method is suitable for short term predictions. The third method is the analysis of time series data. It involves basically two classes of algorithms; they are Linear Models and Non-Linear Models. The existing forecasting methods make use of both linear (AR, MA, ARIMA) and non-linear algorithms (ARCH, GARCH, Neural Networks), but they focus on predicting the stock index movement or price forecasting for a single stock using the daily closing price.
Here we are not fitting the data to a specific model, rather we are identifying the latent dynamics existing in the data using deep learning architectures. In this work we use three different deep learning architectures (LSTM, RNN, CNN) for the price prediction of VNINDEX and compare their performance. Research objectives The objective of this research is to construct a model for predicting the price of the VNINDEX using Deep Learning (DL), optimizing the model's parameters, and evaluating its performance in predicting stock price trends in the future. By employing Deep Learning, we hope that this study will contribute to enhancing predictive capabilities and supporting investment decisions in the stock market sector.
Research questions The prediction model for stock prices using Deep Learning can achieve high accuracy and reliability in forecasting future stock price trends. The impact of changes in the Deep Learning model, such as using different neural network layers or different parameter configurations, on the ability to predict stock prices. The best method to use for predicting the Vietnam stock market index. Research scope Scope of content: Vietnam's stock market index (VNINDEX).
Scope of time: From October 16, 2000, to October 6, 2023 1. Materials and methods Since the research focuses on mathematical modeling, the methodology will primarily involve quantitative methods and machine learning model training. Expected research contributions The research topic will contribute to the study and development of prediction methods and models for the VNINDEX and stock prices using the Deep Learning model. By applying and analyzing the prediction results on real stock data, the research can provide valuable insights into the effectiveness and applicability of the Deep Learning model in predicting the VNINDEX and stock prices in the Vietnamese market.
The findings from this research can help investors better understand stock price predictions, enabling them to make more informed investment decisions. This, in turn, has the potential to optimize profits and reduce risks in the Vietnamese stock market. Additionally, the results of this research can serve as a reference for future studies that utilize machine learning models to predict the stock market index and stock prices. Research structure The rest of the research includes the following content: Part 2: An overview introduction to the research field of stock price prediction and the foundational knowledge that will be included in the research.
Specifically, this chapter will introduce the fundamental concepts of AI, as well as the deep learning model. Part 3: In this part, I will delve into the proposed model and describe in detail the features of the Deep Learning model for stock price prediction. Additionally, data preprocessing steps, model training, model evaluation methods will be discussed. 3 Part 4: Presentation of experiments and comparison of the test results for each model.
Different dataset organization approaches will be explored, leading to observations about the implemented models and the selection of an optimal model based on visualized results. Part 5: Presents the conclusion and future work, followed by a list of references, and appendix. PART 2: THEORETICAL BASIS AND LITERATURE REVIEW 2. Overview of AI Artificial intelligence (AI), known as a kind of machine intelligence, generally means the intelligence showcased by man-made machines.
Typically, AI is defined as a typical type of computer program that emulates human intelligence. General textbooks describe it as the study and creation of an intelligent agent capable of observing its environment and taking actions to fulfill tasks given by human instructions (Russell et al. Classical definitions posit that AI, as an intelligent system, possesses the ability to accurately interpret external data and use that information as knowledge to accomplish its missions with adaptability demonstrated throughout the process (Russell et al. The field of artificial intelligence research is intricate and demands specialized knowledge for comprehension.
It encompasses a broad and diverse array of subfields that are deep but not necessarily interconnected. Key areas of focus include the development of reasoning, knowledge, planning, learning, communication, perception, manipulation of objects, tool usage, and control of machines, all with the aim of making machines similar to or even surpassing human capabilities. A wide range of tools employing AI technology are utilized, spanning from research and mathematical optimization to logical deduction.