Docsity

Homework Assignment on Hidden Markov Models, Assignments of Computer Science

Toggle sidebar
bg1
Homework 3
Due: Wednesday, Nov 12, 7:00pm
Note: for problems 2-4, turn in your source code and output in hard copies, but also email
me your source code and output in pure text, with a simple README file explaining how to
compile and run your programs. Make your programs as simple as possible. For simplicity,
you can hard-code the HMM structure and parameters in your programs.
Problem 1: Probabilities (15 points)
Consider the hidden Markov model below with the given transition and emission probabilities.
a b
A: 0.4
C: 0.1
G: 0.1
T: 0.4
A: 0.1
C: 0.4
G: 0.4
T: 0.1
0.999 0.001
0.99
0.01
start
0.5 0.5
(1) Let a sequence S=AT C , and a state path π=aab. Compute the joint probability P(π, S ).
(2) Compute the most probable state path (π∗) for S, and the joint probability P(π∗, S ).
(3) Compute P(S), i.e., the probability of the sequence given the hidden Markov model.
Hint: Although you may use the Viterbi and Forward algorithms to answer the last two questions, it is
not absolutely necessary given the small size of the sequence.
Problem 2: Viterbi decoding (20 points)
Implment the Viterbi decoding algorithm for the HMM shown above. Apply your algorithm to the sequence
file seq1.txt and print out the ranges of nucleotides generated by state b (the first nuleotide has an index 1).
Problem 3: Viterbi training (20 points)
Assume a sequence was generated by a HMM model that has the same structure as the one above, but
with possibly different parameters. Implment the Viterbi training algorithm and apply it to the sequence in
seq2.txt to learn the mo del parameters. You may need to run your program multiple times to get the best
results. Use the HMM model with the learned parameters to decode the sequence and output the ranges of
nucleotides generated by state b.
Problem 4 (Optional): Baum-Welch training (20 points)
Implement the Baum-Welch algorithm and apply it to problem 3.
Bonus (5 points)
How much time did you spent? Who did you discuss with and what was the discussion about? Any comments
about the course and homeworks? What topics would you like to learn more about? What topics you didn’t
like?
1

Partial preview of the text

Download Homework Assignment on Hidden Markov Models and more Assignments Computer Science in PDF only on Docsity!

Homework 3

Due: Wednesday, Nov 12, 7:00pm

Note: for problems 2-4, turn in your source code and output in hard copies, but also email me your source code and output in pure text, with a simple README file explaining how to compile and run your programs. Make your programs as simple as possible. For simplicity, you can hard-code the HMM structure and parameters in your programs.

Problem 1: Probabilities (15 points)

Consider the hidden Markov model below with the given transition and emission probabilities.

a b A: 0. C: 0. G: 0. T: 0.

A: 0. C: 0. G: 0. T: 0.

0.999 0.

start 0.5 0.

(1) Let a sequence S = AT C, and a state path π = aab. Compute the joint probability P (π, S).

(2) Compute the most probable state path (π∗) for S, and the joint probability P (π∗, S).

(3) Compute P (S), i.e., the probability of the sequence given the hidden Markov model.

Hint: Although you may use the Viterbi and Forward algorithms to answer the last two questions, it is not absolutely necessary given the small size of the sequence.

Problem 2: Viterbi decoding (20 points)

Implment the Viterbi decoding algorithm for the HMM shown above. Apply your algorithm to the sequence file seq1.txt and print out the ranges of nucleotides generated by state b (the first nuleotide has an index 1).

Problem 3: Viterbi training (20 points)

Assume a sequence was generated by a HMM model that has the same structure as the one above, but with possibly different parameters. Implment the Viterbi training algorithm and apply it to the sequence in seq2.txt to learn the model parameters. You may need to run your program multiple times to get the best results. Use the HMM model with the learned parameters to decode the sequence and output the ranges of nucleotides generated by state b.

Problem 4 (Optional): Baum-Welch training (20 points)

Implement the Baum-Welch algorithm and apply it to problem 3.

Bonus (5 points)

How much time did you spent? Who did you discuss with and what was the discussion about? Any comments about the course and homeworks? What topics would you like to learn more about? What topics you didn’t like?