# Regional Geomagnetic Field Modeling Based on Associated Legendre Polynomials
## 3 Data and Modeling Results
### Model Accuracy Evaluation Analysis  
To evaluate the superiority of the R\(-\)ALPOLM in regional geomagnetic field modeling, comparative experiments were conducted against the Taylor polynomial model (TPM) and the Legendre polynomial model (LPM). These models are based on Taylor polynomials and traditional Legendre polynomials, respectively. The Taylor polynomial is a widely used mathematical tool that provides local approximations of functions around a specific point. In the context of geomagnetic field modeling, it can also be employed to approximate variations in geomagnetic elements. For a given geomagnetic element \(B\), the center point of the modeled region is selected as the expansion point of the Taylor polynomial. The normalized latitude and longitude coordinates of the center point are denoted by \(\Delta\varphi_{0}\) and \(\Delta\lambda_{0}\), \(A\) denotes the matrix of model coefficients, and the modeling formula is expressed as in Equation (11) [25; 26]:  
\[B=\sum_{n=0}^{N}\sum_{j=0}^{n}A_{nj}(\Delta\varphi-\Delta\varphi_{0})^{j}( \Delta\lambda-\Delta\lambda_{0})^{n-j} \tag{11}\]  
The direct solution formula for the traditional Legendre polynomials is shown in Equation (12):  
\[P_{n}(x)=\frac{1}{2^{n}}\sum_{m=0}^{[n/2]}\frac{(-1)^{m}(2n-2m)!}{m!(n-m)!(n-2 m)!}x^{n-2m} \tag{12}\]  
In Equation (12), \([n/2]\) represents the integer part of \(n/2\), where \(n\) is the degree of the Legendre polynomial, and \(m\) denotes the order of the summation terms. The fundamental model equations used for both Legendre polynomials and associated Legendre polynomials are identical, with the key difference lying in the polynomial \(P_{n}(x)\). By substituting Equation (12) into Equation (3), the subsequent methods and steps for solving the coefficient matrix remain the same. The experimental data originated from the training dataset described in Section 3.2, and the results illustrated in Figure 4 were obtained by comparing the training accuracy and runtime of the three models at different truncation levels. As illustrated in Figure 4a, the RMSE of the LPM and the R\(-\)ALPOLM proposed in this study decreased rapidly as the truncation level increased, where the RMSE value of the R\(-\)ALPOLM was slightly lower than that of the LPM. However, the LPM encounters a singular value problem at the 85 th degree; thus, it is incapable of further execution. Conversely, the proposed model demonstrated stable performance, operating successfully up to the 116 th degree before encountering the singular value issue. The RMSE value of the TPM was substantially higher than those for the other two models, showing a sharp increase after descending to the 42 th degree and exhibiting greater fluctuations after the 42 th degree. Figure 4b illustrates the runtime performance of the three models. The runtime of all models increased as the truncation level increased. The overall runtimes of the TPM and R\(-\)ALPOLM were comparable, whereas the LPM exhibited a significantly higher runtime than the other two models. Notably, the singular value problem occurred at the 43 rd degree for the TPM, which explains the sharp increase in the RMSE value after the 42 nd degree. The appearance of the singular value solution in the TPM runtime indicates that it does not  
have significant reference value. Considering its higher-degree fitting ability and runtime efficiency, the proposed R\(-\)ALPOLM exhibited a clear advantage. Figure 5 shows the variations in RMSE and the number of outliers for TPM and LPM at different degrees. As illustrated in Figure 5a, the LPM and R\(-\)ALPOLM exhibited similar results when the truncation level increased, with their RMSE values decreasing while the number of outliers gradually increased. At a truncation level of 85, the RMSE reached a minimum of 0.59 nT, whereas the number of outliers increased to a maximum of 97. To evaluate the combined impact of the RMSE and number of outliers on the overall model performance, the comprehensive evaluation index (defined in Equation (9)) was applied.