# Bayesian Survival Analysis Model for Girth Weld Failure Prediction
## Survival Prediction Model
### Bayesian Survival Analysis Function  
The Bayesian method [25] is used to obtain the distribution of parameters based on their prior distribution and the likelihood function.  
Since the 1970s, [PERSON] et al. [26,27] started using the Bayesian method for the analysis of survival data. Later, different theoretical models were developed. The Bayesian survival analysis method can make up for defects, such as small-sample and incomplete data, and achieve survival analysis or failure prediction. The prior distribution of girth-weld failure can be described as in Figure 2a, monotonically increasing or decreasing, satisfying the characteristics of the Weibull distribution. The probability density function of Weibull distribution is:  
\[f(x|\alpha,\lambda)=\lambda\alpha x^{\alpha-1}\exp(-\lambda x^{\alpha}) \tag{3}\]  
where \(\alpha\) is the size parameter, and \(\lambda\) is the shape parameter.  
Figure 2: Survival (**a**) and Hazard (**b**) functions of girth-weld accident.  
The survival function represents the probability that the analysis target survives to time \(t\), expressed as Equation (4):  
\[S(t|\alpha,\lambda)=P(T>t)=\int_{t}^{\infty}f(x|\alpha,\lambda)dx=\exp(-\lambda t ^{\alpha}) \tag{4}\]  
The sample data are related to the failure of girth welds. On the basis of the prior distribution and sample data, the posterior distribution of parameters at each stage can be obtained by the Bayesian method. However, we cannot determine the posterior distribution of parameters \(\alpha\) and \(\lambda\) before the analysis. Therefore, the Markov Chain Monte Carle (MCMC) [28] is used to solve the problem that the parameters of the posterior distribution are unknown, and the calculation process is complex. The calculation of the posterior distribution of the two parameters is performed by the WinBUGS [29]. Consider that the average value of the two parameters was 0.7298 and 0.1118. Because the sample data were taken from the failure girth-weld data, in the 63 rd year, all girth welds failed, and the corresponding survival probability was 0. Take the lower-limit value and the upper-limit value of the two parameters under the 90% confidence interval. The survival function is shown by the dotted line in Figure 3.  
If the survival function conforms to the Weibull distribution, \(In[-InS(t|\alpha,\lambda)]\) is linearly distributed to \((t)\).  
\[In[-InS(t|\alpha,\lambda)]=In(\lambda)+\alpha In(t) \tag{5}\]  
The Kaplan-Meier survival function in Figure 3 does not exactly fit the linear relationship. Therefore, the data of girth-weld failed samples do not completely conform to the Weibull distribution. In Figure 3, the data from 10 years are in good agreement with the Weibull distribution; however, a wide range of confidence intervals and some of the data are outside the range after 10 years because of a limited sample number.  
According to the distribution trend of the survival curve in Figure 2a, the posterior distribution can be divided into three stages. Different stages use different functional forms, which can be called Staged Bayesian. This model is a brand-new Bayesian form and is proposed in this paper for the first time. The Weibull distribution was used in the early \"infant mortality\" failures stage, the uniform distribution was used in the second stage, and the exponential distribution was used in the last one. The cutoff years between stages are 10 and 40, which were selected according to historical statistics and  
Figure 3: Survival function of girth-weld failure accident.  
the turning point in the survival curve of girth welds. The Weibull distribution still uses the parameter estimates of the survival function in Figure 2. The Table 1 shows the parameters and values of Staged Bayesian. As shown in Figure 3, the Staged Bayesian distribution is consistent with the Kaplan-Meier survival function, and the fitting results are matched.