Here is a sample source code to examine for how to implement hmm algorithms using numpy operations. http://www.cs.toronto.edu/~rfm/code/hmm.py