| From the day of its birth,stocks have the characteristics of high risk and high yield,and are sought after by many investors because of their high yield.In order to pursue high returns,investors and related researchers have been trying various methods and means to predict stock prices.In the early days of stock theory research,most experts in the financial field used fundamental analysis to study stock price theory.However,when statistical theory flourished and more and more statistical theories could be realized at the computer level,scholars found that modeling stock price data could well handle the problem of stock price forecasting.Because the statistical theory is relatively simple and the prediction results are satisfactory,the method is rapidly popularized in the field of stock price prediction.Later,with the development of deep learning,theories such as Recurrent Neural Network(RNN)and Long Short-Term Memory Neural Network(LSTM)emerged.Scholars found that they can not only be applied to the research and analysis of nonlinear data,but also can retain valuable historical data.information,which solves an important problem in stock price forecasting.In the field of quantitative finance,an important research topic is how to accurately predict stock prices.The emergence of long short-term memory neural network(LSTM)provides a new idea for the complex problem of stock price prediction.Previous studies have shown that only using this method may produce unbalanced predictions and fall into local optimal solutions.Due to the existence of the above problems,this thesis adopts the Genetic Algorithm(GA)when optimizing the hyperparameters of the LSTM model,trying to find the optimal time window width and the number of neurons in the hidden layer.The first chapter of this thesis describes the research background of the research significance and the research status of genetic algorithm and neural network.The second chapter describes the relevant theoretical foundation,including the theory of stock forecasting,genetic algorithm and neural network.The third chapter describes some methods of data processing and indicators for evaluating model processing.The data used in this thesis are from January 4,2000 to December 31,2021 on the Shanghai Composite Index,Shenzhen Composite Index,Shenzhen Component Index and April 2005.The CSI 300 Index from January 8 to December 31,2021.The prediction indicators are the Mean Absolute Percentage Error MAPE and the Coefficient of Determination R~2.The fourth chapter describes the stock price index prediction model based on long short-term memory neural network(LSTM)of genetic algorithm.In this chapter,the genetic algorithm is used to optimize the hyperparameters in the long short-term memory neural network,and the optimal time window and the optimal number of hidden layer units are found.Substitute the optimized parameters into the long short-term memory neural network model,and get the conclusion that the LSTM model optimized by the genetic algorithm is more accurate than the LSTM model.And the RNN model is also used to predict the stock price,which shows that the LSTM model has a better prediction effect than the RNN,indicating that in terms of prediction,LSTM has a long-term memory function due to the settings of the forget gate,input gate,and output gate.Better than RNN models.The fifth chapter draws conclusions and prospects.The empirical results show that compared with the RNN model,the LSTM model has better prediction effect,and the LSTM model optimized by the genetic algorithm is better than the LSTM model in the prediction effect.The genetic algorithm aims at maximizing the fitness value,and iterates the population continuously to select the optimal time window width and the optimal hidden layer neural unit.The empirical results show that the genetic algorithm is effective in improving the prediction accuracy of the LSTM model. |