## 3 Switched Variational Estimation Filtering in Underwater Navigation
### Proposed Optimal Variational Estimation in Navigation Information Acquisition
\tag{56}\]  
After Nv iterations, the variational Bayesian approximation of the PDF is given as:  
\[q\big{[}\textbf{P}\big{(}t_{k}^{+}\big{)}\big{]}\approx q^{(\text{Nv})}\big{[} \textbf{P}\big{(}t_{k}^{+}\big{)}\big{]}=\text{IW}\Big{(}\textbf{P}\big{(}t_{ k}^{+}\big{)};t^{(\text{Nv})}(t_{k}),\textbf{T}^{(\text{Nv})}(t_{k})\Big{)} \tag{57}\]  
\[q(\textbf{R}_{k})\approx q^{(\text{Nv})}(\textbf{R}_{k})=\text{IW}\Big{(} \textbf{R}_{k};u^{(\text{Nv})}(t_{k}),\textbf{U}^{(\text{Nv})}(t_{k})\Big{)} \tag{58}\]  
\[q[\textbf{X}(t_{k})]\approx q^{(\text{Nv})}[\textbf{X}(t_{k})]=N\Big{(} \textbf{X}(t_{k});\textbf{X}^{(\text{Nv})}\Big{(}t_{k}^{+}\Big{)},\textbf{P}^ {(\text{Nv})}\Big{(}t_{k}^{+}\Big{)}\Big{)} \tag{59}\]  
\[\xi(t_{k})\approx\xi^{(\text{Nv})}(t_{k})=\mathrm{E}^{(\text{Nv})}[\xi(t_{k})] \tag{60}\]  
\[q[\tau(t_{k})]\approx q^{(\text{Nv})}[\tau(t_{k})]=B\Big{(}\tau(t_{k});\alpha^ {(\text{Nv})}(t_{k}),\beta^{(\text{Nv})}(t_{k})\Big{)} \tag{61}\]  
The flowchart of the SVEF is shown in Figure 2. The derivatives of \(\textbf{X}(t_{k-1})\) and \(\textbf{P}(t_{k-1})\) are calculated as Equations (15) and (16), respectively. When the time is equal to \(k\), \(\textbf{X}\big{(}t_{k}^{+}\big{)}\) and \(\textbf{P}\big{(}t_{k}^{+}\big{)}\) are derived by using Equation (17). At the start of the variation estimation update, the number of iterations \(l\) is set to 0. Then, \(\textbf{X}^{(l)}\big{(}t_{k}^{+}\big{)}=\textbf{X}\big{(}t_{k}^{+}\big{)}\) and \(\textbf{P}^{(l)}\big{(}t_{k}^{+}\big{)}=\textbf{P}\big{(}t_{k}^{+}\big{)}\) are initialized for the subsequent variational estimation update. In iteration \(l+1\) step at time \(k\), firstly, the calculations of \(\textbf{P}\big{(}t_{k}^{+}\big{)}\) and \(\textbf{R}_{k}\) are performed by using their DOFs and inverse scale matrices, respectively. Then, \(\textbf{X}(t_{k})\) and \(\textbf{P}(t_{k})\) in iteration \(l+1\) are estimated in linear or nonlinear forms by using Equations (35)-(42). Finally, the information about \(\xi(t_{k})\) and \(\tau(t_{k})\) is updated by using Equations (44)-(56). After iteration Nv, \(\textbf{X}(t_{k})\) and \(\textbf{P}(t_{k})\) are accurately determined at time \(k\). The pseudocode is represented in Algorithm 1. ```
Input:\(\textbf{X}(t_{k-1})\), \(\textbf{P}(t_{k-1})\), \(\xi(t_{k-1})\), \(\tau(t_{k-1})\). Time Update: for\(i=0\):\(0\):\(0\):\(1\)  Update \(\textbf{X}(t_{k}^{+})\) and \(\textbf{P}(t_{k}^{+})\) using Equations (15)-(17); end Variational Estimation Update:  Variational estimation initialization: \(\textbf{X}^{(l)}(t_{k})\), \(\textbf{P}^{(l)}(t_{k})\). for\(l=0\): Nv \(-1\) (1) The optimal solutions of the predicted error covariance and measurement noise matrices. The DOF and inverse scale matrix of \(\textbf{P}(t_{k}^{+})\) in iteration \(l+1\) are updated by using Equation (22). The update of the DOF and the inverse scale matrix of \(\textbf{R}_{k}\) in iteration \(l+1\): Case 1.1 updated by using Equations (24) and (25). Case 2.1 updated by using Equations (24), (26)-(29). \(\textbf{P}(t_{k}^{+})\) and \(\textbf{R}_{k}\) are calculated by Equations (30)-(32). (2) The update of state vector and error covariance matrix in iteration \(l+1\). Case 1.2 updated by using Equation (35). ```  
**Algorithm 1**The proposed switched variational estimation filtering algorithm. ``` Input:\(\textbf{X}(t_{k-1})\), \(\textbf{P}(t_{k-1})\), \(\xi(t_{k-1})\), \(\tau(t_{k-1})\). Time Update: for\(i=0\):



## 4 Experiments and Results

Complex and changeable underwater environments bring huge errors and nonlinearity to MEMS-based inertial sensors mounted on AUVs. Moreover, the magnetometers used to

Figure 2: The flowchart of the SVEF. compensate for the inertial sensor error are disturbed by the variable marine environment. Therefore, establishing a model that can accurately describe the measurement noise is difficult, resulting in the measurement noise assumption of the navigation determination algorithm being not in accord with the real noise information, which greatly reduces the state estimation precision.