## 3 Results
### Analysis of Suitable Grid Scale for Population Spatialization
#### 3.5.2 Evaluation of Grid Scale Suitability  
Based on the estimation results of the XGBoost model at different grid scales, the estimated population for 214 towns and streets in Shanghai was statistically obtained. In conjunction with population statistics at the corresponding administrative scales, the R\({}^{2}\), MRE, and RMSE of the population spatial estimation data were calculated for each grid scale, as shown in Table 3. In terms of R\({}^{2}\), the values across all grid scales exceed 0.8, demonstrating a high accuracy in the population estimation results based on the 20-dimensional feature variables. However, as the grid scale increases, the accuracy declines, with the R\({}^{2}\) dropping from 0.98 at the 100 m grid scale to 0.83 at the 500 m grid scale. Both the MRE and RMSE follow a similar trend, increasing as the grid scales increase. When the grid scale changes from 100 m to 200 m, the MRE and RMSE values increase  
Figure 6: Spatial distribution of population density at different grid scales.  
exponentially. Based on a comprehensive evaluation of the three accuracy indicators, the 100 m grid scale is the most suitable, followed by the 200 m, 300 m, and 500 m grid scales.  
Additionally, population density data at different grid scales were divided into discrete intervals of 1 person per 10,000 m\({}^{2}\). We counted the number of pixels corresponding to each population density type and calculated the SDPD, SWDI, and SIDI at different grid scales to analyze the heterogeneity of population spatial distribution (Figure 7). The SDPD values across the four grid scales range from 42.08 to 44.35, with the highest value observed at the 100 m grid scale, followed by the 500 m scale, while the 200 m and 300 m grid scales show slightly lower SDPD values. The SWDI and SIDI indices at the four grid scales exhibit similar variation patterns, ranging from 3.97 to 4.05 for the SWDI and 0.968 to 0.971 for the SIDI. The limited variation in the two diversity indices (the SWDI and SIDI) primarily results from relatively stable ratios between individual population density categories and the total density types across different grid scales, as well as their narrow fluctuation ranges. Among the 447 classified density types, these consistent proportional relationships lead to insignificant changes in diversity index values. This observation suggests that at these four grid scales, both landscape indices demonstrate similar patterns of spatial heterogeneity in population distribution.  
The comprehensive analysis demonstrates that the 100 m grid scale produces the most accurate population estimation results for Shanghai, achieving the highest R\({}^{2}\) (0.98) and lowest error metrics (MRE and RMSE), while maintaining the maximum SDPD value (44.35) for the optimal representation of population distribution heterogeneity. Although the SWDI and SIDI values at this scale are slightly lower than at the other resolutions, the differences are negligible. These findings collectively confirm that the 100 m resolution most effectively balances estimation precision with spatial pattern representation, making it the most suitable scale for population spatial estimation in Shanghai.  
\begin{table}
\begin{tabular}{c c c c} \hline
**Grid Scale** & **R\({}^{2}\)** & **MRE** & **RMSE** \\ \hline
100 m & 0.98 & 0.09 & 10,375.9 \\
200 m & 0.91 & 0.2 & 22,037.7 \\
300 m & 0.88 & 0.22 & 24,544.6 \\
500 m & 0.83 & 0.28 & 28,929.5 \\ \hline \end{tabular}
\end{table}
Table 3: Accuracy evaluation of population spatialization at different grid scales.  
Figure 7: Heterogeneity evaluation of population spatial distribution at different grid scales.