# A Novel Anti-Jamming Technique for INS/GNSS Integration Based on Black Box Variational Inference
## 3 The Novel Anti-Jamming Technique
### BBVI Filter Based on Gaussian Distribution  
By referencing the BBVI idea in [23] and the BBAKF method in [21], we derived the BBVI filter (BBVIF) anti-jamming algorithm with Gaussian distribution. As in Section 3.1, we assume that the prior distribution of MNCM is a Gaussian distribution. The expression is the same as (14). After the kth observation, the gradients of ELB with respect to parameters can be expressed as  
\[\
abla_{\mathbf{\lambda}}\mathscr{L}(\mathbf{\lambda})=E_{q(\mathbf{R}_{k})}[\
abla_{\mathbf{ \lambda}}\log q(\mathbf{R}_{k})\times\left(\log p(\mathbf{Z}_{k},\mathbf{R}_{k}|\mathbf{Z}_{1: k-1})-\log q(\mathbf{R}_{k  
where the \(\log p(\mathbf{Z}_{k,S},\mathbf{R}_{k,S}|\mathbf{Z}_{1:k-1,S})\) is given by  
\[\log p(\mathbf{Z}_{k,S},\mathbf{R}_{k,S}|\mathbf{Z}_{1:k-1,S}) =\log\bigl{[}p(\mathbf{Z}_{k,S}\bigl{|}\mathbf{R}_{k,S})\cdot p(\mathbf{R}_{k,S }\bigl{|}\mathbf{Z}_{1:k-1,S})\bigr{]} \tag{20}\] \[=\log p(\mathbf{Z}_{k,S}\bigl{|}\mathbf{R}_{k,S},\mathbf{Z}_{1:k-1,S})+\log p( \mathbf{R}_{k,S}\bigl{|}\mathbf{Z}_{1:k-1,S})\]  
with  
\[\log q(\mathbf{R}_{k,S})=\ln\frac{1}{2\pi}-\frac{1}{2}\ln\mathbf{\sigma}_{k|k-1,S}- \frac{1}{2}\bigl{(}\mathbf{R}_{k,S}-\mu_{k|k-1,S}\bigr{)}\sigma_{k|k-1}^{-1}\bigl{(} \mathbf{R}_{k,S}-\mu_{k|k-1,S}\bigr{)} \tag{21}\]  
\[\
abla_{\mu_{k}}\log q(\mathbf{R}_{k,S})=\sigma_{k|k-1,S}^{-1}\bigl{(}\mathbf{R}_{k,S }-\mu_{k|k-1,S}\bigr{)} \tag{22}\]  
\[\
abla_{\sigma_{k}}\log q(\mathbf{R}_{k,S})=-\frac{1}{2}\sigma_{k|k-1,S}^{-1}+ \frac{1}{2}\sigma_{k|k-1,S}^{-2}\bigl{(}\mathbf{R}_{k,S}-\mu_{k|k-1,S}\bigr{)}^{2} \tag{23}\]  
According to [21], we updated the parameters of \(\mu_{k}\) and \(\sigma_{k}\) by stochastic optimization. The iterative method is as follows  
\[\hat{\mathbf{\mu}}_{k|k,i}=\hat{\mathbf{\mu}}_{k|k-1,i}+\frac{\eta}{\sqrt{\mathbf{g}_{k,i} +\epsilon}}\hat{\
abla}_{\mu_{k,i}}\mathscr{L}(\mu_{k,i},\sigma_{k,i}) \tag{24}\]  
\[\hat{\sigma}_{k|k,i}=\hat{\sigma}_{k|k-1,i}+\frac{\eta}{\sqrt{\mathbf{G}_{k,i}+ \epsilon}}\hat{\
abla}_{\sigma_{k,i}}\mathscr{L}(\mu_{k,i},\sigma_{k,i}) \tag{25}\]  
where \(\mathbf{g}_{k}\) and \(\mathbf{G}_{k}\) are updated by the Adaptive Gradient (AdaGard), the expressions are given by  
\[\mathbf{g}_{k}=\gamma\mathbf{g}_{k-1}+(1-\gamma)\hat{\
abla}_{\mathbf{\mu}_{k}}\mathscr{L }^{2}(\mu_{k},\sigma_{k}) \tag{26}\]  
\[\mathbf{G}_{k}=\gamma\mathbf{G}_{k-1}+(1-\gamma)\hat{\
abla}_{\sigma_{k}}\mathscr{L }^{2}(\mu_{k},\sigma_{k}) \tag{27}\]  
The variance in the estimator of the gradient (under the Monte Carlo estimate in Equation 16) may be too large to be useful when we use the method above to maximize the ELB. In practice, a higher variance gradient requires very small steps, which will lead to a slow convergence. Therefore, the variance needs to be reduced in the original method. Here, we refer to [23], and adopt the control variates method. The minimum variance is given by  
\[\mathbf{a}_{\mu_{k}}=\frac{\text{cov}(\mathbf{f}_{s}(\mathbf{\mu}_{k}),\mathbf{h}_{s}(\mathbf{\mu} _{k}))}{\text{var}(\mathbf{h}_{s}(\mathbf{\mu}_{k}))} \tag{28}\]  
\[=\log p(\mathbf{Z}_{k,S}\bigl{|}\mathbf{R}_{k,S},\mathbf{Z}_{1:k-1,S})+\log p( \mathbf{R}_{k,S}\bigl{|}\mathbf{Z}_{1:k-1,S})\]0  
with  
\[=\log p(\mathbf{Z}_{k,S}\bigl{|}\mathbf{R}_{k,S},\mathbf{Z}_{1:k-1,S})+\log p( \mathbf{R}_{k,S}\bigl{|}\mathbf{Z}_{1:k-1,S})\]1  
\[=\log p(\mathbf{Z}_{k,S}\bigl{|}\mathbf{R}_{k,S},\mathbf{Z}_{1:k-1,S})+\log p( \mathbf{R}_{k,S}\bigl{|}\mathbf{Z}_{1:k-1,S})\]2  
\[=\log p(\mathbf{Z}_{k,S}\bigl{|}\mathbf{R}_{k,S},\mathbf{Z}_{1:k-1,S})+\log p( \mathbf{R}_{k,S}\bigl{|}\mathbf{Z}_{1:k-1,S})\]3  
The procedure for the anti-jamming method based on BBVI is summarized in Algorithm 1. ```
Input:\(\mathbf{X_{0}}\), \(\mathbf{Z_{k}}\), \(\mathbf{P_{0}}\), \(\mathbf{Q_{0}}\), \(\mathbf{R_{0}}\), \(\mathbf{\mu_{0}}\), \(\mathbf{\sigma_{0}}\), \(\mathbf{g_{0}}\), \(\mathbf{G_{0}}\), \(\mathbf{F_{0}}\), \(\mathbf{\gamma_{0}}\). Time update (the same as Kalman Filter)
1. \(\hat{\mathbf{X}}_{[k-1]}=\mathbf{\Phi}_{[k-1]}\hat{\mathbf{X}}_{k-1}\)
2.