commiting discrete hidden markov model