With the rapid development of the Internet of Things (IoT), Indoor Positioning System (IPS) has attracted significant interest in academic research. Ultra-Wideband (UWB) is an emerging technology that can be employed for IPS as it offers centimetre-level accuracy. However, the UWB system still faces several technical challenges in practice, one of which is Non-Line-of-Sight (NLoS) signal propagation. Several machine learning approaches have been applied for the NLoS component identification. However, when the data contains a very small amount of NLoS components it becomes very difficult for existing algorithms to classify them. This paper focuses on employing an anomaly detection approach based on Gaussian Distribution (GD) and Generalized Gaussian Distribution (GGD) algorithms to detect and identify the NLoS components. The simulation results indicate that the proposed approach can provide a robust NLoS component identification which improves the NLoS signal classification accuracy which results in significant improvement in the UWB positioning system.