# IoT Implementation of Kalman Filter to Improve Accuracy of Air Quality Monitoring and Prediction
## 5 Discussion  
### Accuracy Improvement Analysis  
One of the differences between the Kalman Filter algorithm and other time series prediction models is that the statistical information of process noise and observation error can be effectively utilized in the prediction process, which can correct the a priori estimation of the model. Therefore, from the predictive perspective, the KF uses observation data obtained by the sensor network to improve prediction accuracy. From the monitoring perspective, even with low-cost and low-precision monitor sensors, the KF can correct the error of the measurement data from the algorithm level, which improves the accuracy of sensors on the side.  
In order to verify that the KF algorithm can effectively improve the accuracy of sensor observations, this paper designs a comparing experiment to obtain the error size. The experiment compares the predicted value of the KF and the observed value of the sensor with the data of the official monitoring site, respectively. The main indicators for measuring errors includes MSE (mean-square error), RMSE and MAE (mean-absolute error). The experimental results are shown in Table 1.  
For a more intuitive explanation about improving the specific accuracy by the KF, the percentage decline of MSE, RMSE and MAE are calculated based on Table 1, respectively. The results are shown in Table 2. Based on the data in Table 2, the error of prediction by the KF is 27% lower than that of monitored by sensors on average, which indicates that the KF algorithm can improve the accuracy of sensors to some extent.  
\begin{table}
\begin{tabular}{c c c c c} \hline \hline
**Type** & **Algorithm** & **MSE** & **RMSE** & **MAE** \\ \hline \multirow{2}{*}{SO\({}_{2}\)} & Kalman Filter & 0.0754 & 0.2747 & 0.2032 \\  & Sensor & 0.1265 & 0.3557 & 0.2775 \\ \hline \multirow{2}{*}{NO\({}_{2}\)} & Kalman Filter & 1.6172 & 1.2717 & 1.0659 \\  & Sensor & 2.8765 & 1.6960 & 1.3334 \\ \hline \multirow{2}{*}{CO} & Kalman Filter & 0.0003 & 0.0185 & 0.0138 \\  & Sensor & 0.0004 & 0.0195 & 0.0163 \\ \hline \multirow{2}{*}{O\({}_{3}\)} & Kalman Filter & 41.3410 & 6.4297 & 5.7242 \\  & Sensor & 69.3231 & 8.3260 & 6.8198 \\ \hline \multirow{2}{*}{PM2.5} & Kalman Filter & 0.0110 & 0.1047 & 0.0805 \\  & Sensor & 0.0165 & 0.1285 & 0.0991 \\ \hline \multirow{2}{*}{PM10} & Kalman Filter & 0.0071 & 0.0842 & 0.0613 \\  & Sensor & 0.0133 & 0.1152 & 0.1006 \\ \hline \hline \end{tabular}
\end{table}
Table 1: Error comparison between the Kalman Filter prediction and sensors observation.  
\begin{table}
\begin{tabular}{c c c c} \hline \hline
**Type** & **MSE\_Diff(\%)** & **RMSE\_Diff(\%)** & **MAE\_Diff(\%)** \\ \hline SO\({}_{2}\) & 40.3723 & 22.7810 & 26.7748 \\ \hline NO\({}_{2}\) & 43.7776 & 25.0184 & 20.0589 \\ \hline CO & 25.0023 & 5.0527 & 15.2650 \\ \hline O\({}_{3}\) & 40.3647 & 22.7761 & 16.0641 \\ \hline PM2.5 & 33.6763 & 18.5606 & 18.7659 \\ \hline PM10 & 46.5858 & 26.9149 & 39.0487 \\ \hline Mean & 38.2965 & 20.1840 & 22.6634 \\ \hline \hline \end{tabular}
\end{table}
Table 2: Acceleration accuracy of prediction value by the Kalman Filter.