Font Size: a A A

Prediction And Analysis Of Shanghai And Shenzhen 300 Index Based On BP Neural Network

Posted on:2020-05-01Degree:MasterType:Thesis
Country:ChinaCandidate:W B SunFull Text:PDF
GTID:2428330596481761Subject:Master of Applied Statistics
Abstract/Summary:PDF Full Text Request
Nowadays more and more people are studying stocks.Many experts and scholars are also very keen on this field,and they also bring many very complicated and confusing problems.However,the securities market is extremely complex,it is a nonlinear system,and many people are using neural networks for stock price prediction,but the neural network has a big flaw,that is,the choice of variables and initial weights and thresholds.It has a lot of randomness,which brings great problems to our prediction.In order to solve the problem of neural network prediction of stock price,some scholars have proposed a combination of genetic algorithm and neural network to solve this problem.The genetic algorithm uses a fitness function as the standard,and then continuously selects the sample variables.The greater the fitness,the more opportunities are passed on to the next generation.Correspondingly,the smaller the fitness,the more natural it will be eliminated.By encoding the number of input layer variables of the BP neural network,the selection is based on the degree of fitness,and the final selected variable is a relatively high quality individual.Secondly,the initial weight threshold of the neural network can be globally optimized,which can prevent the neural network from prematurely converging,the number of training times is very high,moreover it is easy to be lost in the local minimum.According to the experience of previous scholars,only the BP neural network is used to predict the stock price,and the prediction effect is not very satisfactory.In view of this,the paper uses three models to predict the Shanghai and Shenzhen 300 Index.Firstly,a single BP neural network is used to predict and analyze the Shanghai and Shenzhen 300 Index,and the Shanghai and Shenzhen 300 Index will be predicted for the next 100 trading days.The predicted error(mean absolute error)is 40.9928.Then,for BP neural network,the number of variables should not be too much,and it should not be too small.To make the prediction error very small,it is necessary to continuously screen and test several times to find the most appropriate number.Next we will use genetic algorithms to optimize the variables.so that the variables obtained are relatively high quality and concise.The optimized variables are further predicted by neural network,and Prediction accuracy is higher than that of a single BP neural network,and the prediction accuracy is further improved.Forecasting the next 100 trading days of the Shanghai and Shenzhen 300 Index,the prediction error(mean absolute error)is 36.7284.Finally,based on the combination of variable optimization,the initial weights and thresholds of the BP neural network are optimized.At the same time,the fitness function of the genetic algorithm is improved,and the prediction error and the number of variables are taken into account.The linear function of the prediction error and the number of variables is taken as the fitness function,and the different weights and corresponding adjustments are given.In this way,the introduction of variables into the fitness function can ensure that the next generation of individuals has higher quality individuals.We know that the smaller the prediction error,the higher the individual's fitness.When the two individuals have similar prediction errors,we tend to choose individuals with fewer variables.After two optimized BP neural network models,the Shanghai-Shenzhen 300 index is predicted again.The prediction error is smaller than that of the single BP neural network model.The prediction accuracy is higher and the fitting effect is better.Forecasting the next 100 trading days of the Shanghai and Shenzhen 300 Index,the predicted error(mean absolute error)is 34.2587.
Keywords/Search Tags:BP neural network, Genetic algorithm, Fitness function, Shanghai and Shenzhen 300 Index
PDF Full Text Request
Related items