Sequential anomaly detection based on temporal-difference learning: Principles, models and case studies