## 5 Methodology
### Spatial Statistics
#### 5.2.1. HdbSCAN  
We used Hierarchical Density-Based Spatial Clustering of Applications with Noise (HDBSCAN), a density-based clustering algorithm for identifying clusters, in our mobility data. Density-based clustering algorithms have the advantage of identifying clusters of varied sizes and shapes in a dataset, as opposed to other clustering methods that assume clusters have a regular shape and require the user to specify the number of clusters [49; 50]. HDBSCAN uses a hierarchical approach to identify clusters based on the density of points in the data, making it robust and efficient in handling data with noise or varying density. HDBSCAN follows a four-step process to create a cluster. The first step involves estimating  
Figure 4: Movement of individuals three hours before (**a**) and after (**b**) a baseball game, where the map shows the intensity of people in the city area. The dark arrow indicates a higher number of people, while the light arrow represents fewer people moving around the area. It is evident from the figure that the intensity of people increases in the city area after the game.  
the density of points by calculating their distance to the kth nearest neighbor, also known as the core distance. HDBSCAN then uses a new distance metric, known as mutual reachability distance, to identify low-density points or noise. This is achieved through Equation (1) in the algorithm, which is used to calculate the mutual reachability distance between points.  
\[d_{\textit{mreach}-k}(a,b)=max\{core_{k}(a),core_{k}(b),d(a,b)\} \tag{1}\]  
Equation (1) used in HDBSCAN considers the original matrix distance (\(d(a,b)\)) between two points (\(a\) and \(b\)) and the core distance or density estimate (\(core_{k}\)) for a given parameter \(k\). The mutual reachability distance, which is calculated using this equation, is also utilized in the subsequent step to generate a minimum spanning tree that identifies connected points in dense regions. The third step of the HDBSCAN algorithm is crucial and involves pruning the tree by comparing the total number of points in a branch to the minimum cluster size. Finally, the stability of each resulting cluster in the pruned spanning tree is determined in the last step by applying Equation (2).  
\[\sum_{\textit{percluster}}\left(\lambda_{p}-\lambda_{\textit{birth}}\right) \tag{2}\]  
In the last step of HDBSCAN, the stability of each cluster is calculated using two thresholds, namely \(\lambda_{\textit{birth}}\) and \(\lambda_{p}\). \(\lambda_{\textit{birth}}\) is the threshold value at which a cluster splits and becomes its own cluster, while \(\lambda_{p}\) is the threshold value at which a point \(p\) in a given cluster falls out of the cluster. The stability of each cluster is then used to determine which cluster will be included in the final set of clusters.  
Additionally, HDBSCAN has several parameters that can be adjusted to control the algorithm's sensitivity and improve its performance on different datasets [51]. We chose to use HDBSCAN compared to multi-scale OPTICS and DBSCAN, provided as a spatial statistics tool in ArcGIS Pro, for our study. This was decided because of its ability to handle the complexity of our large-scale data and its flexibility in identifying clusters of varying sizes and shapes without requiring a distance parameter [52].  
We utilized HDBSCAN to identify statistically significant clusters of individuals in key locations during the game day of the Saint Louis Cardinals vs. the Pittsburgh Pirates on 12 May 2019. For visualization in our research, we selected a minimum number of 25 features to be considered as a crowd in our point of interest, which means that the algorithm only considers groups of points with at least 25 members as valid clusters. Points that do not belong to a cluster of at least 25 points are labeled as noise points. This decision was made based on the rationale that this number represents a reasonable threshold for defining a group of people that can be visually identified and distinguished from other individuals in the area.