## 3 Materials and Methods
### Regional Topic Model and Its Online Inference Algorithm
 \tag{8}\]  
Next, for improving the inference accuracy by retaining weak correlation of local latent variables \(T_{j}\), we suppose that \(T_{j}\) obeys an indecomposable variational distribution  
\[q\Big{(}T_{j}\big{|}\mathbf{n}_{j}\Big{)}\
eq\prod\limits_{n=1}^{N_{j}}q\big{(} \mathbf{t}_{jn}|\eta_{jn}\big{)} \tag{9}\]  
Therefore, in the inference of semi-collapsed RTM, we just need to suppose that global latent variable \(R\), local latent variable \(T_{j}\), motion region weight \(\mathbf{\rho}\) and global hybrid parameters \(\mathbf{\theta}\) are  
Set Equation (15) equals to zero, the optimal variational distribution \(q^{*}\Big{(}T_{j}\Big{|}\mathbf{\eta}_{j}\Big{)}\) is  
\[ \begin{array}{l}q^{*}\Big{(}T_{j}\Big{|}\mathbf{\eta}_{j}\Big{)}\propto\prod \limits_{t=1}^{T}\Gamma\big{(}\alpha+N_{jt}\big{)}\exp\Big{\{}\sum_{\omega=1}^{ \Omega}\!\!\sum_{r=1}^{R}\!\mathbb{E}_{\mathbf{\sigma}_{r}}\big{[}N_{jurt} \big{]}\mathbb{E}_{\mu_{urt}}\big{[}\log\theta_{\omega rt}\big{]}\Big{\}}\\ \propto\prod\limits_{t=1}^{T}\Gamma\Big{(}\alpha+\sum_{n=1}^{N_{j}}\mathbb{I} \big{(}\mathbf{t}_{jn}=t\big{)}\Big{)}\exp\Big{\{}\sum_{n=1}^{N_{j}}\!\!\varsigma _{i}\mathbb{I}\big{(}\mathbf{t}_{jn}=t\big{)}\mathbb{E}_{\mathbf{\mu}_{urt}} \big{[}\log\theta_{\mathbf{x}_{jn}=\omega,\mathbf{r}_{i}=r,t}\big{]}\Big{\}} \end{array}  \tag{16}\]  
Among Equation (16), the variational expectation of sufficient statistic \(N_{jurt}=\sum_{n=1}^{N_{j}}\mathbb{I}\big{(}\mathbf{x}_{jn}=\omega\big{)} \mathbb{I}\big{(}\mathbf{r}_{jn}=r\big{)}\mathbb{I}\big{(}\mathbf{t}_{jn}=t \big{)}\) respect to variational parameter \(\mathbf{\varsigma}_{r}\) is  
\[ \begin{array}{lcl}\mathbb{E}_{\mathbf{\sigma}_{r}}\big{[}N_{j\omega rt} \big{]}&=&\mathbb{E}_{\mathbf{\sigma}_{r}}\Big{[}\sum_{n=1}^{N_{j}}\mathbb{I} \big{(}\mathbf{x}_{jn}=\omega\big{)}\mathbb{I}\big{(}\mathbf{r}_{jn}=r\big{)} \mathbb{I}\big{(}\mathbf{t}_{jn}=t\big{)}\Big{]}\\ &=&\mathbb{E}_{\mathbf{\sigma}_{r}}\Big{[}\sum_{n=1}^{N_{j}}\!\!\sum_{i=1}^{I} \mathbb{I}\big{(}\mathbf{x}_{jn}=\omega\big{)}\mathbb{I}\big{(}\mathbf{i}_{jn} =i\big{)}\mathbb{I}\big{(}\mathbf{r}_{i}=r\big{)}\mathbb{I}\big{(}\mathbf{t}_{ jn}=t\big{)}\Big{]}\\ &=&\sum_{n=1}^{N_{j}}\!\!\sum_{i=1}^{I}\varsigma_{i}r\mathbb{I}\big{(}\mathbf{x }_{jn}=\omega\big{)}\mathbb{I}\big{(}\mathbf{i}_{jn}=i\big{)}\mathbb{I}( \mathbf{r}_{i}=r\big{)}\mathbb{I}\big{(}\mathbf{t}_{jn}=t\big{)}\end{array}  \tag{17}\]  
The MCMC sampling method can be used to solve the estimation problem of optimal variational distribution \(q^{*}\Big{(}T_{j}\Big{|}\mathbf{\eta}_{j}\Big{)}\) without supposing the independent of local latent variables. Constructing a Markov chain whose stationary distribution is the optimal variational distribution local latent variables, the key problem of Gibbs sampling is computing the transition probability of Markov chain, which equals to the motion topic label \(\mathbf{t}_{jn}\)'s prediction probability of sample \(\mathbf{x}_{jn}\). Then, Equation (18) is obtained  
\[ \begin{array}{lcl}q^{*}\Big{(}\mathbf{t}_{jn}=t\Big{|}T_{j}^{(\setminus jn)},X_{j}\Big{)}&\propto&\Big{(}\alpha+\sum_{i=1,i\
eq n}^{N_{j}}\mathbb{I}\big{(} \mathbf{t}_{jn}=t\big{)}\Big{)}\exp\Big{\{}\,\mathbb{E}_{\mathbf{\mu}_{urt}} \Big{[}\log\theta_{\mathbf{x}_{jn}=\omega,\mathbf{r}_{jn}\in i=r,t}\Big{]} \Big{\}}\\ &\propto&\Big{(}\alpha+N_{jt}^{(\setminus jn)}\Big{)}\exp\Big{\{}\,\mathbb{E }_{\mathbf{\mu}_{\omega rt}}\Big{[}\log\theta_{\mathbf{x}_{jn}=\omega,\mathbf{ r}_{jn}\in i=r,t}\Big{]}\Big{\}}\end{array}  \tag{18}\]  
In the Equation (18)  
\[\mathbb{E}_{\mathbf{\mu}_{\omega rt}}\Big{[}\log\theta_{\mathbf{x}_{jn}=\omega,\mathbf{r}_{jn}\in i=r,t}\Big{]}=\Psi\big{(}\mathbf{\mu}_{j\omega rt}\big{)} \ -\ \Psi\Big{(}\!\sum_{\omega=1}^{\Omega}\!\!\sum_{r=1}^{R}\mu_{j\omega rt}\Big{)} \tag{19}\]  
The prediction probability is iteratively learning in Markov chain, Markov chain is converged after \(N\) times Gibbs sampling state transition in burn-in time.