View : 381 Download: 0

Stock Index Forecasting with LSTM and Attention Mechanism

Title
Stock Index Forecasting with LSTM and Attention Mechanism
Other Titles
LSTM 및 Attention Mechanism 에 의한 주가 지수 예측 - CSI300 지수를 예로 들어
Authors
LIAO, SIJIA
Issue Date
2022
Department/Major
대학원 빅데이터분석학협동과정
Publisher
이화여자대학교 대학원
Degree
Master
Advisors
신경식
Abstract
The CSI300 is an important representative stock index in China's securities market. It serves as a significant investment vehicle for investors, reflecting the entire performance of listed companies on the Shanghai and Shenzhen exchanges. Therefore, forecasting the CSI300 stock index has become a popular research topic in the financial world. Fundamental and technical analysis are the two most common techniques for stock analysis. Since the stock index is composed of many sample stocks, it is not easy to investigate each individually using fundamental analysis, leaving technical analysis as the sole option. The Efficient Market Hypothesis asserts that the efficient form of the market determines whether the technical analysis is effective. By implementing a unit root statistical test, the study verifies that China's securities market has not yet attained the weak-efficiency form, which specifies the research route of forecasting the CSI 300 index through technical analysis. Technical indicator analysis is a mainstream analysis method in technical analysis. However, it includes various complex mathematical formulas and usually requires investors to have a certain level of market sensitivity. In order to improve these shortcomings, the study proposes employing the LightGBM algorithm to automatically perform feature selection, lowering the threshold for using technical indicators to a certain extent. The study firstly constructs a factor pool composed of 36 technical indicators and selects 15 indicators as the model's input variables based on the LightGBM's feature importance ranking. The stock price index is a complex dynamic system with non-linearity, time-varying, and autocorrelation properties. Although the traditional statistical model can process non-stationary series and eliminate data noises, it is still essentially a linear model. With technology advances, machine learning and deep learning approaches can mine the non-linear relationship between data. The LSTM model, for example, can take into account the time factor with a recurrent structure and solve the long-term dependencies. On this basis, the BiLSTM model, consisting of both forward and reversed LSTM networks, can process historical and future information during training. In addition, the study introduces the Attention Mechanism to the LSTM networks, which can assign different weights to different time steps and features, to improve existing LSTM networks' performance further. The study employs the daily frequency data of the CSI300 stock index from January 1, 2010 to December 31, 2021 as the research object. We propose the BiLSTM-Attention model and test eight models, including the LSTM network, in time windows of 5, 10, 20, and 40. The empirical results suggest that the LSTM networks with an attention layer overall perform better than those without an attention layer. Among these, the proposed BiLSTM-Attention model in this research outperformed other models over a range of time windows. It achieves the best error performance under time window = 5, with testing errors of 0.02150511, 0.00087621, and 0.02960087 for MAE, MSE, and RMSE, respectively. The statistical test also shows that the proposed BiLSTM-Attention model has a better performance than the baseline LSTM model at a 1% significance level.;CSI300은 중국 증시의 대표주자 지수로 중국 증시의 상장화사 전체 실적을 반영하는 동시에 투자자들에게도 중요한 투자 수단이라는 점에서 금융 연구의 중요한 방향이 되고 있다. 펀더멘털 분석과 테크니컬 분석은 두 가지 증권 분석 방법으로 가장 많이 사용되고 있는데, 주가지수는 많은 표본주식으로 구성되기 때문에 펀더멘털 분석을 통해 성분주 한 개씩 분석하기 어려운 경우가 많기 때문에 테크니컬 분석은 적절한 분석방법으로 인식한다. 유효시장 이론에 따르면, 테크니컬 분석이 유효한지는 해당 증권시장의 유효형태에 달려 있으며, 본고에서는 시계열 데이터 단위근 검정을 통해 중국 증시가 여전히 약한 유효형태에 미치지 못하고 있다는 것을 확인하였으므로 본문의 테크니컬 분석을 통한 주가지수 예측하는 연구노선을 확정했다. 기술지표 분석법은 테크니컬 분석의 한 주류 분석 방식이지만 수학 공식은 복잡하고 종류 다양하고 투자자가 시장 민감도를 가져야 하는 단점들이 있다. 이러한 단점을 개선하기 위해, 본고에서는 LightGBM 알고리즘을 제안하여 특징 중요성 순위를 기반으로 특징 선택을 자동으로 수행함으로써 기술 지표의 사용 장벽을 어느 정도 낮출 것이다. 본고에서는 먼저 36개의 기술 지표로 구성된 피처 풀을 구축하고, LightGBM 알고리즘을 기반으로 최종 15개의 기술지표를 모델의 입력 변수로 선정하였다. 주가 지수는 비선형, 시변성, 자기 상관성 등의 특징을 가진 복잡한 동적 시스템이다. 기존의 통계 방법들은 데이터의 비정상성과 노이즈 어느 정도 처리할 수 있지만, 본질상은 여전히 선형 모델이다. 기술 발전으로 머신러닝과 딥러닝 모델들은 데이터 간의 비선형 관계를 발굴할 수 있게 되고, 그 중에서 순환 구조를 갖는 LSTM 모델은 시간적 요인까지 고려하면서 장기 의존성 문제도 해결하고 긴 시퀀스 예측에 많이 사용하고 있습니다. BiLSTM 모델은 훈련 시 정방향과 역방향의 시계열을 동시에 고려할 수 있어 LSTM 모델보다 정확도를 한층 높였다. 이를 바탕으로 금융 시계열의 특징에 더욱 적합하기 위해, 본고에서는 LSTM 네트워크에 어텐션 메커니즘(Attention Mechanism)을 도입하여 시간 단계 및 특징에 따라 서로 다른 가중치를 부여하며, 현재의 LSTM 네트워크를 더욱 최적화하고자 한다. 본고에서는 CSI300주가 지수 2010년 1월 1일부터 2021년 12월 31일까지 총 12년간의 일일 데이터를 연구 대상으로 선정하여 BiLSTM-Attention 모델을 제시하고, LSTM 네트워크 및 제시한 모델을 비롯한 총 8개 모델을 각각 시간 단계5일, 10일, 20일, 40일에서 모델 퍼포먼스를 검증하였다. 실증 결과는 어텐션 메커니즘을 도입한 LSTM 네트워크들이 어텐션 메커니즘이 없는 모델들보다 전반적으로 우수하는 것을 보였다. 이 중 본고에서 제시한 BiLSTM-Attention 모델은 다른 모델들에 비해 더욱 우수한 결과를 보였다. 시간 단계는 5일 인 경우에서 가장 낮은 에러를 얻었으며 테스트 세트의 MAE, MSE, RMSE는 각각 0.02150511, 0.00087621, 0.02960087이었다. 본고에서는 또한 예측 결과에 대한 유의성검정을 실시하였으며, 벤치마크 모델인 LSTM과 비교했을 때, 1% 유의수준에서 BiLSTM-Attention모델이 더 현저하게 우수한 성과를 보였다.
Fulltext
Show the fulltext
Appears in Collections:
일반대학원 > 빅데이터분석학협동과정 > Theses_Master
Files in This Item:
There are no files associated with this item.
Export
RIS (EndNote)
XLS (Excel)
XML


qrcode

BROWSE