Hidden Markov Models: The Baum-Welch Algorithm

Given an output sequence and a Hidden Markov Model, the Baum-Welch algorithm seeks to improve the given model to one that is could have more likely generated the given output sequence. It does so by using both the Forward Algorithm and the Backward Algorithm and using the output of these two algorithms to create two temporary variables which can then be used to improve the initial probabilities, the transition probabilities, and the emission probabilities.

To implement this algorithm, I'll use the example of a dice roller who claims to have fair die. Given a sequence of observations we will consider a few HMMs to see the probability that the sequence we observe was generated by certain types of loaded dice.

You will also /have the option of how many iterations to implement the Baum- Welch algorithm.