## 3 Methodology
### Research Method  
1 Nearest neighbor index: The nearest neighbor index is expressed as the ratio of the observed mean distance to the expected mean distance. We used the POI data of NSFs in the YRD urban agglomeration as the research object, and we calculated the nearest neighbor index of different types of service facilities. Therefore, it can indicate the concentration or dispersion level of service facility POI data in geographical space. Using the nearest neighbor index to measure the degree of clustering of six types of nighttime economic service facilities related to travel in the Yangtze River Delta urban cluster (food, accommodation, transportation, entertainment, shopping, and sightseeing) provides the potential for optimizing the layout of nighttime economic infrastructure for the rational development of the region. If the index is less than 1, the NSFs show a clustering pattern in geographic space; if the index is greater than 1, the NSFs exhibit a discrete pattern in geographic space. The formula is [62]:  
\[R=\frac{\overline{r}_{1}}{\overline{r}_{E}} \tag{1}\]  
in which:  
\[\overline{r}_{E}=\frac{1}{2\sqrt{n/A}}\qquad\overline{r}_{1}=\frac{\sum_{i=1}^ {n}d_{i}}{n}\]  
where \(R\) is the nearest neighbor index, \(\overline{r}_{1}\) is the mean value of the distance between the nearest points, \(\overline{r}_{E}\) is the theoretical nearest neighbor distance, \(A\) is the area of the region, \(n\) is the number of research objects, and \(d_{i}\) represents the distance between the centroid of each feature and the centroid position of its nearest neighbor feature. 2 Kernel density estimation (KDE): Kernel density estimation (KDE) involves employing kernel smoothing for the estimation of probability density. In other words, it is a non-parametric approach to assessing the probability density function of a random variable, utilizing kernels as weights. In our research, KDE reflects the degree of agglomeration of POI data in a study area and is widely used to analyze the spatial agglomeration of POI data. This helps us effectively assess the spatial balance issues of nighttime economic service facilities in various formats within the Yangtze River Delta urban cluster, especially providing recommendations for the integrated and coordinated development of nighttime economic infrastructure in the core and peripheral areas of the Yangtze River Delta. The formula is as follows [63]:  
\[\hat{f}_{h}(x)=\frac{1}{nh}\sum_{i=1}^{n}K\left(\frac{x_{i}-x}{h}\right),x\in R \tag{2}\]  
where \(\hat{f}_{h}(x)\) represents the kernel density estimation value, \(K\left(\frac{x_{i}-x}{h}\right)\) is the kernel function, \(h\) represents bandwidth, and \(n\) represents the number of POI for nighttime service facilities. 3 Standard deviation ellipse analysis: This method is used to summarize the spatial characteristics of geographic features such as central tendency, dispersion, and directional trends and to compare and analyze the distribution direction and degree of concentration of different NSFs in the YRD urban agglomeration. It helps us understand the spatial scope and development trends of differentiated nighttime economies, providing valuable insights for future nighttime economic development. We conducted a standard deviation ellipse analysis on the POI data of NSFs. The size and shape of an ellipse can describe the dispersion and concentration of NSFs. The major and minor axes of the standard deviation ellipse represent the diffusion direction and degree of concentration of NSFs, respectively, whereas the azimuth of the standard deviation of the ellipse reflects the distribution direction of NSFs. The formula is as follows:  
Weighted mean center of features [64].