What Does A Dynamic Programming Table For An Hmm Look Like?
2
0
Entering edit mode
10.8 years ago
corn8bit ▴ 140

I've been learning about how HMMs (hidden markov models) are used for finding sequencing errors, and to discover the hidden data we use a dynamic programming table, which when used together is this algorithm.

I'm having a really hard time figuring how how the dynamic programming works for this though. Could someone give an explanation that uses simple English (relatively) to describe the table?

Or less vaguely: How can dynamic programming solve an HMM?

statistics • 5.0k views
ADD COMMENT
0
Entering edit mode
ADD REPLY
1
Entering edit mode
10.8 years ago
corn8bit ▴ 140

The dynamic programming table only has 2 rows. I finally figured out what it looked like thanks to this fantastic example on wikipedia here (don't read the code). The gif towards the end is a perfect depiction of the table.

The way it looks is actually very simple and can be summed up at this: For each state (such as ill or healthy in the linked example) you only care about which previous state is the most probable. If you're picking a state that isn't the same as your current state then you have to multiply it by the odds of changing state.

For a quick example imaging you know all the probabilities for how feeling "dizzy, cold, and good" all map to "healthy or sick". Then a patient comes in one day as good, and the next as dizzy. The table would first look at the first day and fill in the probability for both the "healthy" row, and the "sick" row. The healthy row would have a much higher probability. Then the table would go to the next day and fill in each row.

For the healthy row the table would say to itself "hm, on the previous day healthy was much more likely than sick, and if I pick sick I have to further reduce the odds by multiplying by the the odds of transitioning, so I'll pick healthy". And for the sick row it would say "well, the odds of healthy yesterday outweigh the odds of sick, even after I multiply it by the transitioning odds, so I'll pick that.".

And That's all there is to it! Here's what that would look like in table form:

Healthy row: [day1: high chance of healthy because patient felt good], [day2: patient felt dizzy, low chance of healthy. Previous day was probably healthy, and no transition was made]

Sick row: [day1: low chance of sick, because patient felt good], [day2: high chance of sick, previous day was probably healthy, even though we have to factor in odds of transitioning]

And so the most probable case is healthy day1, sick day2.

ADD COMMENT
0
Entering edit mode
10.8 years ago
Woa ★ 2.9k

In HMM the dynamic programming is used to find out an optimum path out of many other combinatorial paths possible comprised of 'state' paths. You can see the Durbin & Eddy's book (and its solution manual http://www.amazon.com/Problems-Solutions-Biological-Sequence-Analysis/dp/0521612306/) for many worked out problems. Particularly see the Viterbi algorithm

ADD COMMENT

Login before adding your answer.

Traffic: 1854 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6