This is an implementation of Hidden Markov Models, with the following algorithms:
- forward algorithm for evaluationg the probability of a HMM
- Viterbi algorithm for decoding sequence of states a model went through
- Baum-Welch algorithm for training a HMM
To test the algorithms, run:
-
runtests.m
- tests algorithms 1 and 2, generates HMM models, uses one of them to generate observations, then computes probability that they were generated by each model; outputs and plots results -
baum_welch_test_mine.m
- tests algorithm 3, uses some random parameters to generate a model, and a set of observations, trains the model and outputs its parameters and a plot of its relative performance after training