# An Automatic Partition Time-Varying Markov Model for Reliability Evaluation
## 2 Materials and Methods
### The Automatic Partition Time-Varying Markov Model for Reliability Evaluation
#### 2.2.1 The Automatic Partition Method for State Number Determination of the Markov Model
The time and feature variables of sample sequence are independent with each other. Then,  
\[f(\mathbf{d}_{l}|\eta\,_{p}) =\frac{1}{D^{2}\left(\mathbf{d}_{l},\eta_{p}\right)} \tag{6}\] \[=\underbrace{\alpha_{p}}_{p(\eta_{p})}\underbrace{\sqrt{2\pi \sigma_{p,t}^{2}}}_{p(t_{l}|\eta_{p})}\exp(-\frac{1}{2}\frac{\left(t_{l}- \mathrm{v}_{p}^{x}\right)^{2}}{\sigma_{p,t}^{2}})\times\underbrace{\frac{1}{ \left(2\pi\right)^{r/2}\sqrt{\det(A_{p})}}\exp(-\frac{1}{2}(\mathrm{x}_{l}- \mathrm{v}_{p}^{x})^{T}(A_{p})^{-1}(\mathrm{x}_{l}-\mathrm{v}_{p}^{x}))}_{p( \mathrm{x}_{l}|\eta_{p})}\]  
where \(\alpha_{k}\) is the initial probability of clustering, \(\frac{1}{\sqrt{2\pi\sigma_{p,t}^{2}}}\exp(-\frac{1}{2}\frac{\left(t_{l}- \mathrm{v}_{p}^{x}\right)^{2}}{\sigma_{p,t}^{2}})\) is the distance between the time variable and the clustering center of time variable, \(\frac{\left(2\pi\right)^{r/2}\sqrt{\det(A_{p})}}{\exp(-\frac{1}{2}(\mathrm{x} _{l}-\mathrm{v}_{p}^{x})^{T}(A_{p})^{-1}(\mathrm{x}_{l}-\mathrm{v}_{p}^{x}))}\) is the distance between the feature variable in the \(l\)-th sample and the feature cluster center, \(v_{p}^{x}\) is the feature cluster center of \(p\)-th segment, and \(r\) is the rank of the feature variable distance norm, \(A_{p}\). There are many ways to calculate the distance norm \(A_{p}\). Mahalanobis distance is a good choice and can be used to adjust the correlation between variables. Let \(A_{p}=F_{p}\), where \(F_{p}\) is the fuzzy covariance matrix of the multivariate Gaussian distribution,  
\[F_{p}=\frac{\sum\limits_{l=1}^{L}\left(\mu_{p,l}\right)^{m}\left((\mathrm{x}_ {l}-\mathrm{v}_{p}^{x})(\mathrm{x}_{l}-\mathrm{v}_{p}^{x})^{T}\right)^{T}}{ \sum\limits_{l=1}^{L}\left(\mu_{p,l}\right)^{m}} \tag{7}\]  
Principal Component Analysis (PCA) is introduced to eliminate the strong correlations between variables while reducing dimensionality. It is assumed that \(\lambda_{p,q},q=1,2,\ldots,Q\) are the \(Q\) non-zero eigenvalues of \(F_{p}\) in descending order. Their corresponding eigenvectors are \(u_{p,q},q=1,2,\ldots,Q\). It can be obtained that:  
\[F_{p}=U_{p}\Lambda_{p}U_{p}^{T} \tag{8}\]  
\[\Lambda_{p}=\left| \begin{matrix}\lambda_{p,1}&&\\ &\lambda_{p,2}&\\ &&\ddots&\\ &&&\lambda_{p,Q}\end{matrix} \right| \tag{9}\]  
\[U_{p}=\left[u_{p,1},u_{p,2},\ldots,u_{p,Q}\right] \tag{10}\]  
The feature variables of the sample sequence are reduced to \(Q\)-dimension by the PCA method, and \(y_{p,l}=W_{p}^{-1}(\mathrm{x}_{l})=W_{p}^{T}(\mathrm{x}_{l})\) is obtained, where \(W_{p}=U_{p,Q}\Lambda_{p,Q}^{1/2}\). According to probabilistic principal component analysis [39], \(W_{p}=U_{p,Q}(\Lambda_{p,Q}-\sigma_{p,x}^{2})^{1/2}R_{pS}\), where \(R_{p}\) is a \(Q\times Q\) orthogonal transformation matrix, \(\sigma_{p,x}^{2}=\frac{1}{M-Q}\underset{j=Q+1}{\overset{M}{\sum}}\lambda_{p,q}\). Until now, the automatic partitioning algorithm of fuzzy segmentation has been transformed into an operational research optimization problem. The model is shown below,  
\[C(Sub_{S}^{p})=\sum\limits_{p=1}^{P}\sum\limits_{l=1}^{L}\left(\mu_{p,l} \right)^{m}D^{2}\big{(}d_{l},\eta_{p}\big{)} \tag{11}\]  
\[ \begin{array}{l}U=\left[\mu_{p,l}\right]_{p\times L},\qquad\mu_{p,l}\in[0,1],\forall p,l\\ \sum\limits_{p=1}^{P}\mu_{p,l}=1,\qquad\quad\forall l\\ 0<\underset{l=1}{\overset{L}{\sum}}\mu_{p,l}<L,\quad\forall p\end{array}  \tag{12}\]  
The alternate optimization algorithm and the Picard iterative algorithm can be used to solve this problem. The basic steps are as follows:  
(1) Initialization  
The initial segments number of \(S\) and the dimension of the eigenvector space are given at first. Then, select the appropriate stopping condition, \(\varepsilon,\varepsilon>0\), and initialize \(W_{p},\mathrm{v}_{p}^{\mathrm{x}},\sigma_{p,x^{\prime}}^{2},\mu_{p,l}\);  
(2) Loop calculation. (i) Calculate the cluster prototype \(\eta_{p}\).