Empirical mode decomposition and distributed GRU neural network and price prediction method
1. A method for predicting the price of a certain provincial livestock product based on empirical mode decomposition and a distributed neural network comprises the following steps:
s1, collecting time sequence data of the prices of animal products in a certain province and 47 related variable index data which may influence the prices of the animal products in the certain province;
s2, determining principal components by principal component analysis, wherein the accumulated contribution rate is greater than or equal to 85%;
s3, decomposing the original price time sequence of the livestock products in a certain province into a plurality of intrinsic mode functions and residual error terms by using empirical mode decomposition;
s4, respectively training all the components obtained after decomposition by using a GRU neural network based on an attention mechanism;
s5, in order to accelerate the prediction speed and accuracy, predicting by using an empirical mode decomposition and distributed GRU neural network method;
and S6, combining the prediction results of the components to obtain a prediction value of the price of the livestock product in a certain province.
2. The method of claim 1, wherein the empirical mode decomposition and distributed GRU neural network and price prediction method comprises: the time sequence data of the price of the animal product in a certain province and the index data of 47 related variables which possibly influence the price of the animal product in the certain province are data with equal intervals.
3. The method of claim 1, wherein the principal component analysis in step S2 comprises the following steps:
s201, setting a set of influence factors of the price change of livestock products in a certain province as follows: y (q, e), where i is the number of samples and j is the number of influencing factors, and e is 1, 2, 3.. j;
carrying out standardization processing on the original data, wherein the standardization formula is as follows:
wherein y (q, e) represents the e-th data of the q-th sample, y' (q, e) represents the data after normalization, and ymax (e) represents the maximum value of the e-th standard;
s202, calculating a covariance matrix S, wherein the formula is as follows:
wherein the content of the first and second substances,
s203, solving a characteristic value omega of S and a corresponding U according to a characteristic equation (omega l-S) U which is 0;
s204, determining principal components, primarily screening according to the magnitude of the principal component eigenvalue, generally taking the principal components with eigenvalues larger than 1, accumulating the contribution rates of the selected principal components, and determining the principal components with the accumulated contribution rate larger than or equal to 85%.
4. The method according to claim 1, wherein the empirical mode decomposition and distributed GRU neural network and price prediction method in step S3 comprises the following specific steps:
s301, adding positive to the original signal S (t)Negative pair of auxiliary white noise to obtain a new signal s (t) + (-1)qa0ni(t),
Performing EMD for N times to obtain N first-order components
Wherein n isi(t) white noise sequence added i-th time, a0For noise amplitude increase, q is 1 or 2 to ensure positive and negative pair noise addition,is the first remaining residue;
s302, passing the NthTaking the mean value to obtain the final first-order component
S303, obtaining a first residual error r1(t):
S304, adding r to the positive and negative paired white noise IMF signal decomposed by EMD1(t) the constituent signal r1(t)+(-1)qa1E(ni(t)),
Decomposing the obtained product again for N times to obtain second-order component
S305, by aligning NTaking the mean value to obtain the final second-order component
S306, repeating the steps until N k + 1-order components are obtainedObtaining the final k +1 order component in the same way
S307, obtaining the residual component again:
s308, when the residual component rk(t) when the number of extreme points is less than 2, obtaining K IMF components, and obtaining a final residual error R (t) in the whole CEEMDAN decomposition process, namely an original signal can be expressed as:
5. the method of claim 4, wherein the empirical mode decomposition and distributed GRU neural network and price prediction method comprises: all the components obtained after the decomposition include other intrinsic mode functions and residual terms except the IMF1 component.
6. The method of claim 1, wherein in step S4, the GRU neural network with attention mechanism has the following structure:
s401, defining input data
X=(x1,x2,x3...xN)=(x1,x2,x3...xL)T∈RL*N
Wherein the characteristic quantity of the input data is defined as N, the time length is defined as L, and the k-th original sequence with the time length of L in the original data is represented asWherein k ═ N (1, 2, 3.. N);
s402, representing the original sequence with length L input at a certain time t in the input data asWherein t ═ L (1, 2, 3.. L);
s403, respectively defining the data of the target sequence and the input sequence as
y=(y1,y2,y3...yL)T
x=(x1,x2,x3...xL)T。
The purpose of the GRU neural network combined with the attention mechanism is to obtain a nonlinear mapping from an input sequence to a target sequence according to the input sequence and the target sequence training by obtaining a specified time length L;
s404, defining an input sequence x at a certain time t according to the idea of the GRU neural network modeltTo GRU neural network model hidden layer htOfShooting is as follows:
ht=f1(xt,ht-1);
s405, calculating the value h of the hidden layer of the GRU neural network at the time ttWith the k-th input of raw data
Attention weight can be obtainedFor representing raw input data xtThe k characteristic value ofThe degree of influence on the target is given by the formula:
wherein the content of the first and second substances,Weand UeAre all parameters obtained by the network training,the larger the value is, the larger the influence of the characteristic parameter on the target is;
s406, after the attention weight is obtained through training, the original input sequence is subjected to weighted calculation to obtain a new input sequence
And training the GRU neural network model by using the new sequence as an input parameter, and predicting a target value.
7. The EMD and distributed GRU neural network and price forecasting method of any one of claims 1-6, wherein in step S5, the EMD and distributed GRU neural network based method comprises the following steps:
s501, dividing data S (t) divided at Maste1 node into a plurality of IMF sequences through CEEMDAN algorithmAnd a residual sequence r (t);
s502, training and predicting by using the GRU neural network model combined with the attention mechanism by taking each sequence obtained after decomposition as input data of the GRU neural network model to obtain prediction results of each IMF, wherein the prediction results of the test set are respectively expressed asAnd R (t);
s503, integrating the prediction results of each IMF and the residual error according to a formula to obtain a prediction price sequence of the current data block
Where L is the length of the data set in the data block,is the predicted sequence for each IMF.
Background
The animal product price prediction method is mainly divided into three categories, namely a traditional prediction method, an intelligent prediction method and a mixed prediction method. Compared with mainstream livestock product price prediction methods (such as ARIMA, RBFNN, ARIMA + SVM, ARIMA-GM-RBF and Hodrick-Prescott) in recent years, the current livestock product price prediction method mainly has the three problems of low prediction precision, inaccurate prediction trend and slow prediction speed:
(1) the factors influencing the price of animal products are excessive, and the interpretation capability of the prediction method is poor; due to the complexity of factors influencing the price of the animal products, sometimes all the influencing factors are difficult to consider, so that the prediction precision of the animal product price prediction method is limited; the current mainstream animal product price prediction method only analyzes a small amount of factors influencing the animal product price, and ignores the influence of each specific non-time factor on the animal product price; therefore, when the method is used for predicting the price of the livestock product, the prediction model can be established only according to the change rule of the historical data, so that the model has poor interpretation capability.
(2) Conventional prediction methods are generally only suitable for dealing with the linearity problem: the price sequence of animal products is generally a non-linear sequence; therefore, the intelligent prediction method for processing the nonlinear mode in the price sequence by using the artificial intelligent method is applied; the neural network price prediction method has better nonlinear fitting capability, so the neural network price prediction method can be widely applied to the field of short-term price prediction of animal products, but the prediction accuracy is difficult to guarantee aiming at long-term price prediction.
(3) It is impossible to simultaneously process linear and nonlinear laws of animal product prices by only a single model, and therefore a mixed model is introduced to predict the price of animal products.
(4) The current prediction method is difficult to process a large amount of high-dimensional data: in the field of hybrid model prediction, a key problem is how to process a large amount of multidimensional data; most research usually focuses on how to select the optimal weights for a single prediction model, and then for a hybrid model; although the model weight selection is important, the improvement of the model execution speed and convergence speed is very limited.
(5) The signal decomposition strategy is widely applied to the field of finance and achieves good effect, but is not applied to livestock product price prediction.
(6) At present, the mainstream animal product price prediction method only takes errors as evaluation indexes, but in the field of animal product price prediction, the method is very important for accurately predicting the price trend change.
Disclosure of Invention
Aiming at the defects of the prior art, the invention provides an empirical mode decomposition and distributed GRU neural network and a price prediction method, and solves the existing problems in the background art.
In order to achieve the purpose, the invention is realized by the following technical scheme: an empirical mode decomposition and distributed GRU neural network and price prediction method comprises the following steps:
s1, collecting time sequence data of the prices of the livestock products in a certain province and 47 pieces of relevant variable index data which possibly influence the prices of the livestock products in the certain province;
s2, determining principal components by principal component analysis, wherein the accumulated contribution rate is greater than or equal to 85%;
s3, decomposing the original price time sequence of the livestock products in a certain province into a plurality of intrinsic mode functions and residual error terms by using empirical mode decomposition;
s4, training all the components obtained after decomposition by using a GRU neural network based on an attention mechanism;
s5, in order to accelerate the prediction speed and accuracy, predicting by using an empirical mode decomposition and distributed GRU neural network method;
and S6, combining the prediction results of the components to obtain a prediction value of the price of the livestock product in a certain province.
Optionally, the time-series data of the prices of animal products in a certain province and the 47 related variable index data which may affect the prices of animal products in a certain province are all data with equal intervals.
Optionally, the principal component analysis in step S2 includes the following specific steps:
s201, setting a set of influence factors of the price change of livestock products in a certain province as follows: y (q, e),
j, wherein i is the number of samples, and j is the number of influencing factors;
carrying out standardization processing on the original data, wherein the standardization formula is as follows:
wherein y (q, e) represents the e-th data of the q-th sample, y (q, e) represents the data after normalization processing, and ymax (e) represents the maximum value of the e-th standard;
s202, calculating a covariance matrix S, wherein the formula is as follows:
wherein the content of the first and second substances,
s203, solving a characteristic value omega of S and a corresponding U according to a characteristic equation (omega l-S) U which is 0;
s204, determining principal components, primarily screening according to the magnitude of the principal component eigenvalue, generally taking the principal components with eigenvalues larger than 1, accumulating the contribution rates of the selected principal components, and determining the principal components with the accumulated contribution rate larger than or equal to 85%.
Optionally, the empirical mode decomposition in step S3 includes the following specific steps:
s301, adding positive and negative auxiliary white noise in the original signal S (t) to obtain a new signal
s(t)+(-1)qa0ni(t),
Performing EMD for N times to obtain N first-order components
Wherein n isi(t) white noise sequence added i-th time, a0For noise amplitude increase, q is 1 or 2 to ensure positive and negative pair noise addition,is the first remaining residue;
s302, passing the NthTaking the mean value to obtain the final first-order component
S303, obtaining a first residual error
S304, adding r to the positive and negative paired white noise IMF signal decomposed by EMD1(t) the constituent signals
r1(t)+(-1)qa1E(nl(t)),
Decomposing the obtained product again for N times to obtain second-order component
S305, by aligning NTaking the mean value to obtain the final second-order component
S306, repeating the steps until N k + 1-order components are obtainedObtaining the final k +1 order component
S307, obtaining the residual component again:
s308, when the residual component rk(t) when the number of extreme points is less than 2, obtaining K IMF components, and obtaining a final residual error R (t) in the whole CEEMDAN decomposition process, namely an original signal can be expressed as:
optionally, all the components obtained after the decomposition include other intrinsic mode functions and residual terms except the IMF1 component.
Optionally, in step S4, the structure of the GRU neural network with attention mechanism is as follows:
s401, defining input data
X=(x1,x2,x3...xN)=(x1,x2,x3...xL)T∈RL*N
Wherein the characteristic quantity of the input data is defined as N, the time length is defined as L, and the k-th original sequence with the time length of L in the original data is represented as
Wherein' k ═ (1, 2, 3.. N);
s402, representing the original sequence with length L input at a certain time t in the input data as
Wherein t ═ L (1, 2, 3.. L);
s403, respectively defining the data of the target sequence and the input sequence as
y=(y1,y2,y3...yL)T
x=(x1,x2,x3...xL)T。
The purpose of the GRU neural network combined with the attention mechanism is to obtain a nonlinear mapping from an input sequence to a target sequence according to the input sequence and the target sequence training by obtaining a specified time length L;
s404, defining an input sequence x at a certain time t according to the idea of the GRU neural network modeltTo GRU neural network model hidden layer htThe mapping of (a) is:
ht=f1(xt,ht-1);
s405, calculating the value h of the hidden layer of the GRU neural network at the time ttWith the original data of the kth input
Attention weight can be obtainedFor representing raw input data xtThe k characteristic value ofThe degree of influence on the target is given by the formula:
wherein the content of the first and second substances,Weand UeAre all parameters obtained by the network training,the larger the value is, the larger the influence of the characteristic parameter on the target is;
s406, after the attention weight is obtained through training, the original input sequence is subjected to weighted calculation to obtain a new input sequence
And training the GRU neural network model by using the new sequence as an input parameter, and predicting a target value.
Optionally, in step S5, based on the empirical mode decomposition and distributed GRU neural network method, the specific steps are as follows:
s501, dividing data S (t) divided at Maste1 node into a plurality of IMF sequences through CEEMDAN algorithmAnd a residual sequence r (t);
s502, training and predicting by using the GRU neural network model combined with the attention mechanism and taking each sequence obtained after decomposition as input data of the GRU neural network model to obtain prediction results of each IMF, wherein the prediction results of the test set are respectively expressed asAnd R (t);
s503, integrating the prediction results of each IMF and the residual error according to a formula to obtain a prediction price sequence of the current data block
Where L is the length of the data set in the data block,is the predicted sequence for each IMF.
The invention provides an empirical mode decomposition and distributed GRU neural network and a price prediction method, which have the following beneficial effects:
1. the invention aims to overcome the defects of the prior art and provides a novel distributed neural network prediction combination framework based on signal decomposition and attention mechanism; the method combines the signal decomposition strategy with the field of livestock product price prediction for the first time, is superior to the current mainstream livestock product price prediction method in the aspects of prediction precision, trend prediction, model convergence and execution speed, and can be suitable for predicting the price fluctuation rule of livestock products.
2. The invention firstly selects the first 5 principal components to carry out subsequent experiments through principal component analysis. Secondly, performing CEEMDAN algorithm decomposition on the related data; finally, the decomposed data is subjected to price prediction by using a distributed computing method and a distributed GRU neural network combined with an attention mechanism; evaluating the model through multiple dimensions of Root Mean Square Error (RMSE), Mean Absolute Error (MAE), correlation coefficient (R2), trend prediction statistic (Dstat), correct ascending trend (CP), correct descending trend (CD), Diebold-Mariano test and model execution time, and displaying that the prediction accuracy, the trend prediction, the model convergence speed and the execution speed of the model are all based on the current mainstream animal product price prediction model; the method can be used for predicting the price of the livestock products in Hebei province, helps related enterprises to improve the capability of coping with price risks to a certain extent, and makes a certain contribution to the continuous and healthy development of the livestock product industry in Hebei province.
Drawings
FIG. 1 is a schematic diagram of the prices of pork, beef and mutton in Hebei province of the invention;
FIG. 2 is a diagram showing the decomposition results of the CEEMDAN in the Hebei province of mutton and pork according to the present invention.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all embodiments.
Referring to fig. 1 to 2, the present invention provides a technical solution: an empirical mode decomposition and distributed GRU neural network and price prediction method comprises the following steps:
s1, collecting time sequence data of the prices of the livestock products in Hebei province and 47 related variable index data which may influence the prices of the livestock products in Hebei province;
s2, determining principal components by principal component analysis, wherein the accumulated contribution rate is greater than or equal to 85%;
s3, decomposing the original price time sequence of the Hebei province livestock products into a plurality of intrinsic mode functions and residual error terms by using empirical mode decomposition;
s4, training all the components obtained after decomposition by using a GRU neural network based on an attention mechanism;
s5, in order to accelerate the prediction speed and accuracy, predicting by using an empirical mode decomposition and distributed GRU neural network method;
and S6, combining the prediction results of the components to obtain the prediction value of the price of the livestock products in Hebei province.
In the invention, the time sequence data of the price of the livestock products in Hebei province and the index data of 47 related variables which possibly influence the price of the livestock products in Hebei province are data with equal intervals.
In the present invention, the principal component analysis in step S2 specifically includes the following steps:
s201, setting a set of influence factors of price change of livestock products in Hebei province as follows: y (q, e),
j, wherein i is the number of samples, and j is the number of influencing factors;
carrying out standardization processing on the original data, wherein the standardization formula is as follows:
wherein y (q, e) represents the e-th data of the q-th sample, y (q, e) represents the data after normalization processing, and ymax (e) represents the maximum value of the e-th standard;
s202, calculating a covariance matrix S, wherein the formula is as follows:
wherein the content of the first and second substances,
s203, solving a characteristic value omega of S and a corresponding U according to a characteristic equation (omega l-S) U which is 0;
s204, determining principal components, primarily screening according to the magnitude of the principal component eigenvalue, generally taking the principal components with eigenvalues larger than 1, accumulating the contribution rates of the selected principal components, and determining the principal components with the accumulated contribution rate larger than or equal to 85%.
In the present invention, the empirical mode decomposition in step S3 includes the following specific steps:
s301, adding positive and negative auxiliary white noise in the original signal S (t) to obtain a new signal
s(t)+(-1)qa0ni(t),
Performing EMD for N times to obtain N first-order components
Wherein n isi(t) white noise sequence added i-th time, a0For noise amplitude increase, q is 1 or 2 to ensure positive and negative pair noise addition,is the first remaining residue;
s302, passing the NthTaking the mean value to obtain the final first-order component
S303, obtaining a first residual error
S304, adding r to the positive and negative paired white noise IMF signal decomposed by EMD1(t) the constituent signals
r1(t)+(-1)qa1E(ni(t)),
Decomposing the obtained product again for N times to obtain second-order component
S305, by aligning NTaking the mean value to obtain the final second-order component
S306, repeating the steps until N k + 1-order components are obtainedObtaining the final k +1 order component
S307, obtaining the residual component again:
s308, when the residual component rk(t) obtaining K IMF components when the number of extreme points is less than 2, and obtaining the result in the whole CEEMDAN decomposition processTo the final residual r (t), the original signal can be expressed as:
in the invention, all the components obtained after decomposition comprise other intrinsic mode functions except the IMF1 component and residual terms.
In the present invention, in step S4, the structure of the GRU neural network in combination with the attention mechanism is as follows:
s401, defining input data
X=(x1,x2,x3...xN)=(x1,x2,x3...xL)T∈RL*N
Wherein the characteristic quantity of the input data is defined as N, the time length is defined as L, and the k-th original sequence with the time length of L in the original data is represented as
Wherein k ═ N (1, 2, 3.. N);
s402, representing the original sequence with length L input at a certain time t in the input data as
Wherein t ═ L (1, 2, 3.. L);
s403, respectively defining the data of the target sequence and the input sequence as
y=(y1,y2,y3...yL)T
x=(x1,x2,x3...xL)T。
The purpose of the GRU neural network combined with the attention mechanism is to obtain a nonlinear mapping from an input sequence to a target sequence according to the input sequence and the target sequence training by obtaining a specified time length L;
s404, defining an input sequence x at a certain time t according to the idea of the GRU neural network modeltTo GRU neural network model hidden layer htThe mapping of (a) is:
ht=f1(xt,ht-1);
s405, calculating the value h of the hidden layer of the GRU neural network at the time ttWith the original data of the kth input
Attention weight can be obtainedFor representing raw input data xtThe k characteristic value ofThe degree of influence on the target is given by the formula:
wherein the content of the first and second substances,Weand UeAre all parameters obtained by the network training,the larger the straight line is, the larger the influence of the characteristic parameter on the target is;
s406, after the attention weight is obtained through training, the original input sequence is subjected to weighted calculation to obtain a new input sequence
And training the GRU neural network model by using the new sequence as an input parameter, and predicting a target value.
In the present invention, in step S5, the empirical mode decomposition and distributed GRU neural network method includes the following specific steps:
s501, dividing data S (t) divided at Maste1 node into a plurality of IMF sequences through CEEMDAN algorithmAnd a residual sequence r (t);
s502, training and predicting by using the GRU neural network model combined with the attention mechanism and taking each sequence obtained after decomposition as input data of the GRU neural network model to obtain prediction results of each IMF, wherein the prediction results of the test set are respectively expressed asAnd R (t);
s503, integrating the prediction results of each IMF and the residual error according to a formula to obtain a prediction price sequence of the current data block
Where L is the length of the data set in the data block,is the predicted sequence for each IMF.
In this embodiment, the attention mechanism has become an important concept in the field of neural networks, and has a great number of applications in the fields of natural language processing, statistical learning, speech, and the like; the attention mechanism may enable the neural network to focus on a subset of its inputs, and select a particular input; in situations where computing power is limited, attention mechanisms are the primary means of addressing the problem of information overload, with the goal of being able to allocate computing resources to more important tasks.
In this embodiment, the GRU neural network is one of the most successful variants of the current LSTM neural network; compared with the traditional machine learning method, the GRU neural network has more efficient learning ability and nonlinear fitting ability; the GRU neural network is modified on the basis of the LSTM in two aspects: first, the forgetting gate and the input gate are combined into one gate, i.e. the updating gate zrThe other gate is called reset gate rt(ii) a Second, the cell state c of the LSTMtIs merged with the output into a state htDirectly in the current state h without introducing additional internal statetAnd historical status ht-1Introducing linear dependence therebetween.
The experimental data and the index data of 47 related variables which may influence the price of livestock products in Hebei province come from a Hebei 12316 comprehensive information network and a business society, namely, a large commodity data provider; considering the availability and continuity of the sample, the prices of pork, beef and mutton in Hebei province from 2011 to 2020 are finally selected as experimental data, and the data are price time sequence data at equal intervals; it can be seen from figure 1 that the sequence exhibits an unstable, irregular fluctuation over time.
In the embodiment, the principal component analysis result is shown in table 1, the cumulative variance contribution rate of the first 5 principal components reaches 95.4745%, most information of the original data can be summarized, the variance change condition of the larger part can be reflected, and the factor analysis result is more ideal, so that the subsequent analysis can be performed by using the first 5 principal components; dividing the processed data into a training set and a testing set in sequence, and performing application verification on a prediction model by using the first 80% of data as the training data set and the remaining 20% of data as the testing data set in experimental research;
TABLE 1 principal Components analysis results
Evaluation criteria: to evaluate the prediction effect of the combined prediction model, the prediction is performed by Root Mean Square Error (RMSE), averagingMean Absolute Error (MAE), correlation coefficient (R2), trend prediction statistic (D)stat) The model is evaluated in multiple dimensions of correct rising trend (CP), correct falling trend (CD), Diebold-Mariano test and model execution time, and the calculation formula of each prediction index is as follows:
wherein the content of the first and second substances,represents the ith prediction value, m represents the length of the original sequence, m1Is the number of data points in an ascending trend, m2Is the number of data points in a downward trend.
The sequences of mutton and pork can be seen to have unstable and nonlinear characteristics in a price trend graph, so that an empirical mode decomposition method can be used for decomposing a price sequence, MatlabR2019b is used for decomposing prices of pork and mutton in Hebei province respectively to obtain 6 intrinsic mode function components and 1 linear trend margin, the decomposition result is shown in figure 2, the frequency change of IMF1 is similar to the local frequency of an original sequence, the seasonal change trend of the price of an animal product is captured from IMF2, and residual errors slowly change around a long-term average value to reflect the overall trend of the original sequence; each IMF component reflects fluctuation characteristics of different frequencies of the livestock product market, wherein the fluctuation of the high-frequency IMF component is larger and represents the fluctuation characteristics of the price of the livestock products in a short period; the intermediate frequency IMF component represents the fluctuation characteristic of the price of the livestock products in the medium and long-term market and is mainly influenced by supply and market factors; the low-frequency (including the residual sequence ECG) component has small volatility, is characterized by long-term fluctuation of the price of the market animal product, and also shows the development trend of the price of the future animal product.
Predicting the components by using a distributed GRU neural network based on an attention mechanism, and normalizing price data in the prediction process in order to realize higher prediction precision; in the experimental study, the first 80% of data is used as a training data set, and the remaining 20% of data is used as a test data set for application verification of a prediction model; the PC machine used for the experiment was configured as: lntellCorei 5-6500CPU3.20GHz, a memory of 16GB and an operating system of Ubuntu 16.04; the distributed experimental platform consists of 1 control node and 4 computing nodes, wherein the nodes are interconnected by gigabit Ethernet, Hadoop adopts a version 2.6, and Spark adopts a version 1.3; constructing a prediction model by using a Pytroch 1.4.0 frame and completing a calculation process; in the aspect of setting parameters of the prediction model, the number of neurons of the experimental model is finally determined to be 128 through multiple experiments, the batch processing size is 128, the iteration number is 400, the loss function is set to be an average absolute error, the optimizer adopts an adaptive matrix estimation calculation method, and the time step length T is set to be 5.
In order to quantitatively test the proposed method, respectively adopting ARIMA, RBFNN, ARIMA + SVM, ARIMA-GM-RBF and Hodrick-Prescott methods to model and predict the prices of pork, beef and mutton in Hebei province; table 2 gives statistical analysis of the six prediction models, and it can be seen that the predictive performance of the hybrid model is generally better than that of the single prediction model; second, the mixture model is used to predict the short termThe measurement performance is slightly higher than that of a deep learning neural network model, but from the aspect of long-term prediction effect, the prediction performance of the neural network model is higher than that of a mixed model; the root mean square error of the prediction model for beef, mutton and pork is respectively 0.726, 0.535 and 0.738, the average absolute error is respectively 0.607, 0.412 and 0.621, and the prediction performance is higher than that of the current mainstream prediction algorithm; r2The fitting degrees respectively reach 0.954, 0.995 and 0.991, which shows that the prediction model provided by the invention has better effect and faster convergence speed, and can better reflect the change rule of the price of the livestock products in Hebei province; from the performance of predicting the price change trend, the method provided by the invention is used for D treatment of beef, mutton and porkstatValues are 87.097, 90.909 and 90.566, CP values are 68.805, 41.818 and 42.875, and CD values are 63.326, 59.091 and 47.619, respectively. Are all higher than the current mainstream prediction algorithm; the prediction model provided by the invention has a better effect on the prediction of the beef, mutton and pork price trend.
TABLE 2 statistical analysis of the predicted results
Table 3 shows the Diebold-Mariano test results of the prediction model and other prediction models proposed by the present invention, and it can be seen that, in the comparison of the hybrid model and the single model, the original assumption is rejected at a significance level of 5%, that is, significant differences exist, and the prediction accuracy of the hybrid model is superior to that of the compared single model; compared with other 5 models, the model provided by the invention has better performance because the CEEMDAN decomposition method is adopted to reduce the difficulty of the price sequence prediction of the original animal product.
TABLE 3 Diebold-Mariano test results
In order to compare the simulation prediction time of each model, six models are respectively used for 6 times of prediction of beef, mutton and pork prices in Hebei province, and the average value is calculated to obtain the final model execution time; the results are shown in Table 4. Wherein, the ARIMA-GM-RBF model of the common time sequence analysis method takes the longest time for prediction and takes 17.52s for mutton price prediction. The average time taken by ARIMA + SVM and RBFNN is between 12 and 13 seconds. The average consumed time of ARIMA and Hodrick-Prescott is between 10 and 11 seconds, the prediction model provided by the invention disperses a large amount of data to different nodes for processing due to the use of a distributed computing method, so that the computing efficiency is greatly improved, and the average consumed time is between 6 and 7 seconds; in summary, the prediction model provided by the invention has higher operation speed and higher prediction accuracy compared with other models.
TABLE 4 execution times for different prediction methods
In conclusion, the invention provides a model prediction model for predicting the price of livestock products in Hebei province, which adopts principal component analysis to select principal components for subsequent experiments and carries out CEEMDAN algorithm decomposition on related data. Finally, the decomposed data is subjected to price prediction by using a distributed computing method and utilizing a GRU neural network combined with an attention mechanism; the invention is based on statistical analysis (RMSE, MAE, R)2、DstatCP and CD), Diebold-Mariantest and model execution time; the experimental result shows that the prediction model provided by the invention is based on the current mainstream livestock product price prediction model in the aspects of prediction precision, trend prediction, model convergence speed and execution speed; the model canThe method helps related enterprises to improve the capability of coping with price risks to a certain extent, and makes a certain contribution to the continuous and healthy development of the livestock product industry in Hebei province.
The principles and embodiments of the present invention have been described herein using specific examples, which are provided only to help understand the method and the core concept of the present invention; meanwhile, for a person skilled in the art, according to the idea of the present invention, there may be variations in the specific embodiments and the application scope, and as described above, the content of the present specification should not be construed as a limitation to the present invention.
- 上一篇:石墨接头机器人自动装卡簧、装栓机
- 下一篇:一种文章阅读数优化方法及系统