# A Hybrid Marker-Based Indoor Positioning System for Pedestrian Tracking in Subway Stations
## 3 The Proposed HMIPS
### Positioning Algorithm  
The proposed HIMPS uses the method devised in our previous work, extended Viterbi tracking using the hidden Markov model (HMM) [38] and a study [39] which corrects errors when using PDR. An HMM modeling for marker-based indoor localization, the hidden states \(HS=<hs_{1},hs_{2},\ldots,hs_{k}>\) represent possible location cells in the divided area, which is constrained by the indoor map layout. The marker online measurements of a user trace are treated as an emitted observation sequence from the hidden states. A HMM modeling can be described with five elements \(\lambda=<L,O,\pi,A,B>\), which include two state sets: location-state space \(L\), and observation state space \(O\), and three probability matrices: initial probability distribution \(\pi\), transition probability \(A\), and a set of emission probabilities \(B\), respectively. (Note that, in the positioning methods using the signal distribution, these signal distributions are learned, and the probability is calculated, but the emission probability \(B\) in the HIMPS is 1 because we use markers.) We assume that all states \(l_{k}\) can be a starting point, which describes the initial probability distribution \(\pi\). Theoretically, \(\pi\) was set equally in our model to provide initial information at each point. However, as with the emission probability \(B\), the initial location is also started with a marker, which is different from the general calculation method for predicting the initial location from the probability distribution. The transition probability \(A\) shows how a user moves between any two hidden states in a space. Because a pedestrian can only walk at one interval in a limited way, they cannot move too far from the previous state or move through walls or any other barriers. As discussed in [38; 40], gyroscope data are used for estimating the user moving direction, and an accelerometer is used for detecting the user's steps. The current state \(s\) can be calculated using the emission probability \(B\) at \(t-1\), the conditional probability of the moving direction, and the moving distance. The indoor layout and human mobility setting can be used to calculate the transition probability \(A\) as prior information. As a result, pedestrians can move from a previous location only to their nearby locations in the time interval of two successive observations. The model parameter \(\Theta=<\pi,A,B>\) is set from the marker-based location estimation and transition probability calculation. These calculations allow us to perform user tracking. In our study, tracking using the Viterbi algorithm is to find the optimal hidden state sequence \(HS^{*}=<hs_{1}^{*},hs_{2}^{*},...,hs_{k}^{*}>\). The aforementioned model parameter \(\Theta\) and observation vector \(O\) are given, and the most likely state sequence, that is, the Viterbi path \(HS^{*}\), can be derived as:  
\[HS^{*}=\operatorname*{argmax}_{HS}P(HS,O|\Theta) \tag{4}\]  
When inducing \(HS^{*}\), transition probability A uses data from inertial sensors, which is a value that includes errors due to bias and fluctuation. The factors that are user-specific and depend on the tracking environment that cause sensor reading errors are very diverse. That is why it is not easy to accurately identify and apply the reliability of each sensor. Therefore, these environmental factors are generally ignored, and it is common to optimize the probabilistic model or set the reliability of the sensors to the nearest optimal solution. In our previous work [39], an error correction method was proposed and studied to solve this problem. In the HIMPS, the error correction method of this study was used to compensate for the error of the inertial sensor to enable more accurate user tracking.