# Improved Interpolation and Anomaly Detection for Personal PM\({}_{\mathbf{2.5}}\) Measurement
## 3 Experimental Tests
### Interpolation and Anomaly Detection with Real-World Personal Data
#### 3.3.1 Application of Interpolation and Anomaly Detection Method with Real-World Personal Dataset 1  
As shown in Figure 2, the level of PM\({}_{2.5}\) was stable, implying that the subject was relatively calm with minimal abrupt activity changes. The length of the dataset was 59,422 at 10-s intervals, but it \begin{table}
\begin{tabular}{c c c c c c} \hline \hline \multirow{2}{*}{**Data Pattern**} & \multirow{2}{*}{**Interpolation Method**} & \multicolumn{4}{c}{**Number of Missing Data**} \\ \cline{3-6}  & & **40** & **60** & **80** & **100** \\ \hline \multirow{4}{*}{Up slope} & Proposed & 26.919 & 26.426 & 25.733 & 28.599 \\  & Spline & 37.052 & 36.679 & 35.682 & 37.908 \\  & LOCF & 36.604 & 36.909 & 35.707 & 38.393 \\  & Agg & 656.741 & 657.476 & 659.759 & 658.761 \\ \hline \multirow{4}{*}{Down slope} & Proposed & 24.687 & 25.704 & 27.840 & 28.945 \\  & Spline & 26.741 & 27.817 & 30.233 & 31.834 \\  & LOCF & 34.223 & 35.888 & 38.719 & 39.818 \\  & Agg & 283.824 & 278.758 & 280.763 & 280.666 \\ \hline \multirow{4}{*}{Flat 1} & Proposed & 4.551 & 3.981 & 4.341 & 4.376 \\  & Spline & 3.871 & 3.326 & 3.555 & 3.535 \\  & LOCF & 5.215 & 4.803 & 4.874 & 5.403 \\  & Agg & 4.426 & 3.918 & 4.052 & 4.071 \\ \hline \multirow{4}{*}{Flat 2} & Proposed & 3.633 & 3.751 & 3.694 & 3.656 \\  & Spline & 3.505 & 3.610 & 3.514 & 3.493 \\  & LOCF & 4.554 & 4.817 & 4.893 & 4.783 \\  & Agg & 4.031 & 4.129 & 4.062 & 4.062 \\ \hline \multirow{4}{*}{Flat 3} & Proposed & 2.335 & 2.310 & 2.429 & 2.325 \\  & Spline & 2.229 & 2.080 & 2.237 & 2.187 \\ \cline{1-1}  & LOCF & 2.991 & 3.027 & 3.226 & 2.875 \\ \cline{1-1}  & Agg & 2.271 & 2.125 & 2.293 & 2.233 \\ \hline \hline \end{tabular}
\end{table} 
Table 1: Root mean squared errors (RMSEs) of the four interpolation methods applied to our real-time personal monitoring data. LOCF: last observation carried forward. had 17,968 missing datapoints in total. Before we went on to detect the anomalies, we first selected an optimal bandwidth for the dataset as we did previously. After deciding on an optimal bandwidth for the data set, as seen in Figure 3, we interpolated the missing values based on the algorithm mentioned before. The corresponding results are given in Figure 4.  
Figure 3: By increasing the bandwidth from small to large, we calculate the RMSE of the estimation and examined at what value of the bandwidth the corresponding RMSE is the minimum. Figure 2: This is a data set that was collected for 6 days between 25 January 2019 and 31 January 2019. The length of the dataset is 59,422, having 17,968 missing datapoints in total. Figure 4 shows the interpolated data (red dots) superimposed on the actual data. It indicates that the missing data appeared in a small or large aggregated formation. In particular, it can be seen that much of data loss occurred between 40,000 and 60,000 according to the time index. After checking the raw data, we confirmed that this large data loss occurred between 13:00 and 16:00, presumably because of various activities in the afternoon. So much missing data could be very difficult to interpolate by methods other than linear interpolation. In such a case, it is preferable to carry out the initial interpolation using linear interpolation, as in our method, and then to apply other methods to improve the result. As shown in the figure, the interpolation goes well with the overall pattern of the data. As the next step, for the entire dataset, we detected anomalies in the dataset, based on the method described in the method section. When the difference of adjacent PM\({}_{2.5}\) values is above a certain threshold (in this experiment, 200), we considered them to be anomalies. The corresponding anomalies are shown in red in Figure 5, which shows there are eight anomalies detected by visual inspection; the four red dots on the top seems to be the true outliers.