A multivariate time series forecasting method

Through the multivariate time series prediction method, the multi-head attention mechanism and multi-graph attention mechanism are combined with CNN filters and dynamic graph networks to extract the node features and relationship matrix of the multivariate time series, which solves the problem of low accuracy in multivariate time series prediction and realizes the effective extraction and prediction of complex relationships.

CN115099156BActive Publication Date: 2025-09-09CHONGQING UNIV
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202210832277.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-07-14
Publication Date
2025-09-09
Estimated Expiration
2042-07-14

AI Technical Summary

Technical Problem

Existing technologies are difficult to effectively extract the complex relationships between multivariate time series, resulting in low accuracy in multivariate time series prediction.

Method used

A multivariate time series prediction method is adopted, which utilizes the multi-head attention mechanism and the multi-graph attention mechanism, combines CNN filters and dynamic graph networks, extracts the node features and relationship matrix of the time series, and performs prediction through the multi-relation fusion module.

Benefits of technology

It improves the accuracy of multivariate time series prediction, can effectively eliminate the influence of noise data, balance the complex relationship between variables, and adapt to nonlinear and non-stationary characteristics.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure FHA0000013073600000011
    Figure FHA0000013073600000011
  • Figure FHA0000013073600000017
    Figure FHA0000013073600000017
  • Figure FHA0000013073600000022
    Figure FHA0000013073600000022
Patent Text Reader

Abstract

The present invention relates to a multivariate time series prediction method, comprising the following steps: obtaining a multivariate time series to be predicted; calculating the relationship matrix, causal matrix, and dynamic distance matrix of the multivariate time series after eliminating noise data; inputting the three matrices obtained above into a threshold function to obtain three final matrices of corresponding relationships; extracting node features of the multivariate time series using a CNN; applying an attention mechanism to the node features using a GAT; applying an attention mechanism to different graph structures using inter-attention; and fusing the results of the attention mechanism using heterogeneous graphs to obtain the final prediction results. This multivariate time series prediction method is an algorithm that integrates graph structure, multiple relationships, and an attention mechanism. It has good application results and is suitable for time series prediction. It can be widely used in finance, agriculture, industry, and other fields.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to a prediction method, in particular to a multivariate time series prediction method. Background Art

[0002] With the rapid development of internet technology, while improving people's daily lives, it also provides easy access to vast amounts of historical data across various industries. With the advancement of computer storage and processing power, computers are becoming increasingly capable of collecting and processing data, enabling the preservation of massive datasets in the commercial and scientific research fields. In the commercial sector, companies maintain detailed sales and operational data in the form of logs. Tmall's Double 11 Shopping Festival has seen exponential sales growth over the past twelve years, reaching a total transaction volume of 498.2 billion yuan in 2020. This is driven by a massive amount of transaction and browsing data. In the scientific research field, various experimental data and research papers are also rapidly increasing. According to statistics, global printed information production doubles every five years, and over 10,000 papers are published worldwide every day, supported by a vast amount of scientific research data and statistical results. We currently live in an era of information explosion. Data mining technology allows us to enjoy the benefits of abundant information, identify relationships within this vast amount of information, and avoid the problems caused by anomalies and noise.

[0003] Many of these data are recorded and stored in chronological order. Time series data, which is numerical data with temporal attributes and stored in an orderly manner, is ubiquitous in various fields. In business, time series data is obtained by observing weekly interest rates, daily stock closing prices, monthly price indices, and annual sales volumes. In meteorology, time series data is obtained by collecting daily maximum and minimum temperatures, drought indices, annual cumulative precipitation, and hourly average wind speeds. In agriculture, time series data is obtained by recording annual crop and livestock production, soil damage levels, and product sales. In medicine, time series data is obtained by observing millisecond electrocardiogram (ECG) activity, respiratory rate, and mental activity. In astronomy, time series data is obtained by observing solar activity and cosmic rays. Analyzing and mining time series data can reveal potential trends and correlations within the time series, thereby uncovering connections between multiple daily attributes.

[0004] In real life, time series often exhibit nonlinear and nonstationary characteristics. Neural networks have excellent fitting capabilities for nonlinear relationships, but traditional neural network models such as BP neural networks and radial basis function neural networks are not well suited for time series prediction and are prone to falling into local minima. Recurrent neural networks were originally designed to process sequential data. Traditional statistical and econometric methods such as ARIMA (autoregressive moving average) models, GARCH (autoregressive conditional heteroskedasticity) models, exponential smoothing, and multiple regression are commonly used for time series prediction. While traditional statistical or econometric models can perform this task, they require data preprocessing, such as differencing, to transform nonstationary time series into stationary ones. However, these models currently provide less than ideal prediction results for more complex data. Summary of the Invention

[0005] In view of the above problems existing in the prior art, the technical problem to be solved by the present invention is: how to fully extract the complex relationship between multivariate time series and improve the prediction accuracy of multivariate time series values.

[0006] In order to solve the above technical problems, the present invention adopts the following technical solutions:

[0007] A multivariate time series prediction method comprises the following steps:

[0008] S100: Obtain a public time series dataset, randomly select a portion of data from the public time series dataset as a training set, and perform data preprocessing on the training set;

[0009] S200: Construct a multivariate time series prediction model Q, which includes a time series module, a multi-relation extraction module, and a multi-relation fusion module. The multi-relation fusion module includes a multi-head attention mechanism and a multi-graph attention mechanism. The multi-head attention mechanism includes K single-node attention mechanisms, and the multiple single-node attention mechanisms are in series relationship.

[0010] S300: Construct a multivariate time series dataset X = {x1, x2, ..., x n}, use the time series module to extract the node features of X, which are expressed as follows:

[0011]

[0012] Among them, h represents the node feature of X, Represents a single time series node feature vector;

[0013] S400: Use the multi-relationship extraction module to calculate the correlation matrix after X eliminates noise data Cause and Effect Matrix and dynamic distance matrix

[0014] S500: Calculate the output of the multi-head attention mechanism as The specific steps are as follows:

[0015] S510: Input h into the first single node attention mechanism to calculate the attention coefficient e ij , the expression is as follows:

[0016]

[0017] Among them, a represents the parameters of a single attention mechanism, W represents the weight matrix, represents the time series characteristics of the i-th node, represents the temporal characteristics of the jth node;

[0018] S520, e ij Perform softmax processing to obtain α ij , the calculation expression is as follows:

[0019]

[0020] Among them, N i Represents the set of neighbor nodes of node i, p represents the pth node, i represents the i-th node, j represents the j-th node, j∈Ni;

[0021] S520: h and α ij As the input of the second single node attention mechanism, the output after passing through the K-1 layer attention mechanism is The expression is as follows:

[0022]

[0023] Applying the average to formula (4) yields formula (5):

[0024]

[0025] Among them, K represents the number of attention mechanisms of a single node, Represents the k-th single node attention mechanism α k The calculated normalized attention coefficient, W k represents the weight matrix of the corresponding input linear transformation;

[0026] S600: Use multi-graph attention mechanism to corr′ , M cas′ , M dy′Scoring is performed to obtain the corresponding three score matrices, and softmax processing is performed on the three score matrices. The expressions are as follows:

[0027]

[0028] in, represents the i-th node of the k-th graph in the constructed graph, k∈{1,2,…,K}, K is the number of constructed graphs, represents the set of all hidden representations of node i except the k-th graph, j∈{1,…,K-1}, It is the weight matrix in the multi-graph attention mechanism, k=1 means M corr ′’s scoring result, when k=2, it means that M cas ′’s scoring result, k=3 means M dy ′’s scoring result;

[0029] S700: a′ k 、 and Substitute the following formula:

[0030]

[0031] Where h′ l Represents the node embedding matrix of the lth layer, that is, the temporal characteristics of the nodes in the lth layer, and is the layer-specific weight matrix, h′ is the output of the node attention mechanism of layer l, and is the set of output results of the multi-head attention mechanism for all nodes in the graph. Substitute h into formula (8) l , a′ k Substitute α into formula (8) k ,Will and The average value of the three matrices is M k , and substitute it into formula (8), and then calculate the prediction result of X;

[0032] When l = 0, h is calculated by substituting the parameters into formula (8) 1 ;

[0033] When h l =h 1 , h is calculated by substituting the parameters into formula (8) 2 ;

[0034] When h l =h 2 , h is calculated by substituting the parameters into formula (8) 3;

[0035] S800:h 3 =Y, where Y={y1, y2,...,y n} represents the prediction result of X.

[0036] As an example, the multi-relationship extraction module is used in step S400 to calculate the correlation matrix after eliminating the noise data. Cause and Effect Matrix and dynamic distance matrix The specific steps are as follows:

[0037] S410: Calculate the correlation matrix of X The specific expression is as follows:

[0038]

[0039] Among them, r,s∈[1,n], Represents the time series x r and x s The correlation, x r and x s Both represent any two time series in X, Cov(x r ,x s ) represents x r with x s The covariance of D(x r ) represents x r The variance of D(x s ) represents x s variance;

[0040] S420: Calculate the causal relationship matrix of X The specific steps are as follows:

[0041] S421: Calculate x r and x s The joint entropy H(x r ,x s ) and conditional entropy H(x r |x s ), the expression is as follows:

[0042]

[0043] Where p represents probability;

[0044] S422: Calculate x r and x s The biased transfer entropy between The expression is as follows:

[0045]

[0046] Among them, x s(t+1) represents the time series value of node s at time t+1, x st represents the time series value of node s at time t, x vt represents the time series value of node v at time t, x rt represents the time series value of node r at time t;

[0047] S423: Calculate the causal relationship matrix of X The specific expression is as follows:

[0048]

[0049] Among them, x v represents the vth time series;

[0050] S430: Calculate the dynamic distance matrix of X The specific steps are as follows:

[0051] S431: Computing x using dynamic graph networks r and x s The dynamic distance between them, and the preliminary distance matrix is ​​obtained The calculation expression is as follows:

[0052]

[0053] in, represents the time series value of the r-th multivariate time series at time t, represents the time series value of the s-th multivariate time series at time t, represents the time series value of the v-th multivariate time series at time t, and σ represents the activation function;

[0054] S432: Substitute the time decay into the preliminary distance matrix to obtain a dynamic distance matrix D based on time decay decay , the calculation expression is as follows:

[0055]

[0056] The time decay expression is:

[0057] k(t-t0)=exp(-δ i (t-t0)); (16)

[0058] S433: The obtained D decay Input the activation function to get the final dynamic distance matrix The calculation expression is as follows:

[0059]

[0060] Among them, W represents the learnable parameter;

[0061] S440: Yes After normalization, input threshold function to get the noise-eliminating data. right After normalization, input threshold function to get the noise-eliminating data. right After normalization, input threshold function to get the noise-eliminating data. The calculation expression is as follows:

[0062]

[0063] Wherein, a=corr′ or cas′ or dy′, and threshold represents a threshold value.

[0064] Compared with the prior art, the present invention has at least the following advantages:

[0065] 1. The method of the present invention proposes a multivariate time series prediction method, which uses various relationship matrices that can eliminate noise data to improve data quality. It uses CNN to extract features and applies multiple attention mechanisms to the features to balance the complex relationships between variables, thereby balancing the impact of variables on the prediction results. Finally, the results of the attention mechanisms are integrated to achieve the final ideal prediction result.

[0066] 2. Based on the PTE (partial transfer entropy) method, the complex causal relationship between time series is extracted, which can effectively extract the causal relationship between nonlinear and non-stationary time series.

[0067] 3. Incorporate the time decay function into dynamic graph learning to reduce the impact of noise data; set up a learning mechanism to learn the time decay of variable relationships.

[0068] 4. Use two attention mechanisms: node attention mechanism and multi-graph attention mechanism to balance the impact of complex relationships between variables on prediction results, effectively balancing the impact of multi-variable relationships on prediction results. DETAILED DESCRIPTION

[0069] The present invention is described in further detail below.

[0070] While achieving the optimal set of explanatory variables, the method of the present invention can solve the problem of variability of prediction models caused by the nonlinear and non-stationary characteristics of multivariate time series. Designing the optimal prediction model for the prediction task of multivariate time series and developing an effective training algorithm are the basis and starting point of the method.

[0071] A multivariate time series prediction method comprises the following steps:

[0072] S100: Obtain a public time series dataset, which is selected from Exchange-Rate, Traffic, Solar-Energy, and Stocks. Randomly select a portion of data from the public time series dataset as a training set and perform data preprocessing on the training set. Here, data interpolation and data normalization are used as data preprocessing methods. The data interpolation and data normalization methods are existing technologies.

[0073] S200: Construct a multivariate time series prediction model Q. The multivariate time series prediction model Q includes a time series module, a multi-relationship extraction module and a multi-relationship fusion module. The multi-relationship fusion module includes a multi-head attention mechanism and a multi-graph attention mechanism. The multi-head attention mechanism includes K single-node attention mechanisms, and multiple single-node attention mechanisms are in series relationship. The overall multivariate time series prediction model includes three major modules: a time series module, a multi-relationship extraction module, and a multi-relationship fusion module. The time series module uses CNN filters with different kernel sizes to capture the temporality of the time series. The multi-relationship extraction module extracts the dynamic and static relationships of the multivariate time series, such as correlation: correlation coefficient, causality: causal relationship extraction based on PTE, and dynamics: dynamic relationship extraction of multivariate time series based on time decay function. The multi-relationship fusion module uses the node attention mechanism to learn the weights of node neighbors to better aggregate the information of neighboring nodes, and uses the multi-graph attention mechanism to learn the weights of different variable relationships and give greater weights to important variable relationships.

[0074] S300: Construct a multivariate time series dataset X = {x1, x2, ..., x n}, use the time series module to extract the node features of X, which are expressed as follows:

[0075]

[0076] Among them, h represents the node feature of X, Represents a single time series node feature vector; the time series module uses a CNN filter. Specifically, the node feature of X extracted by the CNN filter is recorded as The node feature is to extract the temporal characteristics of X using CNN filters with different kernel sizes [such as 1×3, 1×5, 1×7]. CNN filters are the existing technology;

[0077] S400: Use the multi-relationship extraction module to calculate the correlation matrix after X eliminates noise data Cause and Effect Matrix and dynamic distance matrix

[0078] 3. The multi-relationship extraction module in S400 calculates the correlation matrix after eliminating the noise data Cause and Effect Matrix and dynamic distance matrix The specific steps are as follows:

[0079] S410: Calculate the correlation matrix of X The specific expression is as follows:

[0080]

[0081] Among them, r,s∈[1,n], Represents the time series x r and x s The correlation, x r and x s Both represent any two time series in X, Cov(x r ,x s ) represents x r with x s The covariance of D(x r ) represents x r The variance of D(x s ) represents x s variance;

[0082] S420: Calculate the causal relationship matrix of X The specific steps are as follows:

[0083] S421: Calculate x r and x s The joint entropy H(x r ,x s ) and conditional entropy H(x r |x s ), the expression is as follows:

[0084]

[0085] Where p represents probability;

[0086] S422: Calculate x r and x s The biased transfer entropy between The expression is as follows:

[0087]

[0088] Among them, x s(t+1) represents the time series value of node s at time t+1, x st represents the time series value of node s at time t, x vt represents the time series value of node v at time t, xrt represents the time series value of node r at time t;

[0089] S423: Calculate the causal relationship matrix of X The specific expression is as follows:

[0090]

[0091] Among them, x v represents the vth time series;

[0092] S430: Calculate the dynamic distance matrix of X The specific steps are as follows:

[0093] S431: Computing x using dynamic graph networks r and x s The dynamic distance between them, the dynamic graph network algorithm is an existing technology, and the preliminary distance matrix is ​​obtained The calculation expression is as follows:

[0094]

[0095] in, represents the time series value of the r-th multivariate time series at time t, represents the time series value of the s-th multivariate time series at time t, represents the time series value of the v-th multivariate time series at time t, and σ represents the activation function;

[0096] S432: Substitute the time decay into the preliminary distance matrix to obtain a dynamic distance matrix D based on time decay decay , the calculation expression is as follows:

[0097]

[0098] The time decay expression is:

[0099] k(t-t0)=exp(-δ i (t-t0)); (16)

[0100] S433: The obtained D decay Input the activation function to get the final dynamic distance matrix The calculation expression is as follows:

[0101]

[0102] Among them, W represents the learnable parameter;

[0103] S440: Yes After normalization, input threshold function to get the noise-eliminating data. right After normalization, input threshold function to get the noise-eliminating data. right After normalization, input threshold function to get the noise-eliminating data. The calculation expression is as follows:

[0104]

[0105] Wherein, a=corr′ or cas′ or dy′, and threshold represents a threshold value. Different threshold values ​​may be used here depending on the selected data set.

[0106] S500: Calculate the output of the multi-head attention mechanism as The specific steps are as follows:

[0107] S510: Input h into the first single node attention mechanism to calculate the attention coefficient e ij , the expression is as follows:

[0108]

[0109] Among them, a represents the parameters of a single attention mechanism, represents the time series characteristics of the i-th node, represents the temporal characteristics of the jth node;

[0110] S520, e ij Perform softmax processing to obtain α ij , the calculation expression is as follows:

[0111]

[0112] Among them, N i Represents the set of neighbor nodes of node i, p represents the pth node, i represents the i-th node, j represents the j-th node, j∈Ni;

[0113] S520: h and α ij As the input of the second single node attention mechanism, the output after passing through the K-1 layer attention mechanism is The expression is as follows:

[0114]

[0115] Applying the average to formula (4) yields formula (5):

[0116]

[0117] Among them, K represents the number of attention mechanisms of a single node, Represents the k-th single node attention mechanism α k The calculated normalized attention coefficient, W k represents the weight matrix of the corresponding input linear transformation;

[0118] S600: Use multi-graph attention mechanism to corr′ , M cas′ , M dy′ Scoring is performed to obtain the corresponding three score matrices, and softmax processing is performed on the three score matrices. The expressions are as follows:

[0119]

[0120] in, represents the i-th node of the k-th graph in the constructed graph, k∈{1,2,…,K}, K is the number of constructed graphs, represents the set of all hidden representations of node i except the k-th graph, j∈{1,…,K-1}, It is the weight matrix in the multi-graph attention mechanism, k=1 means M corr′ The scoring result of M cas′ The scoring result of M dy′ The scoring results;

[0121] S700: a′ k 、 and Substitute the following formula:

[0122]

[0123] Among them, h ′l Represents the node embedding matrix of the lth layer, that is, the temporal characteristics of the nodes in the lth layer, and is the layer-specific weight matrix, h ′ is the output result of the node attention mechanism of the lth layer, and is the set of output results of the multi-head attention mechanism for all nodes in the graph. Substitute h into formula (8) l , a′ k Substitute α into formula (8) k ,Will and The average value of the three matrices is M k , and substitute it into formula (8), and then calculate the prediction result of X;

[0124] When l = 0, h is calculated by substituting the parameters into formula (8) 1;

[0125] When h l =h 1 , h is calculated by substituting the parameters into formula (8) 2 ;

[0126] When h l =h 2 , h is calculated by substituting the parameters into formula (8) 3 ;

[0127] S800:h 3 =Y, where Y={y1, y2,...,y n} represents the prediction result of X.

[0128] Experiment and analysis

[0129] 1. Data preprocessing: interpolation + data normalization + (training set, validation set and test set) division (6:2:2)

[0130] Description of the four public datasets used:

[0131] ●Exchange-Rate: Exchange rate data for eight countries from 1990 to 2016, including the United Kingdom, Japan, New Zealand, Canada, Switzerland, Singapore, Australia, and China.

[0132] Traffic: Freeway occupancy rates measured by 862 sensors in San Francisco from 2015 to 2016, according to the California Department of Transportation.

[0133] Solar-Energy: A continuously collected collection of solar energy data from the National Renewable Energy Laboratory, which contains the solar energy output collected from 137 photovoltaic power plants in Alabama in 2007.

[0134] Stocks: Closing prices of 355 stocks from the Shanghai Stock Exchange from 2006 to 2017 were collected. We selected 355 stocks with relatively continuous data from public data. If data was missing, the previous day's closing price was used.

[0135] 2. Parameter settings: The window size is set to 32 (i.e., the dimension of the time series extracted at one time, e.g., for a time series X = {x1, x2, ... xn}, then a prediction uses 32 values, i.e., x1 to x32). The thresholds for different datasets are divided into: 0.05 for Exchange-Rate, 0.002 for Solar-Energy, 0.006 for Traffic, and 0.0001 for Stocks. The horizon is set to four values: 3, 6, 12, and 24. h is the prediction time step (if the input is a time series starting at time t, if h is set to 3, the prediction will be for the time series starting at time t+3).

[0136] 3. The processed data is substituted into the method of the present invention and trained for 300 rounds to obtain the three values ​​of RSE, RAE, and CORR. The best result is selected as the final training result.

[0137] 4. Select 6 existing algorithms for comparison, namely:

[0138] Machine Learning Model: VAR-MLP

[0139] Neural network models: RNN-GRU, LSTNet

[0140] Graph neural network models: MTGNN, TEGNN, MTHetGNN

[0141] 5. The final experimental results are as follows:

[0142] Table 1. Prediction results of multivariate time series obtained by RSE / RAE / CORR scoring on the Exchange-Rate dataset.

[0143]

[0144] Table 2. Multivariate time series prediction results obtained by RSE / RAE / CORR scoring on the Solar dataset

[0145]

[0146] Table 3. Prediction results of multivariate time series obtained by RSE / RAE / CORR scoring on the Traffic dataset.

[0147]

[0148] Table 4. Prediction results of multivariate time series obtained by RSE / RAE / CORR scoring on the Stock dataset

[0149]

[0150] 6. Experimental results evaluation description

[0151] The results of this experiment are verified by three evaluation matrices: RSE, RAE, and CORR:

[0152]

[0153] CORR is calculated based on the correlation coefficient

[0154]

[0155] When evaluating the calculation results, the smaller the RAE and RSE values, the better the algorithm effect, and the larger the CORR value, the better the algorithm effect.

[0156] 7. Analysis of experimental results:

[0157] The bold text in Tables 1-4 indicates experimental results that outperform the comparison algorithms. Across four public datasets, this algorithm achieved higher accuracy compared to the selected comparison algorithms. On the Traffic dataset, this algorithm achieved the best prediction accuracy across different values ​​of h. Due to the inherent characteristics of the Traffic dataset, its time series values ​​change dynamically over time, exhibiting strong dynamics. This algorithm, by incorporating time decay into the extraction of time series dynamics within the multi-relationship extraction module, can effectively extract the dynamics of time series, resulting in better experimental results. For the Exchange-Rate dataset, due to its small number of nodes, using two attention mechanisms did not significantly improve prediction results, resulting in a small improvement in prediction accuracy.

[0158] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention and are not limiting. Although the present invention has been described in detail with reference to the preferred embodiments, those skilled in the art should understand that the technical solutions of the present invention may be modified or replaced by equivalents without departing from the purpose and scope of the technical solutions of the present invention, which should all be included in the scope of the claims of the present invention.

Claims

1. A multivariate time series prediction method, characterized by: The steps include: S100: Obtain a public time series dataset, randomly select a portion of data from the public time series dataset as a training set, and perform data preprocessing on the training set, wherein the public time series dataset is traffic highway occupancy data measured by sensors or solar energy output data collected by a photovoltaic power station; S200: Construct a multivariate time series prediction model Q, which includes a time series module, a multi-relation extraction module, and a multi-relation fusion module. The multi-relation fusion module includes a multi-head attention mechanism and a multi-graph attention mechanism. The multi-head attention mechanism includes K single-node attention mechanisms, and the multiple single-node attention mechanisms are in series relationship. S300: Construct a multivariate time series dataset X = {x1, x2, ..., x n }, use the time series module to extract the node features of X, which are expressed as follows: Among them, h represents the node feature of X, Represents a single time series node feature vector; S400: Use the multi-relationship extraction module to calculate the correlation matrix after X eliminates noise data Cause and Effect Matrix and dynamic distance matrix S500: Calculate the output of the multi-head attention mechanism as The specific steps are as follows: S510: Input h into the first single node attention mechanism to calculate the attention coefficient e ij , the expression is as follows: Among them, a represents the parameters of a single attention mechanism, W represents the weight matrix, represents the time series characteristics of the i-th node, represents the temporal characteristics of the jth node; S520, e ij Perform softmax processing to obtain α ij , the calculation expression is as follows: Among them, N i Represents the set of neighbor nodes of node i, p represents the pth node, i represents the i-th node, j represents the j-th node, j∈Ni; S520: h and α ij As the input of the second single node attention mechanism, the output after passing through the K-1 layer attention mechanism is The expression is as follows: Applying the average to formula (4) yields formula (5): Among them, K represents the number of attention mechanisms of a single node, Represents the k-th single node attention mechanism α k The calculated normalized attention coefficient, W k represents the weight matrix of the corresponding input linear transformation; S600: Use multi-graph attention mechanism to corr ′,M cas ′,M dy ’ is scored to obtain the corresponding three score matrices, and the three score matrices are softmax processed. The expression is as follows: in, represents the i-th node of the k-th graph in the constructed graph, k∈{1,2,…,K}, K is the number of constructed graphs, represents the set of all hidden representations of node i except the k-th graph, j∈{1,…,K-1}, It is the weight matrix in the multi-graph attention mechanism, k=1 means M corr ′’s scoring result, when k=2, it means that M cas ′’s scoring result, k=3 means M dy ′’s scoring result; S700: a′ k 、 and Substitute the following formula: Where h′ l Represents the node embedding matrix of the lth layer, that is, the temporal characteristics of the nodes in the lth layer, and is the layer-specific weight matrix, h′ is the output of the node attention mechanism of layer l, and is the set of output results of the multi-head attention mechanism for all nodes in the graph. Substitute h into formula (8) l , a′ k Substitute α into formula (8) k ,Will and The average value of the three matrices is M k , and substitute it into formula (8), and then calculate the prediction result of X; When l = 0, h is calculated by substituting the parameters into formula (8) 1 ; When h l =h 1 , h is calculated by substituting the parameters into formula (8) 2 ; When h l =h 2 , h is calculated by substituting the parameters into formula (8) 3 ; S800:h 3 =Y, where Y={y1, y2,...,y n } represents the prediction result of X.

2. A multivariate time series prediction method according to claim 1, characterized in that: In S400, the multi-relationship extraction module is used to calculate the correlation matrix after X eliminates the noise data. Cause and Effect Matrix and dynamic distance matrix The specific steps are as follows: S410: Calculate the correlation matrix of X The specific expression is as follows: Among them, r,s∈[1,n], Represents the time series x r and x s The correlation, x r and x s Both represent any two time series in X, Cov(x r ,x s ) represents x r with x s The covariance of D(x r ) represents x r The variance of D(x s ) represents x s variance; S420: Calculate the causal relationship matrix of X The specific steps are as follows: S421: Calculate x r and x s The joint entropy H(x r ,x s ) and conditional entropy H(x r |x s ), the expression is as follows: Where p represents probability; S422: Calculate x r and x s The biased transfer entropy between The expression is as follows: Among them, x s(t+1) represents the time series value of node s at time t+1, x st represents the time series value of node s at time t, x vt represents the time series value of node v at time t, x rt represents the time series value of node r at time t; S423: Calculate the causal relationship matrix of X The specific expression is as follows: Among them, x v represents the vth time series; S430: Calculate the dynamic distance matrix of X The specific steps are as follows: S431: Computing x using dynamic graph networks r and x s The dynamic distance between them, and the preliminary distance matrix is ​​obtained The calculation expression is as follows: in, represents the time series value of the r-th multivariate time series at time t, represents the time series value of the s-th multivariate time series at time t, represents the time series value of the v-th multivariate time series at time t, and σ represents the activation function; S432: Substitute the time decay into the preliminary distance matrix to obtain a dynamic distance matrix D based on time decay decay , the calculation expression is as follows: The time decay expression is: k(t-t0)=exp(-δ i (t-t0));(16) S433: The obtained D decay Input the activation function to get the final dynamic distance matrix The calculation expression is as follows: Among them, W represents the learnable parameter; S440: Yes After normalization, input threshold function to get the noise-eliminating data. right After normalization, input threshold function to get the noise-eliminating data. right After normalization, input threshold function to get the noise-eliminating data. The calculation expression is as follows: Wherein, a=corr′ or cas′ or dy′, and threshold represents a threshold value.

Citation Information

Patent Citations

  • Method and device for carrying out data verification in edge-cloud collaboration process

    CN113783862A

  • Information diffusion prediction method fusing space-time attention and heterogeneous graph convolutional network

    CN113850446A