## 3 Proposed Methods Based on Causal Inference
### NOTEARS Causal Discovery Algorithm  
The mathematical expression for the Bayesian network has been previously provided and the transformation of the acyclic constraint yielded the final mathematical expression that requires optimization:  
\[min_{W\in R}^{d\times d}Q(W;X)+\frac{\rho}{2}|h(W)|^{2} \tag{8}\]  
Subject to the constraint \(h(W)=0\), a quadratic penalty term is introduced here with \(\rho>0\) representing the penalty for violating the constraint \(h(W)=0\). The equation above can be solved using the augmented Lagrange method with dual variables \(\alpha\). The augmented Lagrange method can be expressed as follows:  
\[L^{\alpha}(W,\ \alpha)=Q(W;X)+\frac{\rho}{2}|h(W)|^{2}+\alpha h(W) \tag{9}\]Its dual form is:  
\[max_{\alpha\in R}^{d\times d}D(\alpha),D(\alpha):=min_{W\in R}^{d\times d}L^{p}(W, \ \alpha) \tag{10}\]  
Subsequently, a challenging constrained optimization problem is transformed into an unconstrained augmented problem, as shown in the formula above. Let \(W_{\alpha}^{*}\) be the local solution for fixed \(\alpha\) in the augmented problem, then:  
\[W_{\alpha}^{*}=argmin_{W\in R}^{d\times d}L^{p}(W,\ \alpha) \tag{11}\]  
This problem can be effectively solved using any numerical method for unconstrained smooth minimization problems. Now, the initial solution \(W_{\alpha}^{*}\) has been obtained. Since the dual objective function \(D(\alpha)\) and \(\alpha\) satisfy a linear relationship, and the gradient value can be expressed as \(\
abla D(\alpha)=h(W_{\alpha}^{*})\), the most straightforward approach to solve the optimization problem is the gradient ascent method:  
\[\alpha\leftarrow\alpha+\rho h(W_{\alpha}^{*}) \tag{12}\]  
The step size, denoted by \(\rho\), is determined by comparing the augmented problem with the initial constraint problem. The gradients of these two expressions are as follows:  
\[\begin{array}{c}\
abla Q(W;X)+[\alpha+\rho h(W)]\
abla h(W)=0\\ \
abla Q(W;X)+\alpha\
abla h(W)=0\end{array} \tag{13}\]  
Based on the solution process of the aforementioned unconstrained optimization problem, the complete procedure for the novel causal network structure learning algorithm employed in this paper is presented in Algorithm 1. It is worth noting that the expression for the acyclic constraint is \(h(W)=0\). However, the optimization accuracy set in the algorithm is \(\varepsilon>0\), a value very close to 0. This introduces a challenge. Although the final result closely approximates a directed acyclic graph, it cannot guarantee obtaining a directed acyclic graph that strictly satisfies the constraint conditions. Therefore, a post-processing step is introduced: defining \(B(\omega)=I(|W|)>\omega\) and finding the minimum threshold \(\omega^{*}>0\) that satisfies the definition. By doing so, we can obtain the directed acyclic graph, where \(I(|W|)\) represents the indicator function.  
```
Input: minimization speed \(C\in(0,1)\), penalty growth rate \(r>1\), initial solution \((w_{0},\alpha_{0})\), optimization accuracy \(\varepsilon>0\). Output: Return the threshold matrix to build causal network
1. For\(t=0,\cdots,\infty\).
2. Solve the initial problem \(W_{t+1}\leftarrow\text{argmin}L^{p}(w,\alpha_{t})\) ;
3. If\(h(W_{t+1})\geq c\cdot h(W_{t})\); let \(\rho\gets r\rho\) and return 1;
4. If\(h(W_{t+1})<\varepsilon\) then return;
5. Otherwise, use the pairwise gradient ascent method \(\alpha_{t+1}\leftarrow\alpha+\rho h(W_{t+1})\) and repeat the above procedure until the optimization accuracy is set
```  
**Algorithm 1**NOTEARS algorithm.