## 3 Methods
### Description of the Driving Process Based on HSMM
#### 3.1.1 Construction of HDP-HSMM  
The Dirichlet process (DP) is a stochastic process, which can be regarded as the distribution of the discrete distribution of infinite categories. It can complete the clustering of data and estimate distribution parameters [36]. HDP is a multi-layer extension of DP, including at least two layers of DP with a complex state inference and Bayesian mixing. HDP can provide state numbers and prior model parameters for HSMM. DP can be defined as follows:  
Let measurable space be \(\Theta\), with a probability measure \(H\) on the space. \(\gamma\) is a positive real number, called the concentration parameter. DP (\(\gamma\), \(H\)) is defined as the distribution of the random probability measure of \(G\) over \(\Theta\), for any finite measurable partition (\(A_{1}\), \(A_{2}\),..., \(A_{K}\)) of \(\Theta\); the random vector (\(G\) (\(A_{1}\)), \(G\) (\(A_{2}\)),..., \(G\) (\(A_{K}\))) is distributed as a finite-dimensional Dirichlet distribution with parameters (\(\gamma H\) (\(A_{1}\)), \(\gamma H\) (\(A_{2}\)),..., \(\gamma H\) (\(A_{K}\))) [37],  
\[(G_{0}(A_{1}),G_{0}(A_{2}),\ldots,G_{0}(A_{K}))\sim\mathrm{Dir}(\gamma H(A_{1}),\gamma H(A_{2}),\ldots,\gamma H(A_{K})) \tag{12}\]  
Equation (12) can be written as  
\[G_{0}\sim DP(\gamma,H) \tag{13}\]  
\[G_{0}=\sum_{k=1}^{K}\beta_{k}\delta_{\theta_{k}} \tag{14}\]  
\[\theta_{k}\sim H,\ \beta\sim\mathrm{GEM}(\gamma) \tag{15}\]  
where \(\theta_{k}\) is the distribution of \(H\), \(\beta\)-GEM (\(\gamma\)) represents the construction relation of the weight coefficient (GEM is Griffiths, Engen, and McCloskey initials, respectively [34], which refer to the sticking-breaking process). \(\delta_{\theta}\) is the Dirac function, satisfying  
\[\delta(\theta)=\left\{\begin{array}{ll}1,\ \theta_{k}\in A_{k}\\ 0,\ others\end{array}\right. \tag{16}\]  
HDP used in this paper consists of two layers of DP, expressed by  
\[G_{j}\sim HDP(\gamma,\alpha,H) \tag{17}\]  
\[G_{0}\sim DP(\gamma,H) \tag{18}\]  
\[G_{j}=\sum_{k=1}^{K}\pi_{jk}\delta_{\theta_{k}},K\rightarrow\infty \tag{19}\]  
\[\theta_{k}\sim H,\beta\sim\mathrm{GEM}(\gamma),\pi_{j}\sim DP(\alpha,\beta) \tag{20}\]  
where \(\gamma\) and \(\alpha\) are the concentration parameters of the first layer DP and the second layer DP, respectively. \(G_{0}\) is sampled from the first layer DP, and \(G_{j}\) is a variation of a global discrete measure \(G_{0}\) and represents the prior transition probability of HMM.  
According to the above discussion, HSMM can express the driving process, while HDP can cluster data adaptively and provide prior knowledge for HSMM. HDP-HSMM can be expressed as follows.  
Figure 8 can be expressed by  
\[\beta|\gamma\sim\text{GEM}(\gamma) \tag{21}\]  
\[\pi_{i}|\alpha,\beta\sim\text{DP}(\alpha,\beta),i=1,2,\cdots,\infty \tag{22}\]  
\[\theta_{i}\sim H(\lambda),i=1,2,\cdots,\infty \tag{23}\]  
\[\omega_{i}\sim\Omega \tag{24}\]  
\[z_{s}\sim\pi_{z_{s-1}},s=1,2,\cdots,S \tag{25}\]  
\[D_{s}\sim g(\omega_{z_{s}}),s=1,2,\cdots,S \tag{26}\]  
\[x_{t_{s}^{1}t_{s}^{D_{s+1}}}=z_{s} \tag{27}\]  
\[y_{t_{s}^{1}t_{s}^{D_{s}+1}}\sim\text{F}(\theta_{x_{t}}) \tag{28}\]  
where \(\pi_{i}\) is the distribution parameter of hidden state sequence \(z_{s}\), implying that HDP provides an infinite number of states for HSMM. \(D_{s}\) is the length distribution of the state sequence with distribution parameter \(\omega\), and \(y_{ts}\) is the observation sequence with distribution parameter \(\theta_{i}\).