# Regional Geomagnetic Field Modeling Based on Associated Legendre Polynomials
## 4 Discussion and Conclusions  
This study successfully developed a new regional geomagnetic anomaly field model--namely, the R\(-\)ALPOLM--using associated Legendre polynomials to enhance the accuracy and efficiency of geomagnetic field modeling. The model achieved an RMSE value of 3.21 nT, outperforming the LPM (5 nT) and TPM (12.76 nT) models considered in this study, as well as previous models (30 nT) [14], indicating its enhanced performance. This result highlights the advantage of the R\(-\)ALPOLM in accurately modeling geomagnetic anomaly fields and confirms the feasibility of enhancing the prediction accuracy through the post-processing of outliers, providing significant potential for applications in geophysical exploration, geomagnetic navigation and positioning, and other related fields. As the degree of the model increased, the number of outliers showed a tendency to increase, primarily distributed in the boundary region of the model. These outliers typically have extremely large values, which significantly affect the overall accuracy of the model. Previous studies have addressed the boundary effect through the interpolation of additional  
Figure 8: Planar residual distribution and residual histograms of the model predictions: (**a**) The TPM model, (**b**) The LPM model, and (**c**) The R\(-\)ALPOLM model. The residuals are calculated as the difference between the original data and the model predictions. The figure illustrates the spatial distribution of residuals for each model, along with their corresponding histograms, providing a comprehensive comparison of the prediction accuracy. boundary points, which can enhance the prediction accuracy of the model to some extent. As the degree of the model increases, the instability of the boundary also increases, which requires the introduction of more boundary points to compensate for this issue; however, an excessive number of boundary points can undermine the reliability of the experimental data. Furthermore, after sufficient data points are added to the boundary region, the effectiveness of mitigating the boundary effect through a high density of interpolation points begins to diminish. The results of this study indicate that properly addressing boundary outliers can significantly enhance the accuracy of the predicted data and reduce the computational complexity and workload, to some extent. There is a threshold value for the number of outliers, and appropriate weights must be applied when determining the optimal truncation level. This approach not only enhances the prediction accuracy of the model, but also effectively controls the boundary effect of the model while maintaining the credibility of the data, thereby achieving a balance between model construction and prediction accuracy. In this study, a comprehensive evaluation index formula was developed to determine the optimal truncation level, offering an alternative to commonly used methods such as the magnetic energy density, RMSE, and Chi-square information principles found in previous studies [14, 27]. This new approach provides a more intuitive and scientifically grounded tool for the evaluation of model performance when selecting the truncation degree of a model. As a limitation of this study, the model stability and outlier processing strategy require further optimization--particularly in the post-processing of outliers using the moving average approach. The selection of surrounding points plays a critical role in determining the accuracy of the re-predicted values. As such, future research can focus on enhancing model stability and refining the outlier processing strategy to achieve higher accuracy in local geomagnetic field modeling. This is expected to contribute to advancing the field of geomagnetic field modeling research. Conceptualization, L.Z. and H.L. ; methodology, L.Z. and H.L. ; validation, M.C. and B.Z. ; formal analysis, J.O. and B.Z. ; writing--review and editing, L.Z. and J.O. All authors have read and agreed to the published version of the manuscript.