## 2 Algorithm
### The Procedure of PLGAIM  
The reliability of the positioning algorithm to obtain the rover coordinates is greatly affected by multipath and ambiguity resolution. Therefore, this paper focuses on studying the reliability of positioning results. Integrity monitoring mainly includes two aspects: fault detection and alert and availability of the RAIM algorithm. The main idea is to detect and excludefaultsbased on the consistency between redundant observations [37; 38]. The construction of test statistics is one of the key factors, consequently. Considering the actual situation of our indoor pseudolite positioning system, the steps of PLGAIM are as follows:  
(a) Obtain data of rover and base station and ensure there are more than three common visible pseudolites in order for the horizontal positioning to be performed;  
(b) Judge fault on reference pseudolite (rpl). After the reference pseudolite is determined by the elevation angle, the priori residuals of DD pseudorange observations can be calculated. If the residuals of all DD observations perform largely, it can be considered that the reference pseudolite is faulty and it should be replaced by another one;  
(c) When the number of common pseudolites meets requirements and reference pseudolite is normal, parameter estimation and ambiguity resolution will be performed. The classical LAMBDA method is used for ambiguity resolution (AR) [39; 40];  
(d) Judge the availability of RAIM. Compare HPL calculated by the probability of missed detection (\(P_{md}\)) with HAL. We set \(P_{md}=1\times 10^{-3}\)[21]. As to HAL, it is only used to set a maximum error range for comparison with HPL. Referring to GNSS positioning, the accuracy of high-precision positioning needs at least a centimeter-level. Therefore, in high-precision indoor pseudolite positioning, the positioning accuracy with centimeter-level would be reliable and available. The HAL of indoor pseudolite high-precision positioning is set to 0.1m;  
(e) Fault detection of pseudolite positioning system. Construct the test statistic \(T\) and compare it with threshold \(T_{h}\) determined from the probability of false alert (\(P_{fa}\)). We set \(P_{fa}=3.33\times 10^{-9}\)[21]. If \(T\) is larger than the threshold, the pseudolite may be faulty;(f) Fault exclusion. The most intuitive method is to remove pseudolites in turn and compare the test statistic. Then exclude this pseudolite or delete corresponding epochs when a fault occurs;  
(g) Positioning. After the above steps, the reliability of results is effectively improved. The flow chart follows,  
In Figure 1, HPL is calculated before fault detection. If HPL is greater than HAL, the current observation condition (pseudolite constellation) would not be good enough and the unavailable situation of the system shown in Figure 2 may appear. In Figure 2b, HMI means hazardously misleading information and MI means misleading information. There are two important concepts in fault detection, false alert (FA) and missed detection (MD). \(P_{\mu}\) refers to the probability of the fault detected by the system and alerts on the condition that the pseudolite is not faulty or HPE is less than HPL. FA occurs when the navigation is normal in Figure 2. \(P_{md}\) is the probability that the system fails to detect it while in fact, the fault happens and HPE is greater than HPL. The MD shown as MI and HMI in Figure 2 mainly occurs when the navigation is not normal. HPL guarantees that \(P_{md}\) will not exceed demand under the current pseudolite constellation and the threshold ensures that there is no FA in fault detection.  
The determination of HPL and test statistic threshold will be presented in the next section in conjunction with the pseudolite system. In summary, under the premise that RAIM availability is guaranteed (HPL\(<\)HAL), the following four situations in Figure 3 may occur during fault detection.  
Figure 1: The Procedure of PLAIM.  
Figure 2: (**a**) Events according to the Stanford Diagram, (**b**) Sketch Map of MI and HMI.