Hidden Markov models for fault detection in dynamic systems