# A Novel Method of Adaptive Kalman Filter for Heading Estimation Based on an Autoregressive Model
## 7 Experimental Analysis
### Kinematic Experiment
In order to accurately analyze the heading, the step-length error is ignored here. Figure 9 shows the 2D position error of each step using HV9 and XM8. Figure 9a shows the position error of HV9. When the method of Gyr-UKF and MGP-UKF is used, the position error gradually accumulates with the walking distance, and the maximum error exceeds 5.5 m. The estimated position of MGP-UKF is slightly better than that of Gyr-UKF. The position error is improved by the Pro-UKF, and the maximum error is less than 2.8 m. We can also see that the position error of ProA-UKF is slightly smaller than that of Pro-UKF. Figure 9b is the position error of XM8 for different methods. The position error deviates from the reference with time when the Gyr-UKF is used, and the maximum error is over 5.0 m. The position estimation is slightly improved when MGP-UKF is used. The position errors are effectively constrained when the proposed algorithm of Pro-UKF is used, and the maximum error is less than 3.0 m. The position errors are further improved if the adaptive algorithm is used to estimate the heading, and the maximum error is less than 2.0 m. In Figure 9b, the positions accuracy of Pro-UKF is worse than those of Gyr-UKF and MGP-UKF at times. We can see from Figure 6c that the heading error is mostly positive for Pro, that will make the error accumulate, and the heading errors have positive and negative values for Gyr and MGP that will offset the error accumulation. The corresponding position cumulative error estimation percentages (CEF) of Figure 9 is explained in Figure 10. In Figure 10a, the CEF within 1.5 m is 24.92% and 25.24% for Gyr-UKF and MGP-UKF, respectively, and the CEF is raised to 40.38% and 41.01% for Pro-UKF and ProA-UKF, respectively. The CEF within 2 m are 38.80% and 31.86% for Gyr-UKF and MGP-UKF, respectively. The CEF is increased to 68.45% for both Pro-UKF and ProA-UKF. When the CEF is about 75%, the position error is over 4 m for Gyr-UKF and MGP-UKF, and the position error is less than 2.25 m for Pro-UKF and ProA-UKF. For HV9, the proposed method can enhance the accuracy of position estimation. Figure 10b shows the CEF of XM8. In Figure 10b, the CEF within 1.5 m is just 20.79% for both Gyr-UKF and MGP-UKF, the CEF achieves 36.30% for Pro-UKF, and the CEF is, as expected, increased to 97.03% for ProA-UKF. When the position error is within 2 m, the CEF is 38.94% and 47.52% for Gyr-UKF and MGP-UKF, respectively, and the CEF is slight improved for Pro-UKF with 50.50%, however, the CEF is raised to 100% when the ProA-UKF is used. When the CEF is about 75%, the position errors are both over 3.25 m for Gyr-UKF and MGP-UKF, the error is within 2.50 m for Pro-UKF, and the error is less than 1.25 m for ProA-UKF. Therefore, we can obtain the conclusion that the proposed algorithm can improves the accuracy of heading estimation for smartphone. Figure 9: Position error of each step with different methods for different smartphones: (**a**) The position error of HV9; (**b**) The position error of XM8. Table 3 shows the statistics of position errors. In Table 3, the mean errors of position estimation for PDR are 2.67 m, 2.65 m, 1.60 m and 1.59 m for these four respective schemes of position estimation, and the corresponding RMS values are 3.14 m, 3.10 m, 1.75 m and 1.74 m for the HV9 smartphone. For the XM8 smartphone, the mean errors are 2.47 m, 2.38 m, 1.81 m and 0.80 m, and the RMS values are 2.73 m, 2.62 m, 1.94 m and 0.87 m for these four respective schemes. The estimated position by ProA-UKF, where the adaptive filter is used to estimate heading, is better than that by Pro-UKF, the position error of Pro-UKF is smaller than that of the traditional method and the position error of MGP-UKF is slightly superior to that of Gyr-UKF. Compared with the method of MGP, the mean error of ProA-UKF is reduced by 40.00%, and RMS is improved by 43.87% for the HV9. And the mean error is reduced by 66.39%, and the RMS is improved by 66.79% for the XM8.