Similarity measure for anomaly detection and comparing human behaviors