## 3 Methods
### Change Point Detection  
During urban tunneling, the main objective of ground deformation monitoring is to detect abrupt and gradual displacements in time to prevent damage to surface structures and utilities. Continuous GPS observations and near real-time data processing are able to provide near real-time measurement streams in three directions. Abrupt positional changes at a few centimeters can be easily detected by eye from the incoming displacement time series. However, minor abrupt-displacements (steps) at a few millimeters and slow gradual-displacements, may go unnoticed because they are of similar size to the data noise and the step may be hidden by the noise. An automatic signal processing algorithm is needed to aid in detecting abrupt as well as gradual positional changes from the incoming displacement time series. The step detection problem occurs in multiple scientific and engineering contexts. In signal processing, this is usually considered a special case of the statistical method known as change point detection (CPD). CPD has been studied for several decades in the fields of data mining, statistics, digital signal process, and computer science. Numerous CPD-algorithms have been developed for different application purposes [40; 41]. CPD algorithms are traditionally classified as \"online\" or \"offline\". Online CPD algorithms run concurrently with the data processing (measuring) and analyze each measurement as it becomes available with a goal of detecting a change point as soon as possible after it occurs, ideally before the next measurement arrives. In contrast, offline algorithms consider the entire dataset at once, and look back in time to recognize where or when the change occurred. For near real-time monitoring purposes, an online algorithm is needed. We tested several online CPD algorithms and found that a backward moving-average (boxcar) filter with a sliding-window works well to detect abrupt displacements in GPS-derived displacement time series. The averaging process can improve the signal-to-noise ratio in the time domain by passing long-period power (real displacements) and by attenuating short-period power (mostly noise, outliers). For the backward filtering, the sliding window consists of the current point and \(n\) points before the current point. The value at the current point is replaced with the mean value of the points in the current window. The width of the sliding window (\(n\)) should be large enough to minimize errors to represent the overall state yet small enough to still enhance the step caused by a minor positional change. A conceptual backward moving-average filter can be illustrated in the following. For incoming data stream:  
\[X=\{x(1),x(2),\ldots,x(n),x(n+1),\ldots,\ x(i)\}, \tag{2}\]  
the backward-filtered data stream can be described as  
\[f(i)=\sum_{j=0}^{n}x(i-j)/(n+1). \tag{3}\]  
The advantage of the backward filtering is that it does not require any new measurements. However, a potential incoming step can be degraded by its adjacent previous measurements. Thus, it could be hard to identify the exact change point in time if the change is minor. In order to detect the exact change point in near real-time, we further applied a forward moving-average filter. For the forward filtering, the sliding-window consists of the current point and \(n\) points that come after the current point. So, the value of the point needs to wait for \(n\) new measurements to be replaced with the mean value. The forward filter can be written as:  
\[f(i)=\sum_{j=0}^{n}x(i+j)/(n+1). \tag{4}\]  
The forward filter is offline by \(n\) points. The sensitivity of the CPD depends on the window size. Although small windows would be able to detect changes in a shorter time compared to larger windows, it may fail to detect minor changes. We find that a window size of five measurements works well for both daily and hourly displacement time series presented in this study.