## 3 Unscented Particle Filter with Adaptive Sample Size
### Adaptive Sample-Size Strategy  
For the algorithms based on PF with fixed sample size, the invariant sample size directly affects the computational complexity, making the real-time and accuracy of these algorithms worse [5]. To find out the relationship between accuracy and the number of samples, \(\chi\) is defined as the state space, and the target motion model shown in Equation (2) is rewritten as the general form of the nonlinear system state equation [50],  
\[X_{k}=f(X_{k}|X_{k-1},w_{k}), \tag{10}\]where \(f(\cdot)\in\chi\) is the state transition function, which includes the current and previous state. It is assumed that \(N_{k}\), the number of samples at time \(k\), is known, the probability density function of samples in state space \(\chi\) is expressed as \(p(X)\), and the expectation of \(X_{k}\) can be expressed as follows,  
\[\overline{X}_{k}\triangleq\int_{\chi}f(X_{k}|X_{k-1})p(X_{k-1})\mathrm{d}X_{k -1}. \tag{11}\]  
The integral in Equation (11), which is hard to solve in reality, is usually expressed by sum of samples. Let \(\{X_{k-1}^{(i)}\}_{i=1}^{N_{k}}\sim p\) be the sample set randomly sampled from the probability density function \(p\), then the empirical sample mean of state \(X_{k}\) is as follows,  
\[\hat{X}_{k}=\frac{1}{N_{k}}\sum_{i=1}^{N_{k}}\hat{X}_{k}^{(i)}, \tag{12}\]  
where \(\hat{X}_{k}^{(i)}=f(X_{k}|X_{k-1}^{(i)})\) is the updated sample propagated by the state transition function. Assuming the variance of state \(X_{k}\) is defined as \(P_{k}\), i.e., the propagated samples come from the state population \(\mathrm{N}(\overline{X}_{k},P_{k})\), then we have a Gaussian density with mean \(\overline{X}_{k}\) and variance \(P_{k}\). Once the mean and variance of the samples are obtained, a t-distribution could be obtained according to the definition of t-distribution [51]. Actually, the sample mean \(\hat{X}_{k}\) is obtained by Equation (12), and the sample variance \(P_{k}\) can be calculated as follows,  
\[\hat{P}_{k}=\frac{1}{N_{k}}\sum_{i=1}^{N_{k}}\left[f(X_{k}|X_{k-1}^{(i)})-\hat {X}_{k}\right]\left[f(X_{k}|X_{k-1}^{(i)})-\hat{X}_{k}\right]^{\mathrm{T}}. \tag{13}\]  
However, due to the presence of process noises and measurement noises, the sample variance directly calculated by (13) is inaccurate and needs to be corrected by the amendment algorithm, such as a Kalman filter [52]. Then, with corrected sample mean and variance, there is  
\[\frac{\hat{X}_{k}-\overline{X}_{k}}{\sqrt{\hat{P}_{k}/N_{k}}}\sim t(N_{k}-1), \tag{14}\]  
where \(t(N_{k}-1)\) is the t-distribution with \(N_{k}-1\) degrees of freedom. Based on the confidence interval estimate of the t-distribution [53], given the sample size \(N_{k}\) and the probability value \(1-\alpha\), with the quantile \(t_{\alpha/2}(N_{k}-1)\), we can get the following results,  
\[\Pr\left\{-t_{\alpha/2}(N_{k}-1)<\frac{\hat{X}_{k}-\overline{X}_{k}}{\sqrt{ \hat{P}_{k}/N_{k}}}<t_{\alpha/2}(N_{k}-1)\right\}=1-\alpha, \tag{15}\]  
i.e.,  
\[\Pr\left\{\left|\hat{X}_{k}-\overline{X}_{k}\right|<t_{\alpha/2}(N_{k}-1)\sqrt {\hat{P}_{k}/N_{k}}\right\}=1-\alpha, \tag{16}\]  
where \(t_{\alpha/2}(N_{k}-1)\) is the bilateral \(\alpha\) quantile of \(t(N_{k}-1)\). The confidence interval of \(\overline{X}_{k}\) with a confidence level of \(1-\alpha\) is as follows,  
\[\left(\overline{X}_{k}\pm t_{\alpha/2}(N_{k}-1)\sqrt{\hat{P}_{k}/N_{k}}\right). \tag{17}\]  
For brevity, it is recommended to reorganize the interval shown in (17) by using \(L\) to represent the length of interval, where  
\[L=2t_{\alpha/2}(N_{k}-1)\sqrt{\hat{P}_{k}/N_{k}}. \tag{18}\]The interval in Equation (17), which is expressed as \((\overline{X}_{k}-0.5\text{L},\overline{X}_{k}+0.5\text{L})\) now, is a random interval with the probability of \(1-\alpha\) containing the empirical sample mean \(\hat{X}_{k}\). As the degree of freedom increases, t-distribution will infinitely approach the standard normal distribution [53].