# A Novel Error Correction Approach to Improve Standard Point Positioning of Integrated BDS/GPS
## 3 Error Correction Method  
### The LSTM Model  
LSTM network is a special RNN network, which also has a module link structure, but the difference is the module structure of the hidden layer [32]. The input of the LSTM network at time \(t\) includes not only the input value of the current time network, but also the output at time \(t\!-\!1\) and the unit status at time \(t\!-\!1\). At the same time, its output not only has the output of the current moment, but also the unit state of the current moment. The structure of un-rolled LSTM sequential architecture is shown in Figure 1.  
In this paper, LSTM recurrent neural network with peephole is performed on the error correction of integrated BDS/GPS point positioning. The structure of an LSTM block is shown in Figure 2.  
Compared to the standard four-layer LSTM neural network module, the LSTM recurrent neural network with the peephole has only three neural network layers, including two sigmoid layers and one tanh layer. At the same time, forget gates are coupled with input gates in the modified LSTM recurrent neural network.  
In the modified LSTM block, the input of the forget gate layer consists of three vectors, which are the state of the memory cell at the previous moment (\(C_{t-1}\)), the output of the memory cell at the previous moment (\(h_{t-1}\)) and the input of the memory cell at the current moment (\(X_{t}\)) [33]. \(W_{f}\), \(b_{f}\) and \(f_{t}\) are used to represent the weight, offset and output vector of sigmoid neural network layer of the forget gate, respectively. The sigmoid activation function can be defined as:  
Figure 1: The un-rolled LSTM sequential architecture.  
Figure 2: The structure of an LSTM block.  
To effectively reduce common errors and receiver errors, and suppress multi-path effects, the LSTM-based error correction method is proposed.  
The overall flow of the LSTM-based error correction method is shown in Figure 3. First, the Rinex file generated by the GNSS receiver is read. Among them, the N file means the GPS ephemeris file, the C file denotes the BDS ephemeris file and the O file represents the BDS/GPS observation file. Then, the LSTM-based error correction method is used to solve the position and finally obtain the corrected position information.  
The LSTM-based error correction framework including WLS-LSTM and Kalman-LSTM is shown as Figure 4. The Kalman-LSTM error correction process in the red box on the left is as follows: Firstly, initial parameters are set, including sampling interval, initial state matrix, initial mean square error matrix, state transition matrix, noise driving matrix, system variance matrix, noise covariance matrix, measured value matrix and epoch number. Then, for 1 to epoch number, the vector observation matrix is constructed, followed the Kalman filter prediction and the measurement update process is performed. Then, the Kalman filter result is obtained. After that, the LSTM prediction, which uses the error result of Kalman filtering as the input of the learning network, is performed and the prediction result is obtained. Finally, the error correction is performed. The WLS-LSTM error correction process in the blue box on the right is as follows: Firstly, initial parameters are set, the same with Kalman-LSTM. Then, for 1 to epoch number, the weighted least square method is performed, including obtaining the residual vector and calculating the weight matrix. Then, the weighted least square method result is obtained. After that, the same with Kalman-LSTM, the LSTM prediction is performed, and the prediction result is obtained. Finally, the error correction is performed.  
Figure 3: The overall flow of the LSTM-based error correction method.