# Urban PM2.5 Concentration Prediction via Attention-Based CNN-LSTM
## 3 Data and Method
### Spatiotemporal Correlation Analysis  
Because of meteorological conditions, especially wind speed and wind direction, air pollutants are affected by the environment in the surrounding area. Similarly, particulate matter stays in the air for a long time and is more susceptible to the surrounding area. To analyze the spatial correlation of PM\({}_{2.5}\) concentrations, the Pearson correlation coefficient [20] is calculated among all monitoring stations, and the results are shown in Table 2. From the table, the correlation coefficients among most stations were greater than 0.7, except for the correlation coefficient at S3. This indicates that PM\({}_{2.5}\) concentrations are highly correlated among most stations. The reason for the small correlation coefficient between S3 and other stations is that it is far away from other stations and it is located in a rural area. Thus, the spatial correlation of PM\({}_{2.5}\) concentrations can be used to optimize the input of the model for improving the prediction performance. As shown in Figure 1, PM\({}_{2.5}\) concentrations of the adjacent stations are added to the model input. In the experiment, we used PM\({}_{2.5}\) concentrations of all stations as input because the number of air quality monitoring stations is too small in Taiyuan city. The PM\({}_{2.5}\) concentration is highly correlated in the temporal domain, which is similarly affected by other features in the past. The autocorrelation functions [21] below were used to measure the temporal correlations among the PM\({}_{2.5}\) concentration time series at each station. The detailed formula of the autocorrelation function is as follows:  
\[\rho_{k}=\frac{Cov(y(t),y(t+k))}{\sigma_{y(t)}\sigma_{y(t+k)}}, \tag{2}\]  
Figure 5: Relationship between wind direction, wind speed, and PM\({}_{2.5}\). where \(\rho_{k}\) represents the autocorrelation coefficient when the time lag is \(k\), \(y(t)\) represents the PM\({}_{2.5}\) concentration vector, \(y(t+k)\) represents the PM\({}_{2.5}\) concentration vector after \(k\) hours, \(Cov(y(t),y(t+k))\) is the covariance of \(y(t)\) and \(y(t+k)\), and \(\sigma_{y(t)}\) and \(\sigma_{y(t+k)}\) represent the standard deviations of \(y(t)\) and \(y(t+k)\), respectively. The autocorrelation coefficients of all stations when the value of the time lag \(k\) is different are shown in Figure 6. As seen, in general, the autocorrelation coefficients of all stations declined. When the time lag was smaller, the autocorrelation coefficient was larger. This indicates that a PM\({}_{2.5}\) concentration closer to the current time has a stronger correlation with the PM\({}_{2.5}\) concentration at the current time. The PM\({}_{2.5}\) concentrations within a lag of 15 h are strongly correlated to each other in a period of one day. It is worth noting that, when the time lag was 24, 48, and 72 h, the autocorrelation coefficients of each station in Figure 6 showed a temporary rise. This is very likely due to the periodic living pattern across different days in the same geographical environment and season. As PM\({}_{2.5}\) tends to stay in the air for a long time, its concentrations in the past few hours will affect observed data in the future. In addition to PM\({}_{2.5}\) concentration, the past weather conditions, such as wind and rain/snow, also affect PM\({}_{2.5}\) concentration. According to the above analysis, the current state of observed PM\({}_{2.5}\) concentration is closely related to that in the past states. These findings can help us choose a suitable time lag for multiscale predictors. In general, PM\({}_{2.5}\) concentration is strongly influenced by the spatiotemporal correlations among monitoring stations and the past states of the prediction area. The AC-LSTM model proposed in this