Model used in anomaly detection

Please check this question. it will clarify most of all your question.