Detecting anomalies using density estimation