Stock prediction method based on two-stage causal-industry graph fusion

By explicitly separating trend and volatility components through a two-stage causal-industry graph fusion method and dynamically learning asymmetric causal relationships, the robustness and accuracy issues of stock market forecasting in existing technologies are solved, achieving more efficient financial time series forecasting.

CN122048529APending Publication Date: 2026-05-15BEIJING UNIV OF POSTS & TELECOMM
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202610159319.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-02-04
Publication Date
2026-05-15

AI Technical Summary

Technical Problem

Existing financial time series forecasting methods cannot effectively capture heterogeneous dynamics and asymmetric causality in the stock market, resulting in a mismatch in the handling of trend and volatility components, making it difficult to maintain robustness and accuracy in complex markets.

Method used

A two-stage causal-industry graph fusion method is adopted. The trend and fluctuation components are explicitly separated through the structure-aware decomposition module. A heterogeneous encoder is designed, and the sparse and asymmetric causal graph is dynamically learned by combining industry priors and data-driven mechanisms to adapt to changes in market state.

Benefits of technology

It enables accurate modeling of trend and volatility components in financial time series forecasting, improves the accuracy and stability of forecasts, and significantly enhances risk-adjusted returns in trading backtesting.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122048529A_ABST
    Figure CN122048529A_ABST
Patent Text Reader

Abstract

The invention discloses a stock prediction method based on two-stage causal-industry graph fusion, and is applied to the technical field of financial time series prediction. Comprising the following steps: acquiring feature vectors of stocks, and constructing original input features; performing trend-fluctuation decomposition on the original input features to obtain trend components and fluctuation components; constructing a static industry graph and a dynamic causal graph; fusing the static industry graph and the dynamic causal graph through a two-stage cause-fruit industry graph fusion mechanism, and constructing a heterogeneous propagation graph; extracting trend component features and fluctuation component features; trend component coding and fluctuation component coding are carried out based on heterogeneous time sequence coding, and the yield relative ranking of the stock at the future target moment is expressed and predicted through additive fusion integration coding. The prediction method provided by the invention can adapt to market state changes, and is excellent in prediction performance and investment portfolio income.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of financial time series forecasting technology, and more specifically to a stock forecasting method based on two-stage causal-industry graph fusion. Background Technology

[0002] Financial time series forecasting, as a core technology in quantitative investment and risk management, predicts future trends by analyzing historical market data, playing a crucial role in investor decision-making, asset pricing, and systemic risk prevention. However, financial markets are inherently highly complex adaptive systems. Their inherent non-stationarity, strong noise interference, and dynamic coupling characteristics between assets pose significant challenges to accurate forecasting. Existing financial forecasting methods primarily focus on time series modeling and relational modeling. In time series modeling, from early LSTM to recent Transformers and their variants, the focus is on capturing long-term dependencies in historical sequences. Relational modeling, on the other hand, primarily uses graph neural networks, typically employing a two-stage strategy of graph construction followed by propagation, which makes the graph structure unsuitable for optimization under forecasting tasks.

[0003] Existing methods ignore two essential characteristics of financial markets: 1. Financial sequences possess a heterogeneous dynamic nature; stock price sequences are actually the result of the superposition of two distinct dynamic processes. Long-term trends reflect the slow accumulation of corporate fundamentals, exhibiting a smooth, long-term dependent evolutionary trajectory. Short-term fluctuations, driven by market sentiment and sudden events, are high-frequency, instantaneous, and random processes. More specifically, trend components typically change slowly within a fixed time window, demonstrating strong temporal continuity; while volatility components can exhibit dramatic oscillations of ±10% within the same window, with jumps of 3%–4% between adjacent dates, showing almost no continuity. Existing methods mostly employ homogeneous architectures to process composite signals. Simply relying on RNNs easily leads to misinterpreting volatility noise as trend signals, while uniformly using attention mechanisms weakens the modeling of trend asymmetry due to the equal weighting of time steps. This mismatch between the architecture and the characteristics of the components results in the model excessively suppressing signals when smoothing trends and introducing too much noise when responding to volatility, making it difficult to remain robust in complex market phase transitions.

[0004] 2. Asymmetric causal relationships exist between stocks. Unlike general time series, the stock market exhibits a clear leader-follower effect: price changes in industry leaders affect other stocks in the same industry, but the reverse is not true; fluctuations in upstream raw material prices transmit to downstream manufacturing companies, forming a one-way causal chain. More importantly, this causal relationship dynamically changes with market conditions. Furthermore, the propagation paths of trends and fluctuations differ: long-term trends may propagate along fundamental causal chains, while short-term fluctuations are more likely to spread along sentiment resonance paths.

[0005] In summary, existing methods have two main limitations: First, graphs constructed based on predefined rules or symmetric correlation coefficients cannot capture directional causal relationships; although some works have introduced transfer entropy to identify causal directions, the strategy of constructing the graph offline before inputting it into the model results in the graph structure not being able to adjust with market conditions. Second, existing methods assume that all stocks share the same relationship graph, ignoring the fact that trends and fluctuations may correspond to different propagation topologies. Therefore, how to provide a stock prediction method based on two-stage causal-industry graph fusion is a problem that urgently needs to be solved by those skilled in the art. Summary of the Invention

[0006] In view of this, the present invention provides a stock prediction method based on two-stage causal-industry graph fusion. By explicitly separating trend and fluctuation components through a structure-aware decomposition module, causal discovery is embedded into a differentiable network layer. By combining industry priors and data-driven mechanisms to dynamically learn sparse and asymmetric causal graphs, a heterogeneous encoder is designed to adapt to changes in market conditions and achieve accurate prediction while maintaining component characteristics.

[0007] To achieve the above objectives, the present invention provides the following technical solution: A stock prediction method based on two-stage causal-industry graph fusion includes the following steps: S1. Obtain the stock collection Each stock u At time step t eigenvectors on , constitute the original input features , Using the feature dimension, a DC-DHM model for stock prediction is constructed; S2, convert the original input features Input the DC-DHM model and process the original input features Perform trend-volatility decomposition to obtain trend components. and fluctuation components ; S3, Construct a static industry map Based on the dynamic neural causal discovery mechanism, the trend components are respectively and fluctuation components Construct a dynamic cause-effect graph; S4. Static industry graphs are integrated using a two-stage cause-effect industry graph fusion mechanism. By integrating with dynamic causal graphs, trend components are constructed separately. and fluctuation components heterogeneous propagation diagram and ; S5. For heterogeneous propagation graphs and Trend component features were extracted based on Chebyshev spectral convolution. and fluctuation component characteristics ; S6. Based on heterogeneous time-series coding, trend component coding and volatility component coding are performed to obtain the time-series coded representation of the trend component. Temporal encoding representation of wave components ; S7. Integrating the temporal coding representation of trend components through additive fusion. Temporal encoding representation of wave components Based on the fused representation Z Predict the relative ranking of stock returns at a future target time.

[0008] Optionally, the trend-fluctuation decomposition in S2 specifically involves: decomposing the original input features... After performing symmetrical boundary filling, average pooling was used to extract trend components. Through calculation obtained wave components The decomposed features are mapped to the hidden layer dimensions through linear projection layers. D : ; ; In the formula, For learnable projection matrices, This is a bias term.

[0009] Optional, building a static industry graph in S3 Specifically, this involves constructing a prior adjacency matrix based on industry relationship data. : ; Add self-loops to preserve the node's own characteristics: ; In the formula, and They represent stocks and industry, It is an identity matrix.

[0010] Optionally, the dynamic neural causal discovery mechanism in S3 specifically involves: using the trend component obtained in S2... and fluctuation components Collectively referred to as input features Build the current state With historical lag : ; ; In the formula, S For the number of shares, D For the hidden layer dimension of the model, T Let L be the time step and L be the maximum lag order. This indicates a shift operation performed in the time dimension. Indicates 1 to T X, Represents time from 0 to T-1 X ; The aggregated representation of each lag order is obtained by aggregating nonlinear embedding functions and attention weights. Using the current state of the target sequence as the query and the lagged aggregation state of the source sequence as the key and value, a cross-attention mechanism is used to calculate stock values. For stocks The strength of the original causal influence The attention weight sequence is input into the gated recurrent unit, and the final hidden state is used as a temporally consistent causal strength measure to form the original score matrix of the dynamic causal graph.

[0011] Optionally, the two-stage cause-effect industry graph fusion mechanism in S4 specifically involves: merging the original score matrix of the dynamic cause-effect graph... Compared with static industry charts Learnable weights Perform weighted fusion: ; In the formula, For regularized causal matrix, For the Sigmoid function, Applying the sparsemax operator, the final dynamic causality matrix is ​​obtained. For each stock Introducing trend scalar gating and fluctuation scalar gating : ; ; In the formula, , Trend encoder and fluctuation encoder respectively t The output of the node is embedded at all times. , For the weights and biases of the trend encoder, , Weights and biases for the fluctuation encoder; construct a trend heterogeneous propagation graph. And wave heterogeneous propagation diagram : ; ; In the formula, For trend gating matrix, It is a fluctuation-gated matrix.

[0012] Optionally, trend component features are extracted in S5 based on Chebyshev spectral convolution. and fluctuation component characteristics Specifically, for a given heterogeneous propagation graph, a normalized Laplacian matrix is ​​calculated, and the eigenvalues ​​are mapped to the interval [-1, 1] to satisfy the Chebyshev polynomial domain requirement. Convolution is performed independently at each time step, residual connections are introduced, and layer normalization is applied to stabilize the training process. A feedforward network is introduced to enhance the nonlinear expression, and Chebyshev filters with independent parameters are obtained respectively. and : ; ; In the formula, For trend-learnable parameters, For fluctuating learnable parameters, The trend characteristics are derived from trend-volatility decomposition. The volatility characteristics are those obtained after trend-volume decomposition. Trend Heterogeneous Propagation Diagram The Laplacian matrix after eigenvalue mapping Wave heterogeneous propagation diagram The Laplacian matrix after eigenvalue mapping It is a Chebyshev polynomial.

[0013] Optionally, the trend component encoding in S6 is as follows: Input features are mapped to a high-dimensional space via nonlinear projection. The mapped features are then input into a two-layer LSTM. A temporal attention mechanism is added on top of the LSTM to calculate the weights of each historical state on the current prediction. These weighted sums are used to obtain a context vector. The final hidden state of the LSTM is concatenated with the context vector, and a nonlinear transformation is performed to obtain the temporal encoding representation of the trend component. .

[0014] Optionally, the wave component encoding in S6 is specifically as follows: the features are input into a causal mask Transformer, the Transformer's self-attention layer uses a strict lower triangular causal mask, and after passing through a feedforward network, the temporal encoded representation of the wave component is output. .

[0015] Optionally, additive fusion in S7 specifically includes: ; In the formula, For the fused encoding representation, take The features of the last time step predict the stock ranking of the next time step.

[0016] Optionally, the DC-DHM model is trained using the mean squared error between the predicted stock rankings and the actual rankings as the loss function.

[0017] As can be seen from the above technical solution, compared with the prior art, the present invention provides a stock prediction method based on two-stage causal-industry graph fusion, which has the following beneficial effects: 1. This invention proposes a structure-aware decompositional spatiotemporal modeling paradigm, which effectively solves the joint modeling challenge of heterogeneous dynamics in financial time series by explicitly separating trend and volatility components and designing a heterogeneous encoder; 2. This invention designs a dynamic asymmetric causal mechanism, embedding causal discovery into a network layer, which breaks through the limitations of the traditional two-stage method and enables the model to adaptively capture asymmetric spillover effects in the market. 3. This invention significantly surpasses existing methods in terms of prediction accuracy and stability, and demonstrates excellent risk-adjusted returns in transaction backtesting. Attached Figure Description

[0018] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on the provided drawings without creative effort.

[0019] Figure 1 This is a flowchart of the stock prediction method based on two-stage causal-industry graph fusion according to the present invention. Figure 2 This is a schematic diagram of the DC-DHM model of the present invention; Figure 3 This is a schematic diagram of the causal matrix of some stocks in the CSI300 index in an embodiment of the present invention. Figure 4 This is a schematic diagram illustrating the actual ranking of CSI300 constituent stocks and the DC-DHM predicted ranking in an embodiment of the present invention. Figure 5 This is a schematic diagram of the analysis results of the lookback window length τ in an embodiment of the present invention; Figure 6 This is a schematic diagram illustrating the analysis results of the average pooling kernel size k in an embodiment of the present invention; Figure 7 This is a schematic diagram of the hidden layer dimension D analysis results in an embodiment of the present invention; Figure 8 This is a schematic diagram of the IC analysis results of the lag order in an embodiment of the present invention; Figure 9 This is a schematic diagram of the RankIC analysis results of the lag order in an embodiment of the present invention; Figure 10 This is a schematic diagram of the ICIR analysis results of the lag order in an embodiment of the present invention; Figure 11 This is a schematic diagram of the RankICIR analysis results of the lag order in an embodiment of the present invention. Detailed Implementation

[0020] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0021] This invention discloses a stock prediction method based on a two-stage causal-industry graph fusion, such as... Figure 1 As shown, it includes the following steps: S1. Obtain the stock collection Each stock u At time step t eigenvectors on , constitute the original input features , Using the feature dimension, a DC-DHM model for stock prediction is constructed, such as... Figure 2 As shown; S2, convert the original input features Input the DC-DHM model and process the original input features Perform trend-volatility decomposition to obtain trend components. and fluctuation components ; S3, Construct a static industry map Based on the dynamic neural causal discovery mechanism, the trend components are respectively and fluctuation components Construct a dynamic cause-effect graph; S4. Static industry graphs are integrated using a two-stage cause-effect industry graph fusion mechanism. By integrating with dynamic causal graphs, trend components are constructed separately. and fluctuation components heterogeneous propagation diagram and ; S5. For heterogeneous propagation graphs and Trend component features were extracted based on Chebyshev spectral convolution. and fluctuation component characteristics ; S6. Based on heterogeneous time-series coding, trend component coding and volatility component coding are performed to obtain the time-series coded representation of the trend component. Temporal encoding representation of wave components ; S7. Integrating the temporal coding representation of trend components through additive fusion. Temporal encoding representation of wave components Based on the fused representation Z Predict the relative ranking of stock returns at a future target time.

[0022] In this embodiment of the invention, the output of the DC-DHM model is defined as the stock. u exist t The ranking of earnings at any given time, and the calculation method for earnings: ; In the formula, Indicates stock u exist t To eliminate the influence of absolute prices across different stocks and transform the data into a comparable ranking task, this embodiment employs cross-sectional ranking normalization to process returns. Specifically, for each time point... t Sort all stocks by return rate and convert the raw return rate into a relative ranking score: In the formula, Indicates stock u exist t The returns at time point are ranked in descending order among all stocks (range [1, S]). This normalization maps the ranking to the interval (0, 1], representing the relative strength of the stocks. The stock prediction task can be defined as: given historical features... Jointly predict future normalized ranking scores In this embodiment, the following settings are provided. d =1, which means predicting the ranking for the next day.

[0023] Furthermore, the trend-volatility decomposition in S2 specifically addresses the fact that financial market dynamics are driven by two distinctly different dynamic components: long-term trends and short-term fluctuations. To effectively capture this heterogeneity, a trend-volatility decomposition module is designed to explicitly separate the original time-series features into two complementary components. Specifically, for the original input features... After performing symmetrical boundary filling, average pooling was used to extract trend components. : ; In the formula, This indicates the average pooling operation. This indicates symmetrical boundary filling; in this embodiment, the average pooling kernel size k=5. Through calculation obtained wave components The decomposed features are mapped to the hidden layer dimensions through linear projection layers. D : ; ; In the formula, For learnable projection matrices, As a bias term, the linear projection layer mapping enhances the feature representation capability and provides an adaptive dimension for subsequent causal graph construction.

[0024] Furthermore, the construction of static industry graphs in S3 Specifically, this involves constructing a prior adjacency matrix based on industry relationship data. : ; Add self-loops to preserve the node's own characteristics: ; In the formula, and They represent stocks and industry, The model uses an identity matrix. Constructing a static industry graph provides structural priors for the model, especially during periods of data sparseness, and helps maintain reasonable correlations among stocks within the industry.

[0025] Furthermore, the dynamic neural causal discovery mechanism in S3 specifically addresses the following: In actual financial markets, causal relationships often manifest as multi-lag nonlinear influence patterns. For example, price changes in leading stocks may only significantly affect stocks in the same industry after 1-3 trading days. Based on this observation, this embodiment proposes a lag-perceived Granger causal discovery mechanism. This mechanism captures such complex dependencies by dynamically aggregating multi-lag features. Specifically, this mechanism, as a general module, uses the projected trend components from S2... Or fluctuation components as input features Build the current state With historical lag : ; ; In the formula, S For the number of shares, D For the hidden layer dimension of the model, T Let L be the time step and L be the maximum lag order. This indicates a shift operation performed in the time dimension. Indicates 1 to T X, Represents time from 0 to T-1 X ; The aggregated representation of each lag order is obtained by aggregating nonlinear embedding functions and attention weights. Using the current state of the target sequence as the query and the lagged aggregation state of the source sequence as the key and value, a cross-attention mechanism is used to calculate stock values. For stocks The strength of the original causal influence The attention weight sequence is input into the gated recurrent unit, and the final hidden state is used as a temporally consistent causal strength measure to form the original score matrix of the dynamic causal graph.

[0026] In this embodiment of the invention, delayed attention aggregation perception specifically refers to: ; ; ; In the formula, and As a nonlinear embedding function, this mechanism enables the model to dynamically learn the importance weights of different lag orders, thereby achieving optimal aggregation of historical causal signals. Asymmetric cross-sequence dependency modeling specifically involves: To capture the asymmetric causal relationships between stocks, this embodiment designs an asymmetric cross-attention module, using the current state of the target sequence as the query and the lagged aggregation state of the source sequence as the key and value: ; This mechanism naturally generates an asymmetric attention matrix. , of which elements Indicates stock j For stocks i The strength of the original causal influence; The enhancement of timing consistency specifically includes: To ensure the temporal stability of causal signals, a gated recurrent unit is introduced to model the attention sequence: ; Through a differentiable learning process, the causal graph can adaptively adjust to market conditions, providing a structured inductive bias for subsequent trend-fluctuation heterogeneous modeling, and realizing dynamic learning of directional causal relationships.

[0027] Furthermore, the two-stage causal industry graph fusion mechanism in S4 is as follows: the dependencies between variables in the financial system are simultaneously influenced by data-driven causal mechanisms and domain knowledge-guided structural priors. To balance these two aspects, this embodiment proposes a two-stage fusion mechanism that maintains the flexibility of causal discovery while introducing inductive bias from industry classification. Specifically: Phase 1: Causal Discovery Regularization. In the causal discovery phase, industry priors are incorporated to suppress spurious causal connections, and the original score matrix of the dynamic causal graph is... Compared with static industry charts Learnable weights Perform weighted fusion: ; In the formula, For regularized causal matrix, For the Sigmoid function, Applying the sparsemax operator, the final dynamic causality matrix is ​​obtained. This regularization effectively suppresses spurious causal connections across industries (such as non-causal correlations between the banking and semiconductor sectors), especially in cases of sparse or noisy data. Phase Two: Construction of Heterogeneous Propagation Graph for Each Stock Introducing trend scalar gating and fluctuation scalar gating : ; ; In the formula, , Trend encoder and fluctuation encoder respectively t The output of each node is embedded at each time step (using mean pooling). , For the weights and biases of the trend encoder, , Weights and biases for the fluctuation encoder; construct a trend heterogeneous propagation graph. And wave heterogeneous propagation diagram : ; ; In the formula, For trend gating matrix, It is a fluctuation-gated matrix.

[0028] In this embodiment of the invention, for The application of the sparsemax operator is as follows: ; ; In the formula, It is an (S-1) dimensional probabilistic simplex.

[0029] Furthermore, S5 extracts trend component features based on Chebyshev spectral convolution. and fluctuation component characteristics Specifically, to effectively aggregate correlation information among stocks, Chebyshev spectral graph convolution is used to achieve cross-node feature propagation. The core idea of ​​spectral graph convolution is to perform filtering operations in the frequency domain of the graph Laplacian operator, avoiding expensive feature decomposition through polynomial approximation. Specifically, for a given heterogeneous propagation graph, the normalized Laplacian matrix is ​​calculated. ,in For degree matrix, Given an adjacency matrix, map the eigenvalues ​​to the interval [-1, 1] to satisfy the domain requirement of the Chebyshev polynomial. Convolution is performed independently at each time step, residual connections are introduced, layer normalization is applied to stabilize the training process, a feedforward network is introduced to enhance the nonlinear representation, and the results are obtained based on parameter-independent Chebyshev filters. and : ; ; This parameter separation design allows the model to assign differentiated filtering strategies for trend propagation and fluctuation propagation, where, For trend-learnable parameters, For fluctuating learnable parameters, The trend characteristics are derived from trend-volatility decomposition. The volatility characteristics are those obtained after trend-volume decomposition. Trend Heterogeneous Propagation Diagram The Laplacian matrix after eigenvalue mapping Wave heterogeneous propagation diagram The Laplacian matrix after eigenvalue mapping For Chebyshev polynomials, Through recursion calculate, , .

[0030] In this embodiment of the invention, the independent convolution formula is: ; In the formula, After convolution , for t Characteristics of time steps This represents a Chebyshev convolution operation, with residual connections represented as follows: ; In the formula, These are the features after residual connection. For convolutional features, The original features are represented as follows: The normalized layer is represented as follows: ; In the formula, The features output by the normalization layer, To represent the normalization layer operation, the feedforward network is represented as: ; In the formula, The output characteristics of the feedforward network, , Here is the weight matrix of the feedforward network. , This is the bias of the feedforward network.

[0031] Furthermore, the trend component encoding in S6 specifically involves: the trend component representing the long-term evolution process driven by fundamentals, whose dynamic characteristics are relatively smooth, slow changes and long-range dependencies. To effectively capture this long-term dependency, an attention-enhanced Long Short-Term Memory (LSTM) network is used to perform temporal modeling of the trend features. The input features are mapped to a high-dimensional space through nonlinear projection. The mapped features are then input into a two-layer LSTM. A temporal attention mechanism is added at the top of the LSTM to calculate the weights of each historical state on the current prediction. The weighted sum is then used to obtain the context vector. The final hidden state of the LSTM is concatenated with the context vector, and a nonlinear transformation is used to obtain the temporal encoding representation of the trend component. .

[0032] In this embodiment of the invention, the nonlinear projection specifically refers to: ; In the formula, The trend characteristics are those after nonlinear projection. The weight matrix is ​​for nonlinear projection. As a bias for nonlinear projection, the temporal attention mechanism is as follows: ; ; ; In the formula, For LSTM in time t The hidden state, For attention weights, As a weighted aggregation of context vectors, the attention mechanism enables the model to adaptively focus on historical states most relevant to the current prediction, making it particularly suitable for capturing key turning points in trend evolution. The final hidden state of the LSTM is concatenated with the attention context vector, and a temporal encoding representation of the trend component is obtained through a nonlinear transformation. ; ; In the formula, This is the final hidden state. For the final time step T The hidden state, , This is the weight matrix. , For bias.

[0033] Furthermore, the volatility component encoding in S6 specifically involves: Volatility components represent short-term fluctuations driven by market sentiment and sudden events, exhibiting dynamic characteristics such as high frequency, non-stationarity, and instantaneous spillover effects. To capture this rapidly changing pattern, a causal masking Transformer is used for temporal modeling. This architecture effectively captures instantaneous dependencies across assets while maintaining temporal causal constraints. Features are input into the causal masking Transformer, whose self-attention layer employs a strict lower triangular causal mask. After passing through a feedforward network, the temporal encoded representation of the volatility components is output. .

[0034] In this embodiment of the invention, the causal self-attention mechanism is specifically as follows: ; In the formula, M is the lower triangular causal mask matrix, when hour, for Otherwise, it is 0; this design ensures that the model predicts based solely on historical fluctuation patterns, conforming to actual trading scenarios in financial markets. A single-layer Transformer architecture is used to maintain high sensitivity to sudden changes and avoid excessive smoothing of high-frequency signals by multi-layer networks. In this embodiment, the encoding process adopts a standard Transformer block structure: ; ; In the formula, It consists of two linear transformations and the ReLU activation function. This provides the final time-series representation of the volatility components, preserving the instantaneous characteristics of short-term volatility and the spillover effects across stocks.

[0035] Furthermore, additive fusion in S7 specifically refers to: ; In the formula, For the fused encoding representation, when the system response is linear, the total output equals the sum of the outputs of each component. This simple mechanism maintains the interpretability of component decoupling while avoiding overfitting. The features of the last time step predict the stock ranking of the next time step.

[0036] In this embodiment of the invention, a linear layer is used as the prediction variable, and predictions are generated only using the last p=1 time steps, thus avoiding interference from distant historical information on short-term predictions. ; ; In the formula, For predictive coding representation, for T Fusion coding representation of time steps, For the predicted results, To predict weights, For predicting bias.

[0037] Furthermore, the DC-DHM model is trained using the mean squared error between the predicted stock rankings and the actual rankings as the loss function.

[0038] In this embodiment of the invention, the loss function is specifically: ; In the formula, For stocks i Normalized ranking tags This is the predicted value. This optimization objective directly aligns with the model output and the core task of financial forecasting: accurately predicting the relative performance ranking of stocks.

[0039] In one embodiment of the present invention, stock market data from the Tushare financial data platform is used to evaluate the performance of the method proposed in this embodiment. Specifically: The financial data covers two major indices: CSI300 and CSI500, including the largest and most liquid stocks listed on the Shanghai and Shenzhen Stock Exchanges. The dataset contains daily trading records from January 1, 2021 to September 30, 2025, and extracts 13 key features: opening price, highest price, lowest price, closing price, trading volume, turnover, volume ratio, turnover rate, MACD, RSI, EMA, ADX, and net capital inflow / outflow. These features cover multiple dimensions of price momentum, trading activity, technical indicators, and capital flows, providing rich predictive signals for the model. All datasets cover daily information from 2021 to 2025. Data from 2021 to 2023 is used as the training set, data from 2024 as the validation set, and data from 2025 as the test set to evaluate the model's performance under the latest market conditions. In addition, relational data from Shenwan industry classification, i.e., department-industry relationships, were collected. The statistical information of the dataset is shown in Table 1. Table 1. Statistical Information of the Dataset

[0040] To comprehensively depict stock price dynamics, the dataset underwent a standardized preprocessing process: (1) a forward imputation strategy was adopted for missing values; (2) stocks with missing values ​​were removed; (3) the features of each stock were standardized by stock Z-score to eliminate dimensional differences; (4) the label construction adopted the cross-sectional rank normalization ranking of the next day's return to enhance the model's predictive ability for relative performance rather than absolute price.

[0041] All experiments were implemented using PyTorch 2.4.1 on an NVIDIA A800 GPU, with prediction intervals... d =1, the goal is to predict the ranking of the stock's returns for the next day. Training uses batch processing.

[0042] The learning rate was set to 0.0008, and the Adam optimizer was used for parameter updates. Optimal hyperparameters were determined through grid search, including the lookback window τ∈{5,7,9,11,13,15,17,21,23,25}, the kernel size k∈{1,3,5,7,9,11,13,15} of the TFD module, the hidden layer dimension D∈{32,64,128,256}, and the lag order lag for trend and fluctuation in the CGC module ∈{1,3,5,7,9,11,13,15}. The final values ​​were τ=15, k=5, D=64, lagT=lagF=5. To prevent overfitting, the maximum number of training epochs was set to 200, with an early stopping tolerance of 10 epochs. Each experiment was repeated 5 times, randomly initialized, and the average performance was reported.

[0043] To compare the performance of different methods, this embodiment employs four widely used and stable ranking metrics: Information Coefficient (IC), Information Coefficient-Information Ratio (ICIR), Rank Information Coefficient (RankIC), and Rank Information Coefficient-Information Ratio (RankICIR). The Information Coefficient (IC) is the mean of the Pearson correlation coefficients between predicted and actual values, measuring prediction accuracy. The Rank Information Coefficient (RankIC) is the mean of the Spearman correlation coefficients between predicted and actual rankings, assessing relative ranking prediction ability. The ICIR is the ratio of IC to its standard deviation, measuring prediction stability. The RankICIR is the ratio of RankIC to its standard deviation, assessing the stability of ranking predictions.

[0044] To comprehensively evaluate the performance of the proposed method in this embodiment, it is compared with several existing stock price prediction baseline methods: (1) XGBoost: an ensemble method based on decision trees; (2) LSTM: a recurrent neural network that can effectively capture long-term dependencies in financial time series; (3) GRU: a computationally efficient variant of LSTM with considerable modeling capabilities; (4) SFM: a stock prediction model based on a combination of state memory and frequency modeling; (5) DA-RNN: a recurrent neural network that combines a two-stage attention mechanism and can effectively capture distance dependencies in time series; (6) TCN: a time series convolutional model that provides improved parallel computation compared to recurrent architectures; (7) Transformer: a self-attention-based model that excels at long-distance dependencies. Dependency modeling and parallel efficiency; (8) GAT: A graph neural network that models inter-population relationships through graph attention mechanism; (9) RSR-E / RSR-I: A graph neural network that combines temporal graph convolution to model dynamic relationships between stocks to predict stock rankings; (10) DTML: A stock prediction model that integrates dynamic inter-stock correlations with market information and is based on attention; (11) THGNN: A stock prediction model based on feature correlation within a time window and designed with a two-stage attention mechanism to learn temporal relationships; (12) MASTER: A stock prediction model that combines instantaneous and cross-time inter-stock correlations with market information; (13) MATCC: A stock ranking prediction model that combines market trends and decomposes stock data into trend and volatility components, and mines cross-time correlation structures. All baseline models use the same data preprocessing process and evaluation criteria to ensure comparability of results. Model hyperparameters are tuned through validation set performance to minimize validation set loss.

[0045] The performance of the proposed DC-DHM model and other models on the CSI300 and CSI500 datasets in this embodiment is shown in Table 2: Table 2 Performance Evaluation Results

[0046] As can be seen, the prediction method proposed in this embodiment significantly outperforms existing stock prediction methods. It has been comprehensively compared with cutting-edge models such as XGBoost, LSTM, GRU, SFM, Transformer, GAT, THGNN, and MASTER. On the CSI300 dataset, DC-DHM achieves an IC index of 0.0482, which is 72.8% higher than the second-best model MATCC (0.0279), and the ICIR is 46.8% higher. RankIC (0.0454) and RankICIR (0.3441) are improved by 115.2% and 54.8%, respectively. On the CSI500 dataset, IC (0.0649) is 9.6% higher than MATCC (0.0592), and the ICIR (0.5221) is 13.4% higher. RankIC (0.0615) and RankICIR (0.5162) are improved by 8.7% and 12.4%, respectively. These results demonstrate that DC-DHM has significant advantages in capturing market dynamics and complex inter-stock dependencies, particularly in predictive stability (ICIR), validating its strong robustness across different market environments. The performance improvement is primarily attributed to three synergistic mechanisms: first, explicit trend-volatility decomposition allows the model to handle long-term fundamental drivers and short-term event-driven volatility separately; second, a learnable causal discovery module dynamically identifies directional spillover paths through sparse gating; and finally, a heterogeneous propagation architecture dynamically allocates dedicated processing pathways for different time scales. This synergistic design of decomposition-learning-propagation enables the model to adapt to different market conditions, effectively balancing industry priors with data-driven causal relationships.

[0047] To verify the effectiveness of each component and heterogeneous modeling in the model, ablation studies were conducted on the CSI300 and CSI500 datasets. For each variant, one additional component was removed: trendless fluctuation decomposition (w / o TFD); causal graph convolutional module (w / o CGC); heterogeneous temporal coding module (w / o HTEM); trendless component coding (w / o TE); and fluctuation component coding (w / o FE). This embodiment also verified the impact of changing the trend component coding and fluctuation component coding on model performance (change order). The results are summarized in Table 3: Table 3 Ablation Experiment Results

[0048] It can be seen that removing the trend-volatility decomposition module significantly reduces the IC of CSI300, confirming the necessity of multi-scale decomposition for capturing heterogeneous financial dynamics. Disabling dynamic causal graph convolution leads to a significant reduction in ICIR, highlighting the crucial role of learnable asymmetric causal structures in predictive stability. Removing the heterogeneous time series encoding module results in a significant reduction in all indicators, indicating that this module plays an irreplaceable role in capturing multi-scale dynamic correlations in financial time series by differentially modeling the interaction mechanism of trend and volatility components. Removing the trend component encoding significantly reduces prediction accuracy, verifying that long-range dependency modeling requires a specialized time series architecture. Removing the volatility component encoding causes the IC of CSI300 to turn negative, indicating that instantaneous volatility requires a specific causal perception mechanism. Finally, completely swapping the two encoder architectures still leads to a significant performance degradation, confirming that trend and volatility components have fundamentally different dynamic characteristics, requiring matched differentiated modeling mechanisms.

[0049] To test the practical application of DC-DHM in real-world trading scenarios, an equal-weighted long portfolio strategy was constructed on the CSI300 and CSI500 datasets and compared with all baseline models. The profitability and risk-adjusted return of the model were evaluated using two important analytical metrics: cumulative return (CR) shows the wealth accumulated over time, and the annualized Sharpe ratio (SR) measures the trading strategy's return versus risk. For each time step in the test set... t ,according to A portfolio containing the top K stocks is constructed in descending order, and simulated buying transactions are performed. Then, through... t Simulate a sell transaction at time +1 and calculate CR and SR to evaluate the actual performance of the portfolio. t The daily rate of return is defined as: ; In the formula, express t A portfolio of stocks predicted at specific times. Overall performance on the test set, measured by CR and annualized SR, is defined as: ; ; In the formula, It is the risk-free rate of return. This is an annualized factor, assuming 252 trading days in a year. We choose K∈{1,5,10} to calculate the indicator results. To further simulate the trading environment of the real market, we consider the [missing information - likely a specific factor or parameter]. t The stock situation at the end of the trading day was analyzed, excluding stocks that were at their daily limit up, daily limit down, suspended from trading, or designated as ST (Special Treatment) stocks. The results are summarized in Table 4: Table 4. Model backtracking results

[0050] As can be seen, DC-DHM significantly outperforms all baseline models in both Sharpe ratio (SR) and cumulative return (CR), and demonstrates robust performance across different portfolio sizes. In the CSI300 Top-1 portfolio, its SR (2.63) is 37.0% higher than the second-best model, MATCC (1.92); in the CSI500 Top-1 portfolio, its SR (3.07) is 55.8% higher than MATCC (1.97). This advantage is also evident in the Top-5 and Top-10 portfolios. The results indicate that DC-DHM can reliably screen for stocks with excellent future performance, and the constructed portfolios generate superior and robust risk-adjusted returns under various market conditions.

[0051] The average causal structure heatmap of DC-DHM in three representative industries (non-ferrous metals, automobiles, and telecommunications) in the CSI300 index is shown below. Figure 3 As shown, the heatmap is divided into 3×3 regions. The diagonal blocks reflect strong causal connections within industries, while the off-diagonal blocks reveal asymmetric causal relationships across industries. A core-periphery structure exists within each industry, with a few companies having a significant guiding effect on other stocks within the industry. This visualization validates the model's successful identification of directional causal relationships, providing interpretable evidence for understanding market risk transmission mechanisms.

[0052] The actual rankings of the top 20 CSI300 constituent stocks (left) and the DC-DHM predicted rankings (right) are shown below. Figure 4 As shown, by calculating the stock returns for each test trading day to generate the daily best ranking, it can be observed that the ranking score of each selected stock fluctuates frequently due to price volatility. This indicates that investors need to understand the long-term evolution of the stock market to avoid investment risks. The predicted ranking scores for each stock on the right are similar to the actual rankings. The high consistency between the prediction results and the actual trend validates the effectiveness of heterogeneous modeling and explains its robust performance in strategy backtesting.

[0053] like Figures 5-11 As shown, to verify the robustness of DC-DHM, a systematic analysis of the hyperparameters was performed on CSI500, including the lookback window length τ, the average pooling kernel size k, the hidden layer dimension D, and the trend / fluctuation lag order lag in CGC. Lookback window length τ: as shown... Figure 5 As shown, the performance first increases and then decreases with increasing τ, reaching a peak at τ=15, indicating that an appropriate lookback window can capture sufficient historical information to identify market patterns. When τ>15, the indicator decreases significantly, verifying the hypothesis of local stationarity in financial markets—excessively long historical windows introduce noise. Average pooling kernel size k: Figure 6The performance is optimal when k=5, indicating that this scale effectively separates trend and volatility components. When k>5, the decomposition excessively smooths short-term volatility features, leading to a decrease in prediction accuracy, demonstrating that an appropriate decomposition scale can significantly enhance prediction stability. Hidden layer dimension D: Figure 7 This indicates that the model performs best when D=64. Performance drops significantly when D>128. This initial increase followed by a decrease suggests that too small a D cannot adequately represent complex market dynamics, while too large a D leads to overfitting. This demonstrates that high-dimensional representation introduces noise and reduces the stability of trading strategies, confirming the "small sample, high noise" characteristic of financial data, which necessitates an appropriate model size to avoid overfitting. Lag order: Figures 8-11 The heatmap shown reveals a trade-off between prediction accuracy and stability: IC / RankIC peaks at (trend lag order = 1, volatility lag order = 15), while ICIR / RankICIR is optimal at (trend lag order = volatility lag order = 5). This separation confirms that the trend and volatility components have fundamentally different dynamic characteristics, supporting the necessity of heterogeneous modeling.

[0054] Sensitivity experiments show that the optimal parameter combination of DC-DHM (τ=15, k=5, D=64, lag=5) is highly consistent with the intrinsic mechanism of financial markets. The model's sensitivity to τ and k verifies the necessity of trend-volatility decomposition, while the optimal value of the hidden layer dimension D reflects the low signal-to-noise ratio characteristics of financial data.

[0055] The various embodiments in this specification are described in a progressive manner, with each embodiment focusing on the differences from other embodiments. The same or similar parts between the various embodiments can be referred to each other.

[0056] Various modifications to these embodiments will be readily apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the invention. Therefore, the invention is not to be limited to the embodiments shown herein, but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.

Claims

1. A stock prediction method based on two-stage causal-industry graph fusion, characterized in that, Includes the following steps: S1. Obtain the stock collection Each stock u At time step t eigenvectors on , constitute the original input features , Using the feature dimension, a DC-DHM model for stock prediction is constructed; S2, convert the original input features Input the DC-DHM model and process the original input features Perform trend-volatility decomposition to obtain trend components. and fluctuation components ; S3, Construct a static industry map Based on the dynamic neural causal discovery mechanism, the trend components are respectively and fluctuation components Construct a dynamic cause-effect graph; S4. Static industry graphs are integrated using a two-stage cause-effect industry graph fusion mechanism. By integrating with dynamic causal graphs, trend components are constructed separately. and fluctuation components heterogeneous propagation diagram and ; S5. For heterogeneous propagation graphs and Trend component features were extracted based on Chebyshev spectral convolution. and fluctuation component characteristics ; S6. Based on heterogeneous time-series coding, trend component coding and volatility component coding are performed to obtain the time-series coded representation of the trend component. Temporal encoding representation of wave components ; S7. Integrating the temporal coding representation of trend components through additive fusion. Temporal encoding representation of wave components Based on the fused representation Z Predict the relative ranking of stock returns at a future target time.

2. The stock prediction method based on two-stage causal-industry graph fusion according to claim 1, characterized in that, The trend-fluctuation decomposition in S2 specifically involves: analyzing the original input features... After performing symmetrical boundary filling, average pooling was used to extract trend components. Through calculation obtained wave components The decomposed features are mapped to the hidden layer dimensions through linear projection layers. D : ; ; In the formula, For learnable projection matrices, This is a bias term.

3. The stock prediction method based on two-stage causal-industry graph fusion according to claim 1, characterized in that, Building a static industry graph in S3 Specifically, this involves constructing a prior adjacency matrix based on industry relationship data. : ; Add self-loops to preserve the node's own characteristics: ; In the formula, and They represent stocks and industry, It is an identity matrix.

4. The stock prediction method based on two-stage causal-industry graph fusion according to claim 1, characterized in that, The dynamic neural causal discovery mechanism in S3 specifically involves: transforming the trend component obtained in S2... and fluctuation components Collectively referred to as input features Build the current state With historical lag : ; ; In the formula, S For the number of shares, D For the hidden layer dimension of the model, T Let L be the time step and L be the maximum lag order. This indicates a shift operation performed in the time dimension. Indicates 1 to T X, Represents time from 0 to T-1 X ; The aggregated representation of each lag order is obtained by aggregating nonlinear embedding functions and attention weights. Using the current state of the target sequence as the query and the lagged aggregation state of the source sequence as the key and value, a cross-attention mechanism is used to calculate stock values. For stocks The strength of the original causal influence The attention weight sequence is input into the gated recurrent unit, and the final hidden state is used as a temporally consistent causal strength measure to form the original score matrix of the dynamic causal graph.

5. The stock prediction method based on two-stage causal-industry graph fusion according to claim 1, characterized in that, The two-stage cause-effect industry graph fusion mechanism in S4 specifically involves: merging the original score matrix of the dynamic cause-effect graph... Compared with static industry charts Learnable weights Perform weighted fusion: ; In the formula, For regularized causal matrix, For the Sigmoid function, Applying the sparsemax operator, the final dynamic causality matrix is ​​obtained. For each stock Introducing trend scalar gating and fluctuation scalar gating : ; ; In the formula, , Trend encoder and fluctuation encoder respectively t The output of the node is embedded at all times. , For the weights and biases of the trend encoder, , Weights and biases for the fluctuation encoder; construct a trend heterogeneous propagation graph. And wave heterogeneous propagation diagram : ; ; In the formula, For trend gating matrix, It is a fluctuation-gated matrix.

6. The stock prediction method based on two-stage causal-industry graph fusion according to claim 1, characterized in that, S5 extracts trend component features based on Chebyshev spectral convolution. and fluctuation component characteristics Specifically, for a given heterogeneous propagation graph, a normalized Laplacian matrix is ​​calculated, and the eigenvalues ​​are mapped to the interval [-1, 1] to satisfy the Chebyshev polynomial domain requirement. Convolution is performed independently at each time step, residual connections are introduced, and layer normalization is applied to stabilize the training process. A feedforward network is introduced to enhance the nonlinear expression, and Chebyshev filters with independent parameters are obtained respectively. and : ; ; In the formula, For trend-learnable parameters, For fluctuating learnable parameters, The trend characteristics are derived from trend-volatility decomposition. The volatility characteristics are those obtained after trend-volume decomposition. Trend Heterogeneous Propagation Diagram The Laplacian matrix after eigenvalue mapping Wave heterogeneous propagation diagram The Laplacian matrix after eigenvalue mapping It is a Chebyshev polynomial.

7. The stock prediction method based on two-stage causal-industry graph fusion according to claim 1, characterized in that, The trend component encoding in S6 is specifically as follows: Input features are mapped to a high-dimensional space via nonlinear projection. The mapped features are then input into a two-layer LSTM. A temporal attention mechanism is added at the top of the LSTM to calculate the weights of each historical state on the current prediction. These weighted sums are used to obtain a context vector. The final hidden state of the LSTM is concatenated with the context vector, and a nonlinear transformation is performed to obtain the temporal encoding representation of the trend component. .

8. The stock prediction method based on two-stage causal-industry graph fusion according to claim 1, characterized in that, The wave component encoding in S6 is specifically as follows: features are input into a causal mask Transformer. The Transformer's self-attention layer employs a strict lower triangular causal mask. After passing through a feedforward network, the output is a temporal encoded representation of the wave component. .

9. The stock prediction method based on two-stage causal-industry graph fusion according to claim 1, characterized in that, The additive fusion in S7 is specifically as follows: ; In the formula, For the fused encoding representation, take The features of the last time step predict the stock ranking of the next time step.

10. The stock prediction method based on two-stage causal-industry graph fusion according to claim 1, characterized in that, The DC-DHM model is trained using the mean squared error between the predicted stock rankings and the actual rankings as the loss function.