# Design and Performance Evaluation of eLoran Monitoring System
## 5 Integrity Monitoring Analysis
### Time Difference Prediction Model  
The basic idea of time difference prediction is to utilize the existing historical data of the TOA to predict the current TOA value through the prediction model.  
In this paper, the Kalman filter prediction model is used; Kalman filtering is an algorithm that uses a series of measurements observed over time, including statistical noise and other inaccuracies, and produces estimates of unknown variables that tend to be more accurate than those based on a single measurement alone, by estimating a joint probability distribution over the variables for each timeframe [31; 32; 33; 34; 35].  
The Kalman filter consists of two main stages: the prediction stage and the update stage. Theoretical derivations are given in Equations (2)-(11).  
1. Prediction Stage  
In the prediction stage, the current state estimate and the system model are used to predict the state and error covariance at the next time step.  
Predict the next state:  
\[x_{k|k-1}=Ax_{k-1|k-1}+Bu_{k} \tag{2}\]  
\(x_{k|k-1}\) is the predicted state at time \(k\), \(x_{k-1|k-1}\) is the estimated state at time \(k-1\), \(A\) is the state transition matrix, \(B\) is the control input matrix, and \(u_{k}\) is the control vector.  
Predict the error covariance:  
\[P_{k|k-1}=AP_{k-1|k-1}A^{T}+Q \tag{3}\]  
\(P_{k|k-1}\) is the predicted error covariance, \(P_{k-1|k-1}\) is the error covariance at time \(k-1\), and \(Q\) is the process noise covariance matrix.  
2. Update Stage  
In the update stage, the predicted state and error covariance are updated using the new measurement.  
Compute the Kalman gain:  
\[K_{k}=P_{k|k-1}H^{T}\Big{(}HP_{k|k-1}H^{T}+R\Big{)}^{-1} \tag{4}\]  
Figure 10: Chengdu and Wuhan receiver antenna installation environment diagram.  
\(K_{k}\) is the Kalman gain, \(H\) is the measurement matrix, and \(R\) is the measurement noise covariance matrix.  
Update the state estimate:  
\[x_{k|k}=x_{k|k-1}+K_{k}\Big{(}z_{k}-Hx_{k|k-1}\Big{)} \tag{5}\]  
\(z_{k}\) is the measurement at time \(k\).  
Update the error covariance:  
\[P_{k|k}=(I-K_{k}H)P_{k|k-1} \tag{6}\]  
\(I\) is the identity matrix.  
3. Iteration  
For each time step \(k\),  
Prediction Stage:  
\[x_{k|k-1}=x_{k-1|k-1} \tag{7}\]  
\[P_{k|k-1}=P_{k-1|k-1}+Q \tag{8}\]  
Update Stage:  
\[K_{k}=\frac{P_{k|k-1}}{P_{k|k-1}+R} \tag{9}\]  
\[x_{k|k}=x_{k|k-1}+K_{k}\Big{(}z_{k}-x_{k|k-1}\Big{)} \tag{10}\]  
\[P_{k|k}=(1-K_{k})P_{k|k-1} \tag{11}\]  
By following these steps, the Kalman filter recursively estimates and predicts the state of one-dimensional time difference data.  
4. Parameter setting  
For the application scenario in this paper, in the prediction with Kalman filtering, a certain amount of historical data need to be selected for the prediction of the latter data, and the parameter num_pre is the amount of historical data needed for the prediction; in order to determine this parameter, the experiments were performed for num_pre = 1, num_pre = 2, num_pre = 3, num_pre = 5, num_pre = 10, and num_pre = 20, and performing the experiment with the same remainder of the parameters, the root mean square error is 0.0083874, 0.0073235, 0.0073572, 0.0078228, 0.0082398, and 0.0082664, respectively. The root mean square error is smaller when num_pre = 2. Therefore, we choose to take the historical data of the first two moments as a prior for predicting the time difference data of the latter moment.  
The ideal value of the time difference is 0, so the initial state is set to 0.  
Process noise covariance Q is set to 0.01.  
Measurement noise covariance R is set to 0.1.  
Initial error covariance P is set to 1.  
Since the next momentary state is not significantly correlated with the previous momentary state, state transition matrix A is set to 1.  
Measurement matrix H is set to 1.