# Fatigue Crack and Residual Life Prediction Based on an Adaptive Dynamic Bayesian Network
## 2 Principle and Methods
### Introduction to Particle Filter  
#### 2.3.1 Dynamic Time-Varying System Evolution Equation  
Particle filtering (PF), also known as Sequential Monte Carlo, is a general algorithm for the evolution of state variables in DBNs [30]. Particle filtering approximates probability distributions by sampling a set of random samples and then performs statistical calculations on these samples to obtain the minimum variance estimation of the state; these samples are referred to as \"particles\". As the number of particles increases, the probability density function described by all particles gradually approximates the true probability distribution of the state, achieving the effect of optimal Bayesian estimation.  
Assume there is a system, as shown in Figure 3, whose state variable \(\mathbf{X}_{t}{\in}R^{m}\) at time \(t\) evolves from the state variable \(\mathbf{X}_{t-1}{\in}R^{m}\) at time \(t-1\) according to the following state function:  
\[\mathbf{X}_{t}=f(\mathbf{X}_{t},\mathbf{v}_{t-1}) \tag{9}\]  
where the vector \(\mathbf{v}_{t-1}{\in}R^{m}\) represents the noise in the state function.  
The observed data \(\mathbf{Z}_{t}{\in}R_{n}\) can be obtained via the following measurement function:  
\[\mathbf{Z}_{t}=h(\mathbf{X}_{t},\mathbf{n}_{t}) \tag{10}\]  
From the perspective of Bayesian theory, the state estimation problem is to calculate the credibility of the current state \(\mathbf{X}_{t}\) based on a series of previously available data \(\mathbf{Z}_{1:t}\) (posterior knowledge) through recursive calculation. This credibility is the probability formula \(P(\mathbf{X}_{t}\,|\,\mathbf{Z}_{1:t})\), which needs to be calculated recursively through prediction and update steps.  
The prediction process uses the system model (i.e., state Equation (9)) to predict the prior probability density of the state, which is to guess the future state through existing prior knowledge, that is, \(P(\mathbf{X}(t)\,|\,\mathbf{X}(t-1))\). The update process uses the latest measurement value to correct the prior probability density and obtain the posterior probability density, which is to correct the previous guess.  
It is assumed that the system's state transition follows a first-order Martov model, that is, the current state \(\mathbf{X}(t)\) at time \(t\) is only related to the previous state \(\mathbf{X}(t-1)\). At the same time, it is assumed that the data \(\mathbf{Z}(t)\) measured at time \(t\) are only related to the current state \(X(t)\), as shown in measurement equation 10 above.  
Figure 3: A state evolution system with noise.  
Assuming that the probability density function \(P(\mathbf{X}_{t-1}\,|\,\mathbf{Z}_{1:t-1})\) of time \(t-1\) is known, the prediction of the probability of the next state \(\mathbf{X}(t)\) can be written as follows:  
\[p(\mathbf{X}_{t}|\mathbf{Z}_{1:t-1})=\int p(\mathbf{X}_{t}|\mathbf{X}_{t-1})\,p(\mathbf{X}_{t-1}| \mathbf{Z}_{1:t-1})\,dX_{t-1} \tag{11}\]  
where state \(\mathbf{X}(t)\) is exclusively determined by \(\mathbf{X}(t-1)\) due to the assumption of first-order Markov processes, i.e., \(p(\mathbf{X}_{t}\,|\,\mathbf{X}_{t-1},\mathbf{Z}_{1:t-1})=p(\mathbf{X}_{t}\,|\,\mathbf{X}_{t-1})\).  
After obtaining the new measurement data \(\mathbf{Z}_{t}\) at time \(t\), the correction of the prediction of formula 10 based on the measurement data can be stated as follows:  
\[p(\mathbf{X}_{t}|\mathbf{Z}_{1:t})=\frac{p(\mathbf{Z}_{t}|\mathbf{X}_{t})p(\mathbf{X}_{t}|\mathbf{Z}_{ 1:t-1})}{p(\mathbf{Z}_{t}|\mathbf{Z}_{1:t-1})} \tag{12}\]  
where \(p(\mathbf{Z}_{k}|\mathbf{Z}_{1:k-1})=\int p(\mathbf{Z}_{k}|\mathbf{X}_{t})p(\mathbf{X}_{k}|\mathbf{Z}_ {1:k-1})dX_{t}\). The filtering update is now complete.  
For generic nonlinear and non-Gaussian systems, it is challenging to arrive at the analytical solution of the posterior probability because the derivation above involves integration for continuous variables. Monte Carlo sampling must be used to address this issue.