## 2 Methods
### Root Cause Tracing Based on Adam Variational Inference Bayesian Neural Network
#### 2.2.2 Weighted Granger Causality Analysis Based on LSTM
\begin{split}\frac{\partial L_{i}}{\partial W_{i}}& =\frac{\partial L_{i}}{\partial\hat{x}_{i}(t)}\frac{\partial\hat{x }_{i}(t)}{\partial h_{t}}\frac{\partial h_{t}}{\partial C_{t}}\frac{\partial C _{t}}{\partial i_{t}}\frac{\partial\hat{t}_{t}}{\partial W_{i}}\\ &=-\frac{1}{nT}\sum_{t=1}^{T}((\frac{\partial L}{\partial C_{t}} \odot\hat{C}_{t})\odot i_{t}(1-i_{t}))\cdot[h_{t-1},x_{t}]^{T},\end{split}  \tag{15}\]  
\[ \begin{split}\frac{\partial L_{i}}{\partial W_{C}}& =\frac{\partial L_{i}}{\partial\hat{x}_{i}(t)}\frac{\partial\hat{x }_{i}(t)}{\partial h_{t}}\frac{\partial h_{t}}{\partial C_{t}}\frac{\partial C _{t}}{\partial C_{t}}\frac{\partial C_{t}}{\partial C_{t}}\\ &=-\frac{1}{nT}\sum_{t=1}^{T}((\frac{\partial L}{\partial C_{t}} \odot i_{t})\odot(1-\hat{C}_{t}^{2}))\cdot[h_{t-1},x_{t}]^{T},\end{split}  \tag{16}\]  
\[ \begin{split}\frac{\partial L_{i}}{\partial W_{o}}& =\frac{\partial L_{i}}{\partial\hat{x}_{i}(t)}\frac{\partial\hat{x }_{i}(t)}{\partial h_{t}}\frac{\partial h_{t}}{\partial o_{t}}\frac{\partial o _{t}}{\partial W_{o}}\\ &=-\frac{1}{nT}\sum_{t=1}^{T}((\frac{\partial L}{\partial h_{t}} \odot\tanh(C_{t}))\odot o_{t}(1-o_{t}))\cdot[h_{t-1},x_{t}]^{T},\end{split}  \tag{17}\]  
where \(\frac{\partial L}{\partial C_{t}}=(x_{i}(t)-\hat{x}_{i}(t))g^{\prime}(V_{x}h_{ t}+b_{x})V_{x}\odot o_{t}\odot(1-\tanh^{2}(C_{t}))\), \(\frac{\partial L}{\partial h_{t}}=-\frac{1}{nT}\sum_{t=1}^{T}(x_{i}(t)-\hat{x}_ {i}(t))g^{\prime}(V_{x}h_{t}+b_{x})V_{x}\). Using gradient descent with a learning rate \(\eta\), the weight update rule is given by  
\[\left\{ \begin{split} W_{f}&=W_{f}+\eta\frac{ \partial L_{i}}{\partial W_{f}},\\ W_{i}&=W_{i}+\eta\frac{\partial L_{i}}{\partial W _{i}},\\ W_{C}&=W_{C}+\eta\frac{\partial L_{i}}{\partial W _{C}},\\ W_{o}&=W_{o}+\eta\frac{\partial L_{i}}{\partial W _{o}}.\end{split} \right. \tag{18}\]  
B. Optimal causal path based on weighted coefficients  
In classical Granger causality analysis, the focus is typically on whether \(a_{ij}\) equals zero. \(x_{j}\) is considered not to Granger cause \(x_{i}\) if and only if \(a_{ij}=0\). To fully utilize the information in the coefficient matrix \(A\), we update \(a_{ij}\) as follows:  
\[\omega_{ij}=\frac{a_{ij}}{\|a_{i}\|_{1}}, \tag{19}\]  
where \(\|\cdot\|_{1}\) represents the \(L_{1}\) norm. If the coefficient \(\omega_{ij}\) is large, it indicates that the variable \(x_{j}\) has a significant effect on \(x_{i}\), meaning that \(x_{j}\) is more likely to be a Granger cause of \(x_{i}\). In other words, a larger value of \(\alpha_{ij}\) implies that \(x_{j}\) has stronger predictive power for \(x_{i}\). We also introduce a frequency coefficient \(\ell_{i}\), which represents the frequency with which a process variable \(x_{i}\) appears in the entire causal graph. It is expressed as  
\[\sigma_{i}=\frac{\sum l_{ki}}{\sum l_{k}}, \tag{20}\]  
where \(l_{ki}\) represents the causal path that includes the variable \(x_{i}\), and \(l_{k}\) refers to all causal paths in general. The larger the \(l_{ki}\), the greater the likelihood that the variable will cause an exception to occur. By combining the coefficient \(\alpha_{i}\) and the frequency coefficient \(\ell_{i}\), the weight coefficient \(\mathcal{W}\) is obtained:  
\[\mathcal{W}=\mathcal{A}\odot\mathcal{B}, \tag{21}\]  
where \(\mathcal{A}=[\alpha_{1}^{T},\alpha_{2}^{T},\ldots,\alpha_{n}^{T}]^{T}\), \(\mathcal{B}=[\ell_{1}^{T},\mathcal{E}_{2}^{T},\ldots,\ell_{n}^{T}]^{T}\), \(\odot\) represents the Hadamard product. \(\mathcal{A}\) represents the Granger causality coefficients between variables, and \(\mathcal{B}\) represents the frequency of occurrence of each variable. Therefore, the larger \(\mathcal{W}\), the more likely the variable is to cause an exception to occur. At this point, the weighted Granger causality graph can be represented as shown in Figure 4.  
Using the weights \(\mathcal{W}\), the causal path with the highest weight is identified as the final tracing result.