# An Improved Predicted Model for BDS Ultra-Rapid Satellite Clock Offsets
## 4 Improved Algorithms
### Nonlinear Error Corrections by Using a BP Neural Network Model
The default performance function for feed-forward networks is the mean square error between the network's outputs and the target outputs. This error is calculated as shown in Equation (9):  
\[E=\frac{1}{2}\sum_{k=1}^{m}\sum_{n=1}^{m}(Y_{k}-O_{k})^{2}=\frac{1}{2}\sum_{k= 1}^{m}\sum_{n=1}^{m}e_{k}^{2} \tag{9}\]  
where \(Y_{k}\) is the actual output data, and the error between the actual output data and expected output data is \(e_{k}\), \(Y_{k}-O_{k}=e_{k}\). As the actual model error \(E\) is calculated, the weights, dilation parameter and translation parameter are obtained [46]. Compared with the allowable error \(\varepsilon\). If the actual model error \(E\) is not smaller than the allowable error \(\varepsilon\), the model error is corrected by \(e_{k}\) so that the error of the model is further reduced until smaller than allow error \(\varepsilon\). The values \(\omega_{ij}\), \(\omega_{ij}\) and \(c_{j}\), \(d_{k}\) are updated as shown in Equations (9) and (10):  
\[\left\{ \begin{array}{c}\omega_{ij}=\omega_{ij}-\eta H_{j}\big{(}1-H_{j}\big{)} \ x_{i}\sum_{k=1}^{m}\omega_{jk}e_{k}+\alpha\\ \omega_{jk}=\omega_{jk}-\eta H_{j}e_{k}\end{array} \right. \tag{10}\]  
\[\left\{ \begin{array}{c}c_{j}=c_{j}-\eta H_{j}\big{(}1-H_{j}\big{)}\sum_{k= 1}^{m}\omega_{jk}e_{k}\\ d_{k}=d_{k}-\eta e_{k}\end{array} \right. \tag{11}\]  
The process of error back propagation makes the error function the minimum, minE. If minE is less than the allowable error \(\varepsilon\) or iterations have reached the pre-set number, the network comes to an end; otherwise, iteration continues [26]. \(\eta\) is the learning rate which is the step size, generally taken as a constant between 0.1 and 0.4; and \(\alpha\) is the coefficient correction constant, taken as a constant between 0.7 and 0.9 [26; 36; 41; 45; 46]. After the model training is completed, the fitting residuals of the clock offsets by the QP, BPNN, and two period models are shown in Figure 9.  
As shown in Figure 9, the residuals by using the BPNN are significantly smaller than the fitting residuals without the BPNN (Figure 6). Thus, it is very effective for the BDS satellite clocks to achieve better fitting and forecasting accuracy. When the network weights and biases reach the allowable range, the BPNN training is completed [47; 48; 49; 50; 51; 52]. However, the computation of the network is more complicated and its convergence rate will slow down. Moreover, it also makes the network easily over-trained, which leads to degradation of the network's fault tolerance performance and generalizability [52; 53]. Therefore, the number of iterations is set to a fixed value, which not only guarantees the solution time, but also prevents the impact of unsuccessful training [54; 55; 56; 57]. Through combining the neural networks which have trained, the prediction model combines with Equation (5), which can be expressed as:  
\[ \begin{array}{c}y(t)=a_{0}^{p}+a_{1}(t_{i}-t_{0})+a_{2}(t_{i}-t_{0})^{2}+ \sum_{k}^{l}\Lambda_{k}\sin[2\pi f_{k}(t_{i}-t_{0})+\vartheta_{k}]+\\ \sum_{j=1}^{l}\omega_{jk}h\Big{(}\frac{\sum_{i=1}^{n}\omega_{jk}x_{i}-c_{j}}{d_ {j}}\Big{)}+\Delta_{i},\quad\overline{\mathbf{P}},\end{array}  \tag{12}\]  
Comparing with the basic model (2), for the proposed clock model a few periodic terms are introduced and the initial deviations are improved. In addition, the adaptive weight function of time factors and the nonlinear offset corrections are applied in the new model. Then the predicted model and improved algorithms are illustrated. In order to understand the process of the clock offset prediction model, the diagram is shown in Figure 10.  
As shown in Figure 10, the process steps of the BDS ultra-rapid clock offset prediction model are illustrated. Considering that the BDS satellite clock of GEO and IGSO characteristics are unstable, the forecasting model is divided into two parts. The first step uses a quadratic polynomial with a time-adaptive weight function addition periodic terms model. The second step uses a BP neural network to train the model.