## 5 Cause of Scan Failure/Delay Estimation  
In order to estimate the cause of scan response failure/delay, our proposed MM-LDA calculates the discriminant score (\(D_{s}\)) for each terminal connected to a base station, access point, etc., and based on the result of the calculated \(D_{s}\), the normal scan situation is determined if the \(D_{s}\) is positive or equal to 0 (i.e., \(D_{s}\geq 0\)), and the abnormal scan situation is determined if \(D_{s}<0\).  
To judge each failure factor for all terminals connected to a base station, access points, etc., the number of terminals \(D_{count}\) with an abnormal value (i.e., \(D_{s}<0\)) are counted. If \(0<D_{count}<(N_{terminals}*D_{thres})\), then the failure factor of the terminals with the abnormal value is judged as SNR insufficient. \(N_{terminals}\) is the total number of terminals connected to a base station/access point, while \(D_{thres}\) (\(D_{thres}\) is a real number with the range of 0-1) is the cutoff threshold between insufficient communication quality and network congestion. Onthe other hand, if \(D_{count}\geq(N_{terminals}*D_{thres})\), the failure factor for all terminals connected is judged as NW congestion. All terminals are judged as normal when \(D_{count}\) = 0.  
Thereafter, the next step is to determine whether there is a scan response result for each terminal that does not fall under either SNR insufficient or NW congestion. In such a situation, if there is no response at all ports of the terminal, it is determined as no network connection for the terminals, while for terminals that have a response from any port, the ports with no response are judged as port blocking. The complete estimation process is summarized as follows.  
1. Extract the scan response RTT and other features from the scan response results of each scenario.
2. Calculate the correlation of several features in each scenario.
3. Similarly, calculate the multiple linear regression and determine if the features are significant and should be selected as correlated features or uncorrelated features.
4. Apply the RFE algorithm on the selected features and ranked features based on their importance to the factor cause estimation, as in Algorithm 1.
5. Combine the scan response RTT data and the top ranked feature.
6. Normalize missing data by replacing them with a constant negative value in the range of [\(-999\), \(-1\)], etc. This is to prevent bias influence on the cause estimation result.
7. Create a training dataset, which is used to build estimation models using MM-LDA. Divide the training data into three datasets and build three models.
8. For each terminal connected to a base station, access points, etc., using a one-to-many model, pass the scan response RTT samples into the first model, and the discriminant score \(D_{s}\) is calculated. If the \(D_{s}\) is positive or equal to 0 (i.e., \(D_{s}\geq 0\)), a normal scan situation is determined, and the second model is selected. Otherwise (i.e., \(D_{s}<0\)), an abnormal scan situation is determined, and the third model is selected. Calculate \(D_{s}\) for each terminal and judge the cause of scan failure/delay based on the result of the selected model.
9. Count the number of terminal (\(D_{count}\)) with \(D_{s}<0\). If \(0<D_{count}<(N_{terminals}*D_{thres})\), then the terminal with the abnormal value is estimated as SNR insufficient. If \(D_{count}\geq(N_{terminals}*D_{thres})\), then all terminals are estimated as NW congestion. All terminals are estimated as normal when \(D_{count}=0\).
10. For each terminal that is not estimated as SNR insufficient communication quality or NW congestion, check if there is no response from all ports. If there is no response at all ports of the terminal, the cause for the terminal is estimated as no network connection. Otherwise, the terminal is judged as normal, and the cause for the ports of the terminal with no response are estimated as port blocking.