# Spatial Performance Indicators for Traffic Flow Prediction
## 3 Materials and Methods
### Case Study
#### 3.2.3 Traffic Flow Prediction Methods Comparison  
The clustering scenarios show ideally formed clusters that may not appear in real traffic flow prediction results. In reality, the spatial pattern is not as simple as obvious clusters. Traffic networks are heterogeneous in nature because of factors such as congestion points (e.g., intersections, on-ramps, off-ramps, and toll booths) and varied land-use patterns (e.g., residential areas and central business districts). This complex and nonlinear nature affects the measured traffic flow and is reflected in the traffic flow prediction results.  
To demonstrate the capability of spatial KPIs to differentiate traffic flow prediction methods, we compared four different traffic flow prediction methods to predict traffic flow from the PeMSD8 dataset:  
1. Spatial-Temporal Synchronous Graph Convolutional Network (STSGCN) [7] builds a spatial-temporal graph by connecting all nodes with themselves at adjacent time steps to synchronously capture the spatial-temporal correlation. The input data of STSGCN are spatial-temporal network series consisting of several interval recent data in the form of a spatiotemporal graph. The spatiotemporal graph connects each node at time \(t\) with its neighboring nodes (based on the adjacency matrix) and itself, but at times \(t-1\) and \(t+1\). In general, STSGCN consists of graph convolution layers and aggregation layers;
2. Attention Based Spatial-Temporal Graph Convolutional Networks (ASTGCN) [6] consist of (1) a spatiotemporal attention mechanism, utilized to capture the dynamic spatiotemporal correlations from the traffic flow data, and (2) the spatiotemporal convolution that captures the spatial patterns by simultaneously employing graph convolutions and standard convolutions to describe the temporal features. ASTGCN utilizes hourly, daily, and weekly data as inputs. In general, ASTGCN is built on spatiotemporal blocks consisting of spatial attention layers, temporal attention layers, and Graph Convolutional network (GCN) layers. The GCN layer requires prior knowledge of the network structure, in the form of the adjacency matrix;
3. Decomposition Dynamic Graph Convolutional Recurrent Network (DDGCRN) [20] integrates a dynamic graph convolution recurrent network with a recurrent neural network-based model that generates dynamic graphs that adapt to time-varying traffic signals, enabling the extraction of both spatial and temporal features from the data. The input data of DDGCRN are recent traffic flow data but the method includes daily embedding, weekly embedding, and spatial embedding, resulting in spatiotemporal embedding. DDGCRN does not require a predefined adjacency matrix because it uses a dynamic graph generation method for spatial embedding that captures the dynamic spatial dependencies from the input data;
4. Spatio-Temporal Adaptive Embedding Transformer (STAEformer) [21] proposes a new input embedding, spatiotemporal adaptive embedding, in addition to the usual feature embedding and periodicity embedding and applies it to the vanilla transformer.  
\begin{table}
\begin{tabular}{c c c} \hline \hline \multirow{2}{*}{**Scenario**} & \multicolumn{3}{c}{**Number of Nodes Per Cluster**} \\ \cline{2-3}  & **Cluster 1** & **Cluster 2** \\ \hline Star H & 10 & 0 \\ Star L & 10 & 0 \\ Star HH & 6 & 4 \\ Star LL & 6 & 4 \\ Star HL & 6 & 4 \\ Line H & 10 & 0 \\ Line L & 10 & 0 \\ Line HH & 5 & 5 \\ Line LL & 5 & 5 \\ Line HL & 5 & 5 \\ \hline \hline \end{tabular}
\end{table}
Table 2: Clustering scenarios.