Probabilistic time warping structure causal model and inference method thereof
By constructing a probabilistic time-warped causal model, explicitly modeling multi-source time shifts and noise, the problem of incorrect causal direction judgment is solved, and robust learning and accurate decision-making of causal structures are achieved.
Patent Information
- Application Number
- CN202511813625.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-12-04
- Publication Date
- 2026-03-03
AI Technical Summary
Existing technologies fail to effectively model multi-source time shifts, leading to errors in causal direction judgment and spurious associations. Furthermore, they lack a unified framework to address time uncertainty, causal structure uncertainty, and causal effect strength uncertainty.
We construct a probabilistic time-warped structural causal model. By estimating the posterior distribution of the true time of events and combining it with a hierarchical Bayesian structural causal model, we employ prior modulation and conditional likelihood strategies to explicitly model systematic biases and observation noise, thereby enabling robust causal structure learning.
It improves the accuracy of causal discovery, reduces misjudgments of causal direction and false detections of structure, provides posterior distributions of time, structure and effect parameters, and supports more reliable causal relationship decisions.
Smart Images

Figure CN121599121A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of structural causal model learning technology, and more specifically, to a probabilistic time-warped structural causal model and its inference method. Background Technology
[0002] In many real-world applications, such as news event analysis, multi-sensor network monitoring, distributed system log aggregation, or manual report summarization, the same event is often recorded by multiple independent sources. However, due to local clock skew, transmission delays, and differences in processing logic among these sources, the timestamps recorded for the same event often exhibit systematic bias and random noise. This "multi-source time bias" problem poses a significant challenge to time-series-based causal discovery.
[0003] Traditional structural causal model (SCM) learning methods, such as PC algorithms, NOTEARS, or Granger causal analysis, typically implicitly assume that the time labels of events are accurate or simply apply hard time windows. They fail to model the inherent uncertainty of time as an explicit statistical object, let alone propagate and incorporate this uncertainty into the causal structure learning process. This makes it highly susceptible to incorrect causal orientation judgments and spurious causal associations when these methods are directly applied to data with significant time shifts.
[0004] Furthermore, in practical problems, time uncertainty, causal structure uncertainty (whether an edge exists), and uncertainty about the strength of causal effects are often intertwined. Existing methods lack a unified probabilistic framework to jointly model these three uncertainties, making it difficult to give a strictly statistically significant probability of edge existence and to decompose the sources of uncertainty.
[0005] Therefore, there is an urgent need in this field for a new technical solution that can explicitly model multi-source time shifts, estimate the true time posterior of events, and perform robust causal structure learning on this basis. Summary of the Invention
[0006] The purpose of this invention is to address the shortcomings of existing technologies by probabilistic time-warped structural causal models and their inference methods.
[0007] To address the aforementioned technical problems, the present invention adopts the following technical solution:
[0008] A probabilistic time-warped structural causal model and its inference method, comprising the following steps:
[0009] S1. Obtain event observation time data and corresponding system variable observation data from multiple data sources;
[0010] S2. Construct a probabilistic time warp model and estimate the posterior distribution of the true time of the observed event based on the event observation time data;
[0011] S3. Based on the posterior distribution of the real time obtained in step S2, construct a hierarchical Bayesian causal model to jointly estimate the edge existence probability and posterior effect parameters of the causal graph structure.
[0012] S4. Based on the edge existence probability and effect parameters obtained in step S3, output the causal structure or make a decision.
[0013] As a further aspect of the present invention: in step S2, the probabilistic time warp model is defined as:
[0014] For the observation time t of event i and source s i,s The generative model is:
[0015] ;
[0016] Among them, t i,s Report the observation time of event i to data source s;
[0017] τ i Let be the actual occurrence time of event i, which is a latent variable;
[0018] δ s For the systematic time offset parameter of data source s;
[0019] ε i,s To observe noise;
[0020] The observed noise ε i,s It follows a Laplace distribution, a Gaussian distribution, or a Student-t distribution.
[0021] As a further aspect of the present invention: the systematic time offset parameter δ s Impose an identifiability constraint, which is: δ from all sources s The sum is zero, that is Alternatively, the systematic time offset parameter from which one parameter originates can be fixed to zero. .
[0022] As a further aspect of the present invention: the observation noise ε i,s Modeling is performed using the Laplace distribution, i.e., ε i,s ~Laplace(0,b), where b is a scaling parameter to enhance the robustness of the system to abnormal timestamps in the heterogeneous data source.
[0023] As a further aspect of the present invention: in step S3, the application of the posterior distribution of the actual occurrence time to the hierarchical Bayesian causal model is achieved using one of the following two strategies:
[0024] Strategy A, Prior Modulation:
[0025] Calculate the empirical probability p that variable u occurs earlier than variable v. uv, and the probability p uv This is mapped to the prior probability π of the candidate edge u→v through a monotonic mapping function. uv;
[0026] Strategy B, Conditional Likelihood:
[0027] In the observation likelihood function of the structural causal model, the actual time τ is used as a condition variable, or the time difference τ is used. v - τ u Construct weights or delay terms such that the contribution of a sample is quantified by P(τ). u < τ v Weighted.
[0028] As a further aspect of the present invention, strategy A is implemented through the following sub-steps:
[0029] Step S3A.1: Draw M samples from the true time posterior distribution p(τ|t).
[0030] {τ (1) , τ (2) , ..., τ (M)};
[0031] Step S3A.2: Calculate the empirical probability that variable u occurs before variable v. ;in:
[0032] P(τu<τv): The time τu is the time to first reach state u from the starting point. Less than the time to first reach state v The probability of;
[0033] M: Total number of Monte Carlo simulations;
[0034] , : The time to reach u and v in the m-th simulation; This is an indicator function, which is 1 if u is reached first in the m-th simulation, and 0 otherwise;
[0035] Step S3A.3: Calculate the empirical probability p uv The mapping is such that the edge has an indicator variable z. uv The prior probability πuv =σ(α0 +α1·p uv ), where σ(·) is the logistic function, and α0 and
[0036] α1 is a preset or learnable parameter.
[0037] As a further aspect of the present invention: when strategy B is adopted, the observation model of the hierarchical Bayesian structural causal model is defined as linear in form:
[0038]
[0039] in, To be based on the actual time difference Estimated delay parameters.
[0040] As a further aspect of the present invention, the inference process of steps S2 and S3 can be implemented in any one or more of the following ways:
[0041] We employ a joint sampling or block-alternating sampling method based on Markov chain Monte Carlo to perform posterior inference on all latent variables in the model.
[0042] A variational inference method is adopted, which introduces a variational distribution to approximate the true posterior, and then uses stochastic gradient descent for optimization.
[0043] There are indicator variables for the discrete edges in the model. The Gumbel-Softmax relaxation technique is used to achieve gradient optimization.
[0044] As a further aspect of the present invention: the block-based alternating sampling specifically comprises:
[0045] Step A: Fix the current causal structure z and effect parameter β, and update the real time τ and systematic time offset δ in the probabilistic time warp model;
[0046] Step B: Under the condition of fixing the current real time τ and the systematic time offset δ, update the causal structure z and effect parameter β in the hierarchical Bayesian causal model;
[0047] Repeat steps A and B until the model converges.
[0048] Compared with the prior art, the advantages of this invention are:
[0049] First, this approach explicitly models the systematic bias and observation noise of the data source, enabling more accurate estimation of the true time of events and improving the quality of causal discovery from the source of the data.
[0050] Second, this scheme provides a more reliable statistical basis for edge existence and direction judgment by propagating the estimated posterior uncertainty to the causal structure learning stage, effectively reducing misjudgment of causal direction and false detection of structure.
[0051] Third, this scheme, within a unified Bayesian framework, jointly outputs the posterior distributions of time, structure, and effect parameters, enabling a comprehensive quantification of the uncertainties at each stage of the model and providing richer information for causal-based decision-making.
[0052] Fourth, this solution provides a complete technical path from accurate inference to engineering approximation, and proposes two fusion strategies: prior modulation and conditional likelihood, which enable the model to adapt to different scenarios and scale requirements from academic research to industrial applications. Attached Figure Description
[0053] Figure 1 This is a flowchart of the present invention. Detailed Implementation
[0054] The technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings of the embodiments of the present invention. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. All other embodiments obtained by those skilled in the art based on the embodiments of the present invention without creative effort are within the scope of protection of the present invention.
[0055] Example 1
[0056] like Figure 1 As shown, a probabilistic time-warped structural causal model and its inference method include the following steps:
[0057] S1. Data acquisition and preprocessing;
[0058] Obtain event observation time data t from multiple data sources i,s Where i represents the event index and s represents the data source index. Simultaneously, system variable observation data x corresponding to these events are collected.
[0059] S2. Construct and infer the probabilistic time warp (PTW) model;
[0060] Based on the acquired event observation time data, a probabilistic time warp model is constructed to estimate the posterior distribution p(τ|t) of the true time of each observed event.
[0061] The generation process of the PTW model is defined as follows: for event i and source s, the observation time t i,s, satisfy:
[0062] ;
[0063] Among them, t i,s Report the observation time of event i to data source s;
[0064] τ i Let be the actual occurrence time of event i, which is a latent variable;
[0065] δ s For the systematic time offset parameter of data source s;
[0066] ε i,s To observe noise, a Laplace distribution is typically used to enhance robustness to outliers, i.e., ε i,s ~Laplace(0,b), where b is the scaling parameter. Alternatively, a Gaussian distribution or a Student-t distribution can be chosen depending on the data characteristics.
[0067] In addition, to ensure the model's identifiability, the systematic time offset parameter δ needs to be adjusted. s Impose an identifiability constraint, which is: δ from all sources s The sum is zero, that is Alternatively, the systematic time offset parameter from which one parameter originates can be fixed to zero. .
[0068] S3. Construct and infer a hierarchical Bayesian causal model
[0069] Based on the posterior distribution p(τ|t) of the real time obtained in step S2, a hierarchical Bayesian causal model is constructed to jointly estimate the edge existence probability and posterior effect parameters of the causal graph structure.
[0070] The key lies in effectively integrating posterior temporal information into the structural causal model. This invention proposes two implementation strategies:
[0071] Strategy A, Prior Modulation (Preferred for Interpretability):
[0072] This strategy modulates the prior probability of causal edges based on temporal relationships. The specific steps are as follows:
[0073] Step S3A.1: Draw M samples from the real-time posterior distribution p(τ|t).
[0074] {τ (1) , τ (2) , ..., τ (M)};
[0075] Step S3A.2: For each pair of candidate variables (u, v), calculate the empirical probability that variable u occurs before variable v: ;in:
[0076] P(τu<τv): The time τu is the time to first reach state u from the starting point. Less than the time to first reach state v The probability of;
[0077] M: Total number of Monte Carlo simulations;
[0078] , : The time to reach u and v in the m-th simulation; This is an indicator function, which is 1 if u is reached first in the m-th simulation, and 0 otherwise.
[0079] Step S3A.3: Convert the empirical probability p uv This is mapped to the prior probability π of the candidate edge u→v through a monotonic mapping function. uv =σ(α0 +α1·p uv ), where σ(·) is the logistic function, and α0 and α1 are preset or learnable parameters. This prior probability π uv Subsequently used as an indicator variable z for the existence of edges. uv ~ Bernoulli (π) uv The prior distribution of ).
[0080] Strategy B, Conditional Likelihood:
[0081] This strategy directly incorporates real time into the observation likelihood function of the structural causal model. In the model's regression or conditional probability distribution, the real time τ is used as a condition variable, or the time difference τ is utilized. v - τ u Construct weights or delay terms such that the contribution of a sample is quantified by P(τ). u < τ v Weighted. For example, in a linear SCM observation model, the observation model of a hierarchical Bayesian structural causal model is defined in linear form:
[0082]
[0083] in, To be based on the actual time difference Estimated delay parameters.
[0084] S4. Based on the edge existence probability and posterior effect parameters obtained in step S3, output the causal structure (e.g., select edges with a posterior probability greater than 0.5 to form a causal graph), or use these uncertainty estimates for downstream decision support, intervention effect prediction, or proactive data collection strategies.
[0085] For the model inference in steps S2 and S3, this invention provides multiple implementation methods to adapt to different scales and accuracy requirements:
[0086] 1. Precise inference (suitable for small to medium scale)
[0087] Joint sampling: Using Hamiltonian Monte Carlo (HMC) or No-U-Turn Sampler (NUTS) algorithms, joint posterior sampling is performed on all latent variables {τ, δ, z, β} within the probabilistic programming framework of NumPyro, PyMC, etc.
[0088] Block-based alternating sampling: To reduce the difficulty of high-dimensional sampling, an alternating update strategy is adopted.
[0089] Specifically:
[0090] Step A: Fix the current causal structure z and effect parameter β, and update the real time τ and systematic time offset δ in the probabilistic time warp model;
[0091] Step B: Under the condition of fixing the current real time τ and the systematic time offset δ, update the causal structure z and effect parameter β in the hierarchical Bayesian causal model;
[0092] Repeat steps A and B until the model converges.
[0093] For discrete variable z uv It can be processed using reversible jump MCMC (RJMCMC) or Metropolis-Hastings flipping in Gibbs sampling.
[0094] 2. Engineering-based approximate inference (applicable to large-scale, online scenarios)
[0095] Variational inference: Introduce variational distributions for all latent variables and optimize the lower bound of evidence (ELBO) through stochastic gradient descent.
[0096] Amortization inference: Using neural networks to learn the mapping from observed data to variational parameters improves inference efficiency.
[0097] Gumbel-Softmax relaxation: for handling discrete variables in variational inference We obtain a differentiable gradient and continuously relax it using the Gumbel-Softmax distribution.
[0098] Online / Incremental Learning: For newly arriving data, fast maximum a posteriori (MAP) probability estimation or local variational updates can be performed only on the affected nodes or subgraphs based on the previously fitted model.
[0099] The above description is merely a preferred embodiment of the present invention; however, the scope of protection of the present invention is not limited thereto. Any equivalent substitutions or modifications made by those skilled in the art within the scope of the technology disclosed in the present invention, based on the technical solution and its improved concepts, should be covered within the scope of protection of the present invention.
Claims
1. A probabilistic time-warped structural causal model, characterized in that, Includes the following steps: S1. Obtain event observation time data and corresponding system variable observation data from multiple data sources; S2. Construct a probabilistic time warp model and estimate the posterior distribution of the true time of the observed event based on the event observation time data; S3. Based on the posterior distribution of the real time obtained in step S2, construct a hierarchical Bayesian causal model to jointly estimate the edge existence probability and posterior effect parameters of the causal graph structure. S4. Based on the edge existence probability and effect parameters obtained in step S3, output the causal structure or make a decision.
2. The probabilistic time-warped structural causal model according to claim 1, characterized in that: In step S2, the probabilistic time warp model is defined as: For the observation time t of event i and source s i,s The generative model is: ; Among them, t i,s Report the observation time of event i to data source s; τ i Let be the actual occurrence time of event i, which is a latent variable; δ s For the systematic time offset parameter of data source s; ε i,s To observe noise; The observed noise ε i,s It follows a Laplace distribution, a Gaussian distribution, or a Student-t distribution.
3. The probabilistic time-warped structural causal model according to claim 2, characterized in that: For the systematic time offset parameter δ s Impose an identifiability constraint, which is: δ from all sources s The sum is zero, that is Alternatively, the systematic time offset parameter from which one parameter originates can be fixed to zero. .
4. The probabilistic time-warped structural causal model according to claim 2, characterized in that: The observed noise ε i,s Modeling is performed using the Laplace distribution, i.e., ε i,s ~Laplace(0,b), where b is a scaling parameter to enhance the robustness of the system to abnormal timestamps in the heterogeneous data source.
5. The probabilistic time-warped structural causal model according to claim 1, characterized in that: In step S3, the application of the posterior distribution of the actual occurrence time to the hierarchical Bayesian causal model is achieved using one of the following two strategies: Strategy A, Prior Modulation: Calculate the empirical probability p that variable u occurs earlier than variable v. uv, and the probability p uv This is mapped to the prior probability π of the candidate edge u→v through a monotonic mapping function. uv; Strategy B, Conditional Likelihood: In the observation likelihood function of the structural causal model, the actual time τ is used as a condition variable, or the time difference τ is used. v - τ u Construct weights or delay terms such that the contribution of a sample is quantified by P(τ). u < τ v Weighted.
6. The probabilistic time-warped structural causal model according to claim 5, characterized in that: Strategy A is implemented through the following sub-steps: Step S3A.1: Draw M samples from the true time posterior distribution p(τ|t). {t} (1) , t (2) , ..., t (M) }; Step S3A.2: Calculate the empirical probability that variable u occurs before variable v. ;in: P(τu<τv): The time taken to first reach state u from the starting point. Less than the time to first reach state v The probability of; M: Total number of Monte Carlo simulations; , : The time to reach u and v in the m-th simulation; This is an indicator function, which is 1 if u is reached first in the m-th simulation, and 0 otherwise; Step S3A.3: Calculate the empirical probability p uv The mapping is such that the edge has an indicator variable z. uv The prior probability π uv =σ(α0 +α1·p uv ), where σ(·) is the logistic function, and α0 and α1 is a preset or learnable parameter.
7. The probabilistic time-warped structural causal model according to claim 1, characterized in that: When strategy B is adopted, the observation model of the hierarchical Bayesian causal model is defined as linear: ; in, To be based on the actual time difference Estimated delay parameters.
8. The method for inferring causality in a probabilistic time-warped structure according to claim 1, characterized in that: The inference process of steps S2 and S3 can be implemented in any one or more of the following ways: We employ a joint sampling or block-alternating sampling method based on Markov chain Monte Carlo to perform posterior inference on all latent variables in the model. A variational inference method is adopted, which introduces a variational distribution to approximate the true posterior, and then uses stochastic gradient descent for optimization. There are indicator variables for the discrete edges in the model. The Gumbel-Softmax relaxation technique is used to achieve gradient optimization.
9. The method for inferring causality of probabilistic time-warped structures according to claim 8, characterized in that: The block-based alternating sampling specifically refers to: Step A: Fix the current causal structure z and effect parameter β, and update the real time τ and systematic time offset δ in the probabilistic time warp model; Step B: Under the condition of fixing the current real time τ and the systematic time offset δ, update the causal structure z and effect parameter β in the hierarchical Bayesian causal model; Repeat steps A and B until the model converges.