# Combining Dilution of Precision and Kalman Filtering for UWB Positioning in a Narrow Space
## 2 Methods
### Optimized Kalman Filter Parameter Configuration Based on DOP Values  
The KF algorithm mainly consists of a prediction step and an update step. The closer the state estimation equation is to the actual process, the higher the prior estimation accuracy is [43]. The accuracy of the posteriori estimation results mainly depends on the observed values. The smaller the error of the observed data obtained by the sensor, the higher the accuracy of the optimal estimation of the KF algorithm [44]. The specific process of the algorithm is detailed below [24].  
The linear system's state and observation equations are as follows:  
\[X_{k}=FX_{k-1}+Q_{k}. \tag{9}\]  
\[Y_{k}=HX_{k}+R_{k}. \tag{10}\]  
where \(X_{k}\) is the state vector, \(F\) is the linear system transfer matrix, \(Q_{k}\) is the process noise vector, \(Y_{k}\) is the observation vector, \(H\) is the state variable to observation transition matrix, and \(R_{k}\) is the process noise vector. The true state of the system can be predicted from the state of the system at the previous moment and the observed state at the next moment. The specific solution equation is as follows:  
(1) Prediction steps:  
\[\left\{\begin{aligned} \widehat{X}_{k}^{-}=F_{k,k-1}\widehat{X}_{k-1}^{+} \\ P_{k}^{-}=F_{k,k-1}P_{k-1}^{+}F_{k,k-1}^{+}+Q_{k,k-1}\end{aligned} \right.. \tag{11}\]  
(2) Supplementary Kalman gain:  
\[K_{k}=P_{k}^{-}H^{T}\Big{(}HP_{k}^{-}H^{T}+R\Big{)}^{-1}. \tag{12}\]  
(3) Update steps:  
\[\left\{\begin{aligned} \widehat{X}_{k}^{+}=\widehat{X}_{k}^{-}+K_{k} \big{(}Y_{k}-HP_{k}^{-}\big{)}\\ P_{k}^{+}=(I-K_{k}H)P_{k}^{-}\end{aligned}\right.. \tag{13}\]  
In Equations (11) to (13), \(\widehat{X}_{k}^{-}\) and \(\widehat{X}_{k}^{+}\) are the prior estimated state vector and posterior estimated state vector at epoch \(t_{k}\). \(P_{k}^{-}\) and \(P_{k}^{+}\) are covariance matrix of prior estimation and the covariance matrix of posteriori estimation at epoch \(t_{k}\). \(F_{k,k-1}\) is the linear system transfer matrix, \(Q_{k,k-1}\) is the process noise vector, \(K_{k}\) is the Kalman gain, \(H\) is the state transition matrix, and \(R\) is the measurement errors covariance matrix. \(Y_{k}\) is the observation vector.  
The source of measurement noise covariance is the observation error [45]. In this study, the source of observation error is mainly from two aspects: the ranging error and tag position solution error. Among them, the ranging error mainly comes from the multipath effect and the NLOS error in the narrow space, and the tag position calculation error mainly comes from the WLS algorithm.  
According to Equation (6), \(Q\) is the covariance matrix of the estimated position of the label. It can therefore be used as a reference value for the measurement noise covariance. Since another part of the observation error comes from multipath effects and NLOS errors in a narrow space, an environmental factor \(K\) can be set as an adjustment. Thus, the measurement noise covariance can be expressed as follows:  
\[R=kQ=k\begin{bmatrix}q_{11}&q_{12}&q_{13}\\ q_{21}&q_{22}&q_{23}\\ q_{31}&q_{32}&q_{33}\end{bmatrix}. \tag{14}\]