# Optimal Particle Filter Weight for Bayesian Direct Position Estimation in a GNSS Receiver
## 3 Particle Filter  
This chapter discusses briefly the basic principles of a particle filter in order to cover the complete framework of the investigated weight update step, which follows in the next chapters. Particle filters belong to the group of non-parametric Bayesian filters [13] and thus allow for dealing with nonlinear and non-Gaussian models [8]. In order to estimate the state of a dynamic system, two filter steps are required, _Prediction_ and _Update_. The prediction step is based on the Chapman-Kolmogorov equation, which propagates the previous state \(\mathbf{x}_{k-1}\) to the prior state \(\mathbf{x}_{k}\) by  
\[p(\mathbf{x}_{k}|\mathbf{z}_{1:k-1})=\int p(\mathbf{x}_{k}|\mathbf{x}_{k-1})p (\mathbf{x}_{k-1}|\mathbf{z}_{1:k-1})d\mathbf{x}_{k-1}, \tag{1}\]  
using the system model  
\[\mathbf{x}_{k}=\mathbf{f}_{k}(\mathbf{x}_{k-1},\mathbf{v}_{k-1}), \tag{2}\]  
where \(\mathbf{z}\) is a set of all available measurements, and \(\mathbf{f}_{k}(\cdot)\) is a possibly nonlinear function with the corresponding process noise \(\mathbf{v}_{k-1}\), at epoch \(k\). The process noise can be interpreted as the uncertainty of the system model, which is accounted for when propagating the system state. The incorporation of new information (measurements) is performed in the update step, which is described by the Bayes rule  
\[p(\mathbf{x}_{k}|\mathbf{z}_{1:k})=\frac{p(\mathbf{z}_{k}|\mathbf{x}_{k})p( \mathbf{x}_{k}|\mathbf{z}_{1:k-1})}{p(\mathbf{z}_{k}|\mathbf{z}_{1:k-1})} \tag{3}\]  
Figure 3: This plot depicts a case when clock error is improperly aligned. The GNSS signals do not overlap at a distinct position in the northeast plane. The plot shows the normalized logarithmic particle weights \(\widehat{w}_{k}^{i}\) from Equation (35), assuming a uniform distribution from the previous epoch, i.e., \(\widehat{w}_{k-1}^{i}=0\) and using the optimal particle weight from Equation (34). The particles are equidistantly distributed over a grid. The lines through the plot correspond to the weighted correlation function in the position domain and thus refer to a distinct GNSS signal. The lines look very broad even after the weight update, which comes from the logarithmic scale given by \(\log(w_{k}^{i})\). The coherent integration time for this plot was set to \(T_{coh}=2\) ms. The processed data refers to open sky. It was recorded at LAT = 47.06446263 deg. LON = 15.40777110 deg on the rooftop of Reininghausstrasse 13a, Graz, Austria. with the normalization constant  
\[p(\mathbf{z}_{k}|\mathbf{z}_{1:k-1})=\int p(\mathbf{z}_{k}|\mathbf{x}_{k})p( \mathbf{x}_{k}|\mathbf{z}_{1:k-1})d\mathbf{x}_{k}. \tag{4}\]  
The update incorporates the new measurement \(\mathbf{z}_{k}\) by using the measurement model, which relates the measurement \(\mathbf{z}_{k}\) to the states \(\mathbf{x}_{k}\) as  
\[\mathbf{z}_{k}=\mathbf{h}_{k}(\mathbf{x}_{k},\mathbf{n}_{k}), \tag{5}\]  
where \(\mathbf{h}_{k}(\cdot)\) is a possibly nonlinear function and where \(\mathbf{n}_{k}\) denotes the measurement noise, which describes the uncertainty of the measurement. Now, the basic idea of a particle filter is to recursively approximate the posterior probability function. If considering only the case that a filtered estimate is required at each time step, a simplified discrete approximation of the posterior probability density function (PDF) without dependency on the complete history can be written as  
\[p(\mathbf{x}_{k}|\mathbf{z}_{1:k})\approx\sum_{i=1}^{N_{k}}w_{k}^{i}\delta( \mathbf{x}_{k}-\mathbf{x}_{k}^{i}) \tag{6}\]  
with  
\[w_{k}^{i}\propto w_{k-1}^{i}\frac{p(\mathbf{z}_{k}|\mathbf{x}_{k}^{i})p( \mathbf{x}_{k}^{i}|\mathbf{x}_{k-1}^{i})}{q(\mathbf{x}_{k}^{i}|\mathbf{x}_{k- 1}^{i},\mathbf{z}_{k})}, \tag{7}\]  
where the posterior probability only depends on the previous state at epoch \(k-1\) and current measurement at epoch \(k\).