## 3 Basic Methodology
### Hierarchical Dirichlet Process Vector Auto-Regressive Hidden Markov Models
We need to learn the approximate values \(\theta_{k}=\{A_{k},\Sigma_{k}\}\) for each state by defining a conjugate prior distribution on it. In particular, the Matrix-Normal Inverse Wishart (MNIW) distribution conjugate for both the \(A_{k}\) and \(\Sigma_{k}\) are uncertain. This distribution assumes that when only the covariance \(\Sigma_{k}\) is uncertain, the conjugate prior is defined as \(d-\)dimensional Inverse Wishart (IW) distribution with covariance parameter \(\Delta\), a symmetric, positive definite scale matrix, and \(\
u\), the degrees of freedom, i.e.,  
\[\Sigma_{k}\sim\mathcal{IW}(\
u,\Delta), \tag{8}\]  
where the first moment is given by the mean  
\[\mathbb{E}[\Sigma_{k}]=\frac{\
u\Delta}{\
u-d-1}. \tag{9}\]  
After that, we place a conditionally Matrix-Normal (MN) prior on \(A_{k}\) given \(\Sigma_{k}\), which is given by  
Figure 3: **(Left)** the graphical representation of an HDP-HMM over \(T\) time steps. The latent, discrete-valued Markov process \(z_{t}\) captures the temporal dependencies in the observations \(y_{t}\). **(Right)** the graphical model for an HDP-VAR(\(r\))-HMM over \(T\) time steps. The latent, discrete-valued Markov process \(z_{t}\) dictates the linear dynamical model at time \(t\). For an order \(r\) switching VAR process (\(r=1\) in this paper), the conditionally linear dynamics are completely determined by previous observations \(y_{t-1}\). Adapted from [25] by [PERSON]. \[A_{k}\sim\mathcal{MN}(M,\Sigma_{k},V), \tag{10}\]  
where \(M\) is the mean matrix of \(A_{k}\) and \(V\) is a symmetric, positive definite matrix that determine the covariance of \(A_{k}\) relative to \(\Sigma_{k}\). Therefore, we derive the useful expectations  
\[\mathbb{E}(A_{k}) =M, \tag{11}\] \[Cov[A_{k}] =\frac{1}{\
u-d+1}(V^{-1}\times\Delta).\]  
The resulting log-likelihood function of joint distribution of \(A_{k},\Lambda_{k}\) is defined as \(log\ p(A_{k},\Sigma_{k}|\
u,\Delta,M,V^{-1})\)  
\[logp(A_{j},\Lambda_{j}|\
u,\Delta,M,V^{-1})=F_{\mathcal{IM}}(\
u,\Delta)+F_{ \mathcal{MN}}(M,V)+F, \tag{12}\]  
where,  
\[log\ p(y_{t}|\theta_{k},y_{t-1}) =log\ p(y_{t}|A_{k},\Sigma_{k},y_{t-1})=log\ \mathcal{N}(y_{t}|A_{k}y_{t-1},\Sigma_{k}) \tag{7}\]0 \[log\ p(y_{t}|\theta_{k},y_{t-1}) =log\ p(y_{t}|A_{k},\Sigma_{k},y_{t-1})=log\ \mathcal{N}(y_{t}|A_{k}y_{t-1},\Sigma_{k}) \tag{7}\]1 \[log\ p(y_{t}|\theta_{k},y_{t-1}) =log\ p(y_{t}|A_{k},\Sigma_{k},y_{t-1})=log\ \mathcal{N}(y_{t}|A_{k}y_{t-1},\Sigma_{k}) \tag{7}\]2  
where \(\Gamma()\) is represented the gamma function. Therefore, all the optional hyperparameters of HDP-VAR-HMM are specified by \(\
u,\Delta,M,V\). Apparently this straightforward method is computationally feasible when those four parameters are known. We specify the detailed options in Section 6.4 through all our experiments. With reference to Equation (5), for the probabilistic representation of transition distribution \(\pi_{j}\) under the HDP-VAR-HMM prior, the number of states is unbounded, and every observation is assigned a unique state. The HDP prior encourages sharing states over time through a latent root probability vector \(\beta\) over the infinite set of states (see Figure 3). Consider the probability \(\sum_{j=1}^{\infty}\beta_{j}=1\) on a countably infinite set, which defines the sticking-breaking construction of the prior on \(\beta\) and first draws independent variable \(\mu_{j}\sim Beta(1,\gamma)\) for each state \(j\), and then sets \(\beta_{j}=\mu_{j}\prod_{\ell=1}^{j-1}(1-\mu_{\ell})\), where the concentration parameter \(\gamma\) controls the relative proportion of the weights \(\beta_{j}\). Here, we interpret \(\mu_{j}\) as the conditional probability of choosing state \(j\) among states \(\{j,j+1,j+2,\ldots\}\). In expectation, we always describe the first \(K\) orders in sticking-breaking as the most common states and represent their probabilities with the vector \([\beta_{1},\beta_{2},\ldots,\beta_{K},\beta_{>K}]\), where \(\beta_{>K}=\sum_{j=K+1}^{\infty}\).