**7. Search an unknown trend in the power polynomial class**

The need to process GNSS measurements including a trend on which noise and outliers are superimposed arises at different processing stages of the application process. As already stated above, satellite clock corrections contain a linear trend. In some cases, it may not be known, and then, one has to search for it, for example, by the least square method. The presence of outliers in the measurement data is a significant obstacle to accurate determination of drift and offset parameters of satellite clocks. Other examples are linear combinations of code and phase data on two carriers [3]. To obtain high accuracy results, it is necessary to detect outliers against an unknown trend and remove them from further processing. This is the subject of this section.

*Effective Algorithms for Detection Outliers and Cycle Slip Repair in GNSS Data Measurements DOI: http://dx.doi.org/10.5772/intechopen.92658*

#### **7.1 Statement of the problem**

Consider the problem of outlier detecting in data presented in the form of Eq. (1), recall that:

$$\mathbf{y}\_{\mathbf{j}} = \mathbf{f}\_{\mathbf{j}} + \mathbf{z} + \xi\_{\mathbf{j}}; \mathbf{j} = \mathbf{1} \dots \mathbf{N}.$$

The procedure described above for finding the optimal solution in an ordered series of numbers may not produce an adequate result if applied to data containing an unknown trend. For example, there may be no solution, and all data will be defined as outliers. In order to detect outliers in a series of numbers with a trend using the algorithm described above, it is necessary to find a suitable approximation of an unknown function fj and subtract it from the data set. Searching for this approximation is usually done by selecting functions from some functional class. The choice of the functional class depends on the task. In some cases, these may be power polynomial, in other cases, trigonometric polynomial, etc. The presence of outliers in the data measurements makes it much more difficult to find such an approximation. In this section, we will describe the general approach to solving the problem and look for suitable approximations of trend fj in the class of power polynomial with real coefficients:

$$\mathbf{P\_{n,j}}\left(\overrightarrow{\mathbf{a}}\right) = \mathbf{a\_n}(\mathbf{j/N})^\mathbf{n} + \mathbf{a\_{n-1}}(\mathbf{j/N})^{\mathbf{n}-1} + \dots + \mathbf{a\_0},\tag{37}$$

where *<sup>n</sup>* is the polynomial degree, and a! <sup>¼</sup> f g a0, … , an is vector of coefficients.

Thus, the problem consists in the creation of an algorithm for searching the trend in the class of power polynomial and detecting outliers in specified data series yj represented in Eq. (1).

#### **7.2 Minimizing set of specified length L**

Before we turn to the trend search algorithm construction, we will define the socalled minimizing set of given length L, which plays an essential role in the trend search. In addition, in Section 7.3, we will describe a search algorithm for such set based on the recurrent formulas (17)–(19) and (20)–(22).

Let YL ¼ yj 1 , … , yj L n o be an arbitrary set of length L, composed of the values of a numerical series yj n o<sup>N</sup> j¼1 , the monotony is not supposed. The mean and the SD values for it are denoted by *zYL* and σYL . These values are calculated by standard formulas:

$$\mathbf{z}\_{\mathbf{Y}\_{\mathbb{L}}} = \mathbf{L}^{-1} \sum\_{\mathbf{j} \in \{\mathbf{j}\_{\mathbb{L}}, \dots, \mathbf{j}\_{\mathbb{L}}\}} \mathbf{y}\_{\mathbf{j}}.\tag{38}$$

$$\sigma\_{\mathbf{Y}\_{\mathbb{L}}}^{2} = \left(\mathbf{L} - \mathbf{1}\right)^{-1} \sum\_{\mathbf{j} \in \{\mathbf{j}\_{\mathbb{L}}, \dots, \mathbf{j}\_{\mathbb{L}}\}} \left(\mathbf{y}\_{\mathbf{j}} - \mathbf{z}\_{\mathbf{Y}\_{\mathbb{L}}}\right)^{2}. \tag{39}$$

**Definition 2**. *Given L for a specified sequence of values* yj n o<sup>N</sup> j¼1 *the set of values:*

$$\mathbf{Y}\_{\mathrm{L,min}} = \left\{ \mathbf{y}\_{\mathrm{j}\_1}, \dots, \mathbf{y}\_{\mathrm{j}\_L} \right\},$$

*at which the minimum value of* σ<sup>2</sup> YL *defined in Eq. (39) is reached will be called the minimizing set of length L. The corresponding mean and SD values are denoted by* zYL, min *and* σYL, min *.*

According to this definition, we have

$$\mathbf{z}\_{\mathbf{Y}\_{\mathbf{L},\min}} = \mathbf{L}^{-1} \sum\_{\mathbf{j} \in \{\mathbf{j}\_{\text{i}}, \dots, \mathbf{j}\_{\text{i}}\}} \mathbf{y}\_{\mathbf{j}},\tag{40}$$

$$\sigma\_{\mathbf{Y}\_{\mathbf{L},\min}}^{2} = (\mathbf{L} - \mathbf{1})^{-1} \sum\_{\mathbf{j} \in \{\mathbf{j}\_{\rm l}, \dots, \mathbf{j}\_{\rm l}\}} \left(\mathbf{y}\_{\mathbf{j}} - \mathbf{z}\_{\mathbf{Y}\_{\mathbf{L},\min}}\right)^{2} = \min\_{\mathbf{Y}\_{\mathbf{L}}} \left\{\sigma\_{\mathbf{Y}\_{\mathbf{L}}}^{2}\right\}.\tag{41}$$

Minimum in Eq. (41) is searched by all kinds of sets of length L composed of numbers of series yj n o<sup>N</sup> .

j¼1 Note that the numbers yj are not supposed to be in the ascending order.

Next, we will formulate and prove a statement similar to Assertion 1, which will allow us, when searching for a minimizing set, to proceed from the original series to its ordered permutation.

**Assertion 6.** Let YL, min ¼ yj 1 , … , yj L n o be a minimizing set of length L *for a given sequence of values* yj n o<sup>N</sup> j¼1 and

$$\mathbf{y}\_{\min} = \min\left\{ \mathbf{y}\_{\mathbf{j}\_1}, \dots, \mathbf{y}\_{\mathbf{j}\_L} \right\}, \\ \mathbf{y}\_{\max} = \max\left\{ \mathbf{y}\_{\mathbf{j}\_1}, \dots, \mathbf{y}\_{\mathbf{j}\_L} \right\},$$

*then the interval* ymin, ymax � � *does not contain values* yj *that are not in the set* YL, min *.*

**Proof.** Let us assume the opposite: Let yj ∉ YL, min , ymin <yj < ymax. Let yk, … , ykþL�<sup>1</sup> is a permutation of the numbers yj 1 , … , yj L in the ascending order; then yk <sup>¼</sup> ymin and ykþL�<sup>1</sup> <sup>¼</sup> ymax. One of these cases is possible:

a. yj <zYL, min and therefore subject to inequality yk <yj , we have

$$\left(\left(\mathbf{z}\_{\mathbf{I}\_{\mathrm{L,min}}} - \mathbf{y}\_{\mathbf{k}}\right) > \left(\mathbf{z}\_{\mathbf{Y}\_{\mathrm{L,min}}} - \mathbf{y}\_{\mathbf{j}}\right) \Rightarrow \left(\mathbf{z}\_{\mathbf{Y}\_{\mathrm{L,min}}} - \mathbf{y}\_{\mathbf{k}}\right)^{2} > \left(\mathbf{z}\_{\mathbf{Y}\_{\mathrm{L,min}}} - \mathbf{y}\_{\mathbf{j}}\right)^{2}$$

$$\Rightarrow \left(\mathbf{z}\_{\mathbf{Y}\_{\mathrm{L,min}}} - \mathbf{y}\_{\mathbf{j}}\right)^{2} - \left(\mathbf{z}\_{\mathbf{Y}\_{\mathrm{L,min}}} - \mathbf{y}\_{\mathbf{k}}\right)^{2} < \mathbf{0} \tag{42}$$

b. yj <sup>≥</sup>zYL, min and therefore subject to inequality ykþL�<sup>1</sup> <sup>&</sup>gt;yj , we have

$$\left(\mathbf{y}\_{\text{k}+\text{L}-1} - \mathbf{z}\_{\text{Y}\_{\text{L,min}}}\right) > \left(\mathbf{y}\_{\text{j}} - \mathbf{z}\_{\text{Y}\_{\text{L,min}}}\right) \Rightarrow \left(\mathbf{y}\_{\text{j}} - \mathbf{z}\_{\text{Y}\_{\text{L,min}}}\right)^{2} - \left(\mathbf{y}\_{\text{k}+\text{L}-1} - \mathbf{z}\_{\text{Y}\_{\text{L,min}}}\right)^{2} < \mathbf{0} \tag{43}$$

In the first case, Case (a), we replace the value yk in the set yk, … , ykþL�<sup>1</sup> � � with yj . In the second case, Case (b), we replace the value ykþL�<sup>1</sup> with yj . We want to show that doing such replacement, the value σ<sup>2</sup> YL, min expressed in Eqs. (40) and (41) will decrease. This will mean that YL, min is not a minimizing set.

Suppose Case (a). For brevity, we will write below z instead of zYL, min and σ<sup>2</sup> instead of σ<sup>2</sup> YL, min . Denote <sup>~</sup>*<sup>z</sup>* and <sup>σ</sup>~<sup>2</sup> , the similar values obtained after replacement yk with yj . We have:

$$\mathbf{z} = \mathbf{L}^{-1}(\mathbf{y}\_{\mathbf{k}} + \dots + \mathbf{y}\_{\mathbf{k} + \mathbf{L} - 1}),\tag{44}$$

*Effective Algorithms for Detection Outliers and Cycle Slip Repair in GNSS Data Measurements DOI: http://dx.doi.org/10.5772/intechopen.92658*

$$\sigma^2 = \left(\mathbf{L} - \mathbf{1}\right)^{-1} \left(\left(\mathbf{y}\_{\mathbf{k}} - \mathbf{z}\right)^2 + \dots + \left(\mathbf{y}\_{\mathbf{k}+\mathbf{L}-1} - \mathbf{z}\right)^2\right),\tag{45}$$

and

$$\tilde{\mathbf{z}} = \mathbf{L}^{-1} \left( \mathbf{y}\_{\mathbf{k}+\mathbf{1}} + \dots + \mathbf{y}\_{\mathbf{k}+\mathbf{L}-\mathbf{1}} + \mathbf{y}\_{\mathbf{j}} \right), \tag{46}$$

$$\tilde{\sigma}^2 = (\mathbf{L} - \mathbf{1})^{-1} \left( \left( \mathbf{y}\_{\mathbf{k}+1} - \tilde{\mathbf{z}} \right)^2 + \dots + \left( \mathbf{y}\_{\mathbf{k}+\mathbf{L}-1} - \tilde{\mathbf{z}} \right)^2 + \left( \mathbf{y}\_{\mathbf{j}} - \tilde{\mathbf{z}} \right)^2 \right). \tag{47}$$

We want to show that

$$
\bar{\sigma}^2 < \sigma^2. \tag{48}
$$

Eqs. (44) and (46) imply:

$$
\tilde{\mathbf{z}} = \mathbf{z} + \mathbf{L}^{-1} \left( \mathbf{y}\_{\circ} - \mathbf{y}\_{\circ} \right). \tag{49}
$$

Modify σ~<sup>2</sup> expressed in Eq. (47) taking account of Eq. (49):

$$
\begin{split}
\hat{\sigma}^2 &= (\mathbf{L} - \mathbf{1})^{-1} \Big( \left( \mathbf{y}\_{\mathbf{k}+\mathbf{1}} - \mathbf{z} - \mathbf{L}^{-1} \left( \mathbf{y}\_{\mathbf{j}} - \mathbf{y}\_{\mathbf{k}} \right) \right)^2 + \dots \\ &+ \Big( \mathbf{y}\_{\mathbf{k}+\mathbf{L}-1} - \mathbf{z} - \mathbf{L}^{-1} \Big( \mathbf{y}\_{\mathbf{j}} - \mathbf{y}\_{\mathbf{k}} \Big) \Big)^2 + \left( \mathbf{y}\_{\mathbf{j}} - \mathbf{z} - \mathbf{L}^{-1} \Big( \mathbf{y}\_{\mathbf{j}} - \mathbf{y}\_{\mathbf{k}} \Big) \right)^2 \Big).
\end{split}
$$

After simplification with taking into account Eq. (45), we get from here:

$$
\tilde{\boldsymbol{\sigma}}^2 = \mathbf{\sigma}^2 + (\mathbf{L} - \mathbf{1})^{-1} \left[ \left( \mathbf{y\_j} - \mathbf{z} \right)^2 - \left( \mathbf{y\_k} - \mathbf{z} \right)^2 - \mathbf{L}^{-1} \left( \mathbf{y\_j} - \mathbf{y\_k} \right)^2 \right].
$$

From (42), it follows (recall that we write z instead of zYL, min ) that the expression in the square brackets is strictly less than zero. Thus, inequality (48) is proven. From this follows that the set YL, min is not minimizing one because the condition (41) is not met. Thus, we have arrived at a contradiction that proves the validity of the formulated Assertion 6. Case (b) is considered similarly.
