Non-parametric hidden markov model