I have a hidden Markov model (HMM) with 3 hidden states and 2 discrete emission symbols. I know that the probability of transitioning from state 2 to state 3 is 0 (i.e. there is no direct link from S2 to S3). What is the best way of fitting the parameters (implementing the constraint) of this model given an observed sequence of symbols?
Can this be done in python's hmmlearn?
This turned out to be quite easy in hmmlearn. Below is a code example that illustrates the approach.
Complete code example can be found in https://github.com/jonnor/machinehearing/blob/d557001e697f01ac5d7498e5cad00363bd8205a2/handson/constrained-hmm/ConstrainedHMM.ipynb