# A Novel Method of Adaptive Kalman Filter for Heading Estimation Based on an Autoregressive Model
## 1 Introduction  
Location-based-services (LBSs) have developed rapidly in recent years, and their application brings great convenience to people's lives [1]. The core idea of LBSs is to determine a user's location quickly and effectively [2]. Outdoors, the global navigation satellite system (GNSS) provides accurate and reliable locations in open-sky environments, but it faces the challenges of signal blockage and invisibility in an indoor environment. With the development of indoor positioning technology, various positioning methods, based on WiFi [3], Bluetooth [4], ultra-wide band (UWB) [5], and inertial sensors [6], have been applied for personal navigation, emergency rescue, and tracking [7]. With the popularity of smartphones and the development of microelectromechanical system (MEMS), indoor positioning technology based on smartphones has found wide application in pedestrian navigation [8]. MEMS inertial sensors have become an appropriate choice for pedestrian navigation because they are small, low-cost, and completely autonomous [9]. Pedestrian navigation based on inertial measurement units (IMUs) can be divided into two categories [10]. One is the strap-down inertial navigation system (SINS) and the other is pedestrian dead reckoning (PDR) based on a human-motionmodel. SINS based on a three-axis accelerometer and three-axis gyroscope can provide high-frequency three-dimensional positions, velocities, and attitudes. Good results were obtained from the use of the error of velocity to establish an observation equation for personal navigation [11]. [PERSON] et al. [12] applied SINS for a foot-mounted inertial pedestrian navigation system (PNS), with 0.3% accuracy of location estimation for walking distance. However, these methods require extra MEMS sensors, which are not suitable for LBSs based on a smartphone's built-in sensors. [PERSON] et al. [13] applied SINS for PNS using the error of velocity from SINS and step estimation as the observation, and considering zero-velocity update technology (ZUPT) and zero-angular rate update (ZARU) as constraints. The experiment showed that the accuracy of navigation parameters was greatly improved. [PERSON] et al. [10] used the velocity, position, pseudo-velocity, and pseudo-position as observations, and a tri-axial accelerometer and tri-axial magnetometer of the quasi-state (QS) were introduced into observations for SINS. The accuracy of position was greatly improved compared to the previously mentioned experiment. However, the error of navigation parameters solved by SINS gradually accumulates because of the integral. Estimation of the user's position by PDR can be divided into four procedures: Step detection, step-length estimation, heading estimation, and position calculation [14]. Common methods of step detection include peak detection, cross-zero, autocorrelation algorithm and dynamic time warp [15; 16]. The peak-detection algorithm is relatively optimal for step detection. Both linear and nonlinear models can be used for step-length estimation to estimate the moving distance of pedestrians [17; 18]. In general, an accurate heading is the key to estimating the position of PDR, and some methods have been used to obtain the heading [19]. [PERSON] et al. [20] estimated the heading by magnetometer, and analyzed the influence of various environments on magnetic field strength. [PERSON] et al. [21] used the raw output of a gyroscope to update the heading by quaternion, and the position gradually deviated from the reference trajectory with time. [PERSON] et al. [22] fused these headings calculated by the outputs of a magnetometer and gyroscope, and stored by the previous estimate, to determine the current heading, which was better than the heading calculated by a single sensor. [PERSON] et al. [23] used the quaternion of accelerations, magnetic field strength, and the outputs of a gyroscope to build a linear Kalman filter (KF) for heading estimation. [PERSON] et al.