NOTE: SOME BUGS WERE FOUND IN THIS PART OF THE HOMEWORK. See bugs.
Thanks to Jose for helping to prepare this. This homework will give you some experience training simple HMMs, using the software provided by Anders Krogh. The files needed are in the directory /cse/guests/krogh/book/ahmm/dice on the barnyard machines. Copy the following files from the above directory: dice.ini, dice.imod, 300random_rolls.seq, README, and random_rolls.awk to your home directory, or the directory you my have for this class. Also read the TRAINAHMM part of the AHMM.documentaion found in /cse/guests/krogh/book/ahmm/AHMM.documentaion .
Notice that there is no dice.mod file, as in homework4.part2. We will train an HMM, which will produce the dice.mod file. The file AHMM.documentaion explains how decodeahmm, testahmm, and trainahmm work. Recall that these three programs are located in the directory /cse/guests/krogh/book/ahmm/bin/OSF1. You may want to add this directory to your UNIX path; otherwise you have to type all this every time you run one of the programs.
To train an HMM use the command "trainahmm dice" (or prepend /cse/guests/krogh/book/ahmm/bin/OSF1 if you didn't add this to your UNIX path.) You must be on one of the barnyard machines, since these programs are complied for the DEC alpha (otherwise you need to look in one of the alternate directories in /cse/guests/krogh/book/ahmm/bin to find the executable version for your machine.)
As described in the AHMM.documentaion file the trainahmm program will use the dice.imod file and dice.ini file to produce a dice.mod file. Try it, and compare the dice.mod file produced to the dice.imod file.
fair: 0.99 loaded: 0.01;Note that all other transitions for other states must be blank. Now retrain the dice model. repeat this experiment two more times, using (0.5, 0.5) and (0.01, 0.99) as values for these transitions, resp. What happens to the dice.mod file after retraining, anything strange or unexpected?
gawk -f random_rolls.awk > 5000random_rolls.seqThis will produce the file 5000random_rolls.seq. Also open the dice.ini file and replace the obsfile 300random_rolls.seq with 5000random_rolls.seq. Now retrain the dice model and compare the estimated probabilities to those obtained using only 300 random rolls. Use the starting probabilities of 0.5 and 0.5 from the previous part of the homework. Say how the models differ, if they differ significantly at all.