Font Size: a A A

Empirical Analysis Of LSTM Stock Forecast Model Based On Attention Mechanism

Posted on:2022-04-05Degree:MasterType:Thesis
Country:ChinaCandidate:H Y ZhangFull Text:PDF
GTID:2480306473488934Subject:Finance
Abstract/Summary:PDF Full Text Request
Long Short-Term Memory(LSTM)model is proposed for the performance degradation of RNN model when training Long time series data.Three kinds of "gating devices" were added to the model to solve the gradient vanishing and explosion problems in the RNN model.At the same time,the three kinds of gate devices in the LSTM model independently control the input and output of the data to form an independent memory of the data,so as to solve the problem of forgetting when fitting the long-sequence data.Compared with the traditional RNN network,the LSTM model has a great advantage in the fitting analysis of nonlinear correlation data because it builds a nonlinear activation function inside it.At the same time,in order to solve the problem when the input time series data is very long,the LSTM model is difficult to learn the deep relationship contained in the long time series data.Therefore,this paper introduces the ATTENTION mechanism,which retains the intermediate training results of LSTM in data fitting,and then trains a new model to selectively learn these intermediate training results and assign different weights to them.Finally,the intermediate results are correlated with the final results of the model when it outputs the final results.To improve the training performance of LSTM model.In this paper,the LSTM model is used to make an empirical analysis on the trend and rise and fall of stock prices to study the applicability of the ATTENTION mechanism and the LSTM model in the stock market.And the modeling is the emergence of some problems are summarized and analyzed,and put forward the solution to these problems.It is hoped that this paper can provide some information with practical application value and reference value for the establishment of stock forecast model.This paper selects all the historical trading data from Wind database,including the opening price,closing price,high price,low price and other basic trading information of the CSI 500 index.And according to the basic trading data calculated MA,KD,WR,MACD,RSI,CCI and other 6 technical indicators.In the experiment,the LSTM model is used to predict the trend and rise and fall of the stock index from the perspectives of single feature and multi-feature,and is compared with the traditional ARIMA model.At the same time,the attention mechanism was added to the LSTM model and compared with the single LSTM model to explore the improvement of the prediction effect of the attention mechanism on the LSTM model.Through the study and analysis of the experimental results,it is found that the attention mechanism can greatly improve the accuracy of the model.It shows that the LSTM model with the introduction of the ATTENTION mechanism has a wide range of applicability in stock prediction.At the end of the paper,in view of the over-fitting and fluctuation of accuracy in the LSTM model,we reduce the learning rate,adjust the batch size,standardize and regularize the data for optimization.
Keywords/Search Tags:stock prediction, Long and short term memory, Attention mechanism
PDF Full Text Request
Related items