## 5 Variational Bayesian
### Parameters Estimation Based on VB
#### 5.2.1 Parameter Estimation of GMD  
We can get the forward speed of AUV by the speed sensor. The observable data set of AUV speed concludes the forward speed of AUV at all time, i.e., \(\mathbf{U}=\left[u_{v,k}\right]_{1:K}^{T}\). The observable data set of MRS speed can be obtained by:  
\[\mathbf{U}=\left[\sqrt{\left(\mathbf{x}_{k}\left(4,1\right)\right)^{2}+\left(\mathbf{x}_{k }\left(6,1\right)\right)^{2}}\right]_{1:K}^{T} \tag{19}\]  
The observable data set \(\mathbf{U}\) consists of the all forward speed at previous \(K\) time, and the \(k\)th component is denoted as \(u_{k}\). The conditional probability distribution of \(\mathbf{U}\) with the latent variable set \(\mathbf{Z}=\left\{z_{1},\cdots,z_{K}\right\}\) can be described by:  
\[P\left(\mathbf{U}|Z,\mathbf{\mu},\mathbf{\Lambda}\right)=\prod_{k=1}^{K}\prod_{n=1}^{N}N \left(u_{k}|\mu_{n},\Lambda_{n}^{-1}\right)^{z_{\mathbf{\Lambda}n}} \tag{20}\]  
where \(\mathbf{\mu}=\left\{\mu_{n}\right\}\), \(\mathbf{\Lambda}=\left\{\Lambda_{n}\right\}\), which are the mean and precision matrix of Gaussian distribution. The application of conjugate prior distribution will greatly simplify the analysis process. The coefficient \(\mathbf{\pi}\) is modeled by a Dirichlet distribution. \[p\left(\mathbf{\pi}\right)=Dir\left(\mathbf{\pi}\mid\mathbf{\alpha}_{0}\right)=C\left( \mathbf{\alpha}_{0}\right)\prod_{n=1}^{N}\pi_{n}^{\mathbf{\alpha}_{0}-1} \tag{21}\]  
where \(\mathbf{\alpha}_{0}\) is a parameter of the Direchlet distribution, \(\mathbf{\alpha}_{0}\) is a set of \(\mathbf{\alpha}_{0}\). \(C\left(\mathbf{\alpha}_{0}\right)\) is a normalization constant of the Direchlet distribution. The joint distribution of \(\mathbf{\mu}\) and \(\mathbf{\Lambda}\) is modeled by a Gaussian-Wishart distribution. \[ \begin{split} p\left(\mathbf{\mu},\mathbf{\Lambda}\right)&=p \left(\mathbf{\mu}\mid\mathbf{\Lambda}\right)\cdot p\left(\mathbf{\Lambda}\right)\\ &=\prod_{n=1}^{N}N\left(\mathbf{\mu}_{k}\mid\mathbf{m}_{0},\left(\beta_{0 }\mathbf{\Lambda}_{n}\right)^{-1}\right)W\left(\mathbf{\Lambda}_{n}\mid\mathbf{W}_{0},\
u_ {0}\right)\end{split}  \tag{22}\]where \(\mathbf{m}_{0}\) and \(\beta_{0}\) are the parameters of the Gaussian distribution. \(\mathbf{W}_{0}\) and \(\
u_{0}\) are the parameters of Wishart distribution. The joint distribution of U and distribution parameters is given by:  
\[p\left(\mathbf{U},\mathbf{Z},\mathbf{\pi},\mathbf{\mu},\mathbf{\Lambda}\right)=p\left(\mathbf{U}\mid\bm {Z},\mathbf{\mu},\mathbf{\Lambda}\right)p\left(\mathbf{Z}\mid\mathbf{\pi}\right)p\left(\mathbf{\pi} \right)p\left(\mathbf{\mu}\mid\mathbf{\Lambda}\right)p\left(\mathbf{\Lambda}\right) \tag{23}\]  
The variational distribution is considered:  
\[q\left(\mathbf{Z},\mathbf{\pi},\mathbf{\mu},\mathbf{\Lambda}\right)=q\left(\mathbf{Z}\right)q\left( \mathbf{\pi},\mathbf{\mu},\mathbf{\Lambda}\right)=q\left(\mathbf{Z}\right)q\left(\mathbf{\pi} \right)\prod_{n=1}^{N}q\left(\mathbf{\mu}\mid\mathbf{\Lambda}\right) \tag{24}\]  
Assuming that \(q\left(\mathbf{Z}\right)\) and \(p\left(\mathbf{Z}\mid\mathbf{\pi}\right)\) have the same functional form, \(q\left(\mathbf{\pi}\right)\) and \(p\left(\mathbf{\pi}\right)\) have the same functional form, \(q\left(\mathbf{\mu},\mathbf{\Lambda}\right)\) and \(p\left(\mathbf{\mu},\mathbf{\Lambda}\right)\) have the same functional form. \(q\left(\mathbf{\pi}\right)\) and \(p\left(\mathbf{\mu},\mathbf{\Lambda}\right)\) are given by:  
\[q\left(\mathbf{\pi}\right)=Dir\left(\mathbf{\pi}\mid\mathbf{\alpha}\right). \tag{25}\] \[q\left(\mathbf{\mu}_{n},\mathbf{\Lambda}_{n}\right)=N\left(\mathbf{\mu}_{n} \mid\mathbf{m}_{n},\left(\beta_{n}\mathbf{\Lambda}_{n}\right)^{-1}\right)W\left(\mathbf{ \Lambda}_{n}\mid\mathbf{W}_{n},\
u_{n}\right) \tag{26}\]  
where \(\mathbf{\alpha}\) is parameter set of the Direchlet variational distribution. \(\mathbf{m}\), \(\beta\), \(\mathbf{W}\) and \(\
u\) are the parameters of the Gaussian-Wishart variational distribution. The detailed derivation is given in [17].