# A Novel Method of Adaptive Kalman Filter for Heading Estimation Based on an Autoregressive Model
## 7 Experimental Analysis
### Kinematic Experiment  
The kinematic data were used to further verify the effectiveness of the proposed algorithm. The site of data collection was on the third floor of the J9 office building of Shandong University of Science and Technology, and many iron materials were on site. The floor plan is shown in Figure 3. The tester held the HV9 and XM8 smartphones in their hand to collect data along the preplanned trajectory. Figure 3: Trajectory of experiment: (**a**) Floor plan; (**b**) Experimental environment. Figure 2: Heading error of static data for different methods: (**a**) The heading error of Huawei Honor V9 (HV9); (**b**) The heading error of XiaoMi8 (XM8). Figure 4 shows the calculated heading that used the data collected by the HV9 and XM8, and true north was used to largely avoid the heading jumps between 0 and 360. Five methods were used for heading estimation in these kinematic experiments. The first was Mag, the second was Gyr, the third was proposed in [22] that the current heading was determined by magnetometer, gyroscope and previous estimate (MGP), the fourth was Pro that is the proposed method in this paper without the adaptive filter, and the last was ProA that the adaptive filter is used in Pro. And the reference is the reference heading in Figure 4. Compared to the other four methods, the heading based on the magnetometer severely jumped for these smartphones, and the maximum jump achieved 30 degrees, although the heading calculated by magnetic field was close to the reference at some locations. Thus, it is not appropriate to obtain the heading just using the outputs of the magnetometer for pedestrian navigation in complex indoor environments. Figure 5 shows the heading errors of the local trajectory marked in A, B, C, and D in Figure 4a, and Figure 6 shows the heading errors of the local trajectory of Figure 4b. The heading errors of Mag for HV9 and XM8 are not shown in Figures 5 and 6 because these errors fluctuate widely. However, these statistical results, of heading errors of these five methods for HV9 and XM8, are all shown in Tables 1 and 2, respectively. In Tables 1 and 2, the mean RMSs of heading error for Mag are 8.62\({}^{\circ}\) and 10.88\({}^{\circ}\) for HV9 and XM8, respectively, and these accuracies are not appropriate for pedestrian navigation. In Figure 5a, most heading errors of Pro and ProA are within 4\({}^{\circ}\), and these heading errors are smaller than those of Gyr and MGP. In Figure 5b-d, these heading errors of Pro and ProA are within 2\({}^{\circ}\), and these accuracies of heading estimation are better than those of Gyr and MGP. In Table 1, the RMS of MGP is slightly superior to that of Gyr, and the mean RMS decreases from 2.38\({}^{\circ}\) to 2.19\({}^{\circ}\). The accuracy of Pro is better than that of MGP in every section. The RMS decreases from 2.20\({}^{\circ}\) to 1.74\({}^{\circ}\) in the local trajectory of mark A, the RMS drops from 1.17\({}^{\circ}\) to 1.09\({}^{\circ}\) in the local trajectory of mark B, the RMS reduces from 3.01\({}^{\circ}\) to 1.26\({}^{\circ}\) in the local trajectory of mark C, and the RMS decreased from 2.38\({}^{\circ}\) to 1.55\({}^{\circ}\) in the local trajectory of mark D. And the mean accuracy increased by 35.62%. In Table 1, the accuracy of Pro is basically the same as that of ProA. We also can see from these lists of Mean in Table 1 that these results of heading estimation are bias. The first reason for this bias is that the tester cannot strictly walk in accordance with the preplanned trajectory, and the other is that the smartphone will inevitably shake with the movement of the tester. These conditions can cause the biased estimation. We can see from Table 1, the bias of Pro and ProA is smaller than that of the other methods. In summary, compared with the heading estimated by Mag, Gyr and MGP, the heading solved by the proposed algorithm is close to the reference for this experiment. Figure 4: Heading estimation with different methods for different smartphones: (**a**) Heading of HV9; (**b**) Heading of XM8.