Font Size: a A A

Research On Stock Price Prediction Based On Joint Loss Function CNN-GRU Model

Posted on:2024-01-04Degree:MasterType:Thesis
Country:ChinaCandidate:Q J HaoFull Text:PDF
GTID:2530307052972779Subject:Financial statistics
Abstract/Summary:PDF Full Text Request
Traditional stock price prediction methods often have a strong lag and rely too much on previous information when predicting stock prices.This paper aims to combine the mean square error loss function and the binary cross-entropy loss function to obtain a joint loss function,which is used in this special issue of stock price forecasting to weaken the hysteresis of the model’s prediction results.The methods used in the modeling in this paper are the neural network method and the time series analysis method.The specific neural network model is the Convolutional Neural Networks-Gate Recurrent Unit(CNN-GRU)model,and the comparison models include Convolutional Neural Networks(CNN)and Gate Recurrent Unit(GRU)model,and the traditional differential autoregressive moving average model(Autoregressive Integrated Moving Average Model,ARIMA).The mean square error loss function,the binary cross entropy loss function,and the mean square error and binary cross entropy joint loss function are respectively used in the modeling of the neural network model.When comparing models,use the mean square error and the area under the receiver operating characteristic curve(AUC)for comparison,and use the bootstrap method to construct samples for the t-test.This paper verifies that the stock is Jiangshan through the method of random sampling selection,and uses the data from 2017 to 2021 to establish neural network models such as CNN-GRU and autoregressive moving average models.The results show that the AUC of the CNN-GRU model using the mean square error loss function to predict the stock rise and fall on the training set is 0.579.After changing the loss function used by the training model to the joint loss function of mean square error and cross-entropy loss,the AUC of the model increases to 0.630.During modeling,it is found that the CNN model uses the mean square error loss function during the training process,and the gradient explosion phenomenon occurs,while the joint loss function using the mean square error and cross-entropy loss does not have this problem.Through comparison,this paper finds that the AUC of the CNN-GRU model without the joint loss function is higher than that of the traditional time series model,but the difference between the mean square error and the time series model is not large;the model is compared by t-test among the differences,the AUC of the CNN-GRU model using the joint loss function is found to be the largest.Through further comparative analysis,this paper finds that the CNN-GRU model using the joint loss function can weaken the hysteresis of the model on the stock price prediction problem to a certain extent.Therefore,the CNN-GRU model of the joint loss function used in this paper performs better on the problem of predicting stock prices.And the joint loss function of cross entropy and mean square error can avoid the gradient explosion problem of the CNN model in stock price prediction,and can also weaken the hysteresis of stock price prediction to a certain extent.Therefore,the method used in this paper can better provide investors with stock trading decision-making suggestions.
Keywords/Search Tags:Joint Loss Function, Time Series, Mean Square Error, AUC, CNN-GRU
PDF Full Text Request
Related items