hidden markov model over discrete space