# A Novel Method of Adaptive Kalman Filter for Heading Estimation Based on an Autoregressive Model
## 8 Conclusions  
A novel method of heading estimation based on smartphones is proposed in this paper. This method uses the AR model to build KF, and the current heading--determined by fusing these headings calculated by magnetometer, estimated by gyroscope and stored by the previous estimate--is used as measurement value of KF update. To effectively suppress the accumulated error of the heading estimated by the outputs of the gyroscope, the estimated heading by KF in QS is used to correct the heading calculated by gyroscope. To improve the accuracy of heading estimation, an AKF based on the innovation sequence is used to adaptively adjust the state noise covariance. HV9 and XM8 smartphones were used to collect data. In order to intuitively and precisely express the accuracy of heading estimation, the estimated heading is also used for the position estimation of PDR. The following conclusions were obtained,  
1. The heading calculated by a magnetometer is susceptible to disturbances in the complex indoor environment that can cause dozens of degrees bias. Also, it is possible that the heading calculated  
Figure 10: Position cumulative error percentages of different methods for different smartphones: (**a**) The error percentage for HV9; (**b**) The error percentage for XM8.  
\begin{table}
\begin{tabular}{c c c c c c} \hline \hline  & & **Gyr-UKF** & **MGP-UKF** & **Pro-UKF** & **ProA-UKF** \\ \hline \multirow{3}{*}{HV9} & Max/m & 5.80 & 5.63 & 2.75 & 2.73 \\  & Mean/m & 2.67 & 2.65 & 1.60 & 1.59 \\  & RMS/m & 3.14 & 3.10 & 1.75 & 1.74 \\ \hline \multirow{3}{*}{XM8} & Max/m & 5.05 & 4.69 & 2.89 & 1.63 \\  & Mean/m & 2.47 & 2.38 & 1.81 & 0.80 \\ \cline{1-1}  & RMS/m & 2.73 & 2.62 & 1.94 & 0.87 \\ \hline \hline \end{tabular}
\end{table}
Table 3: Statistics of position error with different method for different smartphone.  
by magnetometer is close to the reference at some locations. The heading estimated by gyroscope is affected by cumulative error. The heading obtained by the proposed method can not only reduce the noise but also constraint the cumulative error.
2. Compared with the mean accuracy of traditional methods for heading estimation, the mean accuracy of the heading estimated by proposed algorithm is increased by 35.62% and 35.86%, respectively, for HV9 and XM8. And compared with KF, AKF can further improve the accuracy of heading estimation.
3. The estimated heading is used for position calculation of PDR. Compared to traditional methods, the mean errors of position estimation for the proposed method decrease by 40.00% and 66.39%, and the corresponding RMS is improved by 43.87% and 66.79%, respectively, for HV9 and XM8 smartphones with different performance sensors.  
[PERSON] proposed the research ideas and technical lines. [PERSON] and [PERSON] provided research guidance. [PERSON] wrote the paper and [PERSON] corrected this paper.  
This work was supported by the national Key Research and Development Program of China under grant 2016 YFB0502105, a project Funded by the Science Foundation of Jiangsu Province under grant bk20161181 and the National Natural Science Foundation of China under grant 41371423.  
The authors declare no conflict of interest.