Search code examples
matrixhidden-markov-models

Creating emission matrix for Hidden Markov Model


I'm using a Hidden Markov Model for gesture recognition. I have already created the transition matrix using data from a set of training data. I can't seem to find any sources for creating the emission matrix.

Could I create it like so?

B_ij = (# of transitions from state j to observation i)/(# of states j)

Note that I created the transition matrix in a similar way:

A_qs = (# transitions from state q to state s)/(# transitions from state q)

Solution

  • Yes, you are absolutely correct. To train the model from existing data, the emission probabilities for state j are set as (# times state j emitted symbol s) / (# times state j occurred).

    If however you have many potential symbols that could be emitted, and/or a limited amount of training data, it can often be a good idea to use pseudocounts so that no potentially valid emission probability is set to 0.