# Prediction of Vacant Parking Spaces in Multiple Parking Lots: A DWT-ConvGRU-BRC Model
## 3 Methodology
### Prediction Model
#### 3.2.1 Discrete Wavelet Transform (DWT) Denoising  
Time series data obtained in practical applications are often contaminated by various forms and degrees of noise. The discrete wavelet transform is very appropriate for noise filtering, which makes it a good choice for time series data processing [40]. When time series data are decomposed by a DWT, the original signal is separated into approximate coefficients and detail coefficients at different resolution levels. The information of the original signal is retained in the wavelet coefficients, and a perfect reconstruction of the original data can be performed from these coefficients. However, some of the detail coefficients that represent the detailed motion in the data can be identified as noise. These coefficients can then be set to zero prior to the DWT reconstruction process to filter out the noise from the original time series, and reconstruction involves reconstructing the time series from every component except the noise. In other words, a DWT is a discretization of the scales and translations of the fundamental wavelet. A DWT can be defined as:  
\[W_{\varphi}f(m,n)=2^{-\frac{\pi}{2}}\int_{R}f(t)\overline{\psi}(2^{-m}t-n)dt \tag{2}\]  
where \(\overline{\psi}\) is the complex conjugate of \(\psi\), formula \(\psi\) satisfies \(\int_{-\infty}^{+\infty}\psi(t)dt=0\), and m and n are integers.  
Appropriate wavelet basis functions are very important to extract the features of parking data. [PERSON] et al. [41] selected the appropriate wavelet basis function based on entropy estimation in the matching pursuit algorithm. [PERSON] et al. [42] chose the appropriate wavelet basis function by calculating the magnitude of the mutual information. In this paper, we measure the dependence between two variables by calculating the normalized  
Figure 4: DWT-ConvGRU-BRC model.  
mutual information (NMI), which places the mutual information between [0, 1], and it is easy to choose a suitable wavelet basis function. The NMI is defined as:  
\[NMI(X,Y)=\frac{2(H(X)-H(X|Y))}{H(X)+H(Y)} \tag{3}\]  
where \(H(X)\) and \(H(Y)\) represent the entropy of variables \(X\) and \(Y\), respectively. \(H(X|Y)\) is the conditional entropy for \(X\) given \(Y\).  
In this study, the basisfunctions of the compared wavelets are Daubechies (db3), symlet (sym3), and coiflet (coif3). It can be seen from Figure 5 that db3 has the highest NMI relative to other wavelet functions. After experimental comparison, the db3 wavelet basis is selected for wavelet decomposition of the experimental time series, and the number of decomposition levels is 3, which can remove the noise while maintaining the fluctuation characteristics of the time series data as much as possible.  
We take the St7 parking lot as an example to show the specific process of the DWT component. The original VPS data and its decomposition components are shown in Figure 6. Red is the high-frequency sequence decomposed three times, and blue is the low-frequency sequence. The denoising was performed using the threshold method, and then the denoised time series was reconstructed. Figure 7 shows the comparison between the original and denoised data. We can see that the overall regularity of the denoised data has increased, and the trend tends to be smoother, which is more suitable for model construction. As in Equation (1), the denoised data are \(X_{t}\).  
Figure 5: Wavelet selection based on normalized mutual information.