# A New BDS-2 Satellite Clock Bias Prediction Algorithm with an Improved Exponential Smoothing Method
## 2 Theory of Improved Exponential Smoothing Method Prediction
### Prediction Principle of ES + GM Using Sliding Window  
To further boost the accuracy of clock bias prediction, the GM model is used to learn the fitting errors generated by the ES model during the modeling process, and forecast the value of the fitting errors of the ES model. The final prediction values of clock bias can be obtained by combining the predicted values of the ES model and the GM model. The detailed process of this fusion algorithm is shown in Figure 5. The specific steps for this fusion algorithm of the ES model and the GM model using the SW (ES + GM + SW) are as follows.  
Take the first part as an example, and the rest of the parts are similar to it. Steps 1 to 3 of ES + GM + SW are the same as ES + SW (see Section 2.3).  
Step 4 (GM forecast). During step 3, an ES model is built based on the optimal smoothing coefficients, which generates a fitting error series during the modeling process, and then, the GM model is used to learn the fitting error series and forecast.  
Step 5 (SW processing). The processing method of this step is similar to step 4 of the ES model based on the SW.  
Step 6 (fusion forecasting). Combining the prediction value of the ES model and the prediction value of the GM model in each part, the final prediction value of clock bias can be obtained.  
In step 4, the GM model is used to learn the fitting error sequence of the ES model, and the modeling process is as follows.  
Suppose that the fitting error sequence of the ES model is \(\varepsilon^{(0)}=\left\{\varepsilon^{(0)}(1),\varepsilon^{(0)}(2),\cdots, \varepsilon^{(0)}(n)\right\}\), a new sequence is generated by one-time accumulation as follows [39].  
\[\varepsilon^{(1)}=\left\{\varepsilon^{(0)}(1),\sum_{i=1}^{2}\varepsilon^{(0)}( i),\cdots\sum_{i=1}^{n}\varepsilon^{(0)}(i)\right\} \tag{12}\]  
Establish a first-power differential equation for the sequences \(\varepsilon^{(1)}\) as shown below.  
\[\frac{d\varepsilon^{(1)}}{dt}+a\varepsilon^{(1)}=u \tag{13}\]  
Figure 5: Flow chart of ES + GM clock bias prediction using a sliding window. GM, gray model.  
The first-power differential equation (13) could be described by the matrix equation form (14) after discretization.  
\[\mathbf{Y}=\mathbf{G}\cdot\mathbf{A} \tag{14}\]  
where,  
\[\mathbf{Y}=\left[\begin{array}{c}\varepsilon^{(0)}(2)\\ \varepsilon^{(0)}(3)\\ \vdots\\ \varepsilon^{(0)}(n)\end{array}\right]\mathbf{G}=\left[\begin{array}{c}- \frac{\left[\varepsilon^{(1)}(2)+\varepsilon^{(1)}(1)\right]}{2}&1\\ -\frac{\left[\varepsilon^{(1)}(3)+\varepsilon^{(1)}(2)\right]}{2}&1\\ \vdots&\vdots\\ -\frac{\left[\varepsilon^{(1)}(n)+\varepsilon^{(1)}(n-1)\right]}{2}&1\end{array} \right]\mathbf{A}=\left[\begin{array}{c}a\\ u\end{array}\right] \tag{15}\]  
The least-squares solution to the matrix Equation (14) is obtained employing the least-squares method (LSM) as follows.  
\[\hat{A}=\left[\begin{array}{cc}\hat{a}&\hat{u}\end{array}\right]=\left(G^{T }G\right)^{-1}G^{T}Y \tag{16}\]  
Substituting Equation (16) into Equation (13), the following Equation (17) can be obtained.  
\[\frac{d\varepsilon^{(1)}}{dt}+\hat{a}\varepsilon^{(1)}=\hat{u} \tag{17}\]  
The solution of the time response function (17) can be expressed as  
\[\varepsilon^{(1)}(k+1)=\left[\varepsilon^{(0)}(1)-\frac{\hat{u}}{\hat{a}} \right]\cdot e^{-\hat{a}k}+\frac{\hat{u}}{\hat{a}} \tag{18}\]  
Since sequence \(\varepsilon^{(1)}\) is the cumulative sequence of sequence \(\varepsilon^{(0)}\), the prediction model for the fitting error sequence \(\varepsilon^{(0)}\) of the ES model can be written as follows:  
\[\varepsilon^{(0)}(k+1)=\left(1-e^{\hat{a}}\right)\cdot\left[\varepsilon^{(0)} (1)-\frac{\hat{u}}{\hat{a}}\right]\cdot e^{-\hat{a}k} \tag{19}\]