A common anomaly detection algorithm for hyperspectral imagery is the RX algorithm based on the Mahalanobis distance of each pixel from the image mean. This is a benchmark algorithm which can be applied either directly on a hyperspectral image or on a dimensionality-reduced hyperspectral image. Recent work on Non-Negative Matrix Factorization (NNMF) provides a fast-iterative algorithm for decomposing a hyperspectral cube and achieving dimensionality reduction. In this paper, we study the implementation of the NNMF algorithm on a hyperspectral data cube and propose two new anomaly detection algorithms, based on combining the NNMF and the RX algorithms. In the first version, we apply the NNMF algorithm on a hyperspectral image reducing the dimensionality; we then apply the RX algorithm. In the second version, we segment and cluster the dataset after applying the NNMF algorithm. Anomaly detection is then performed on this dataset. Using either of these algorithms overcomes a weakness of the RX algorithm in handling background clusters which are close to each other. The algorithm was tested on the RIT blind test dataset. From our results, we conclude that the two versions of the algorithm are sensitive to different types of anomalies; a two-dimensional scatterplot of the data comparing the RX values to either of the NNMF algorithms enables us to distinguish between the anomaly types. The ground truth shows that we have achieved high accuracy and less false alarms.