<p><em>[Comments from other post migrated as answer]</em></p>
<p>The parenthetical statement in the first bullet point says <strong>without corrections</strong>. In which case, if an unseen nucleotide has a probability of zero, the probability of the sequence is zero. If the unseen nucleotides had the probability of NaN, then the sequence has a probability of NaN, which is a more thorough solution.</p>
<p>The correction would be adding a small iota value to the probabilities to be non zero —<strong>fudging</strong> against the zero outcome you otherwise find, which may be the result of the training being too small. You have 5 training sequences, so the iota would be &lt;1/5. Let's hypothetically assume that if you were to have picked a 6th MSA sequence it would have had the missing value, so you could set the iota at 1/6. The assumption that you may find that element were you to sample twice as many is more statistically sensible, so iota to 1/10.</p>
<p>I used the letter iota, which is common parlance for something small, but iota is a really bad in maths as it looks like a 1 with English handwriting or in print: you can call the fudge value anything.</p>

CC BY-SA 4.0
2021-09-21T12:23:40.867Z
2021-09-29T04:46:48.247Z
2021-09-29T04:46:48.247Z
Matteo Ferla
<p>I encountered this question in a textbook (source: <a href="https://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.721.2540&amp;rep=rep1&amp;type=pdf" rel="nofollow noreferrer">https://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.721.2540&amp;rep=rep1&amp;type=pdf</a>) and was trying to workout the solution for it. Was wondering for the last question, wouldn't the probability be 0?</p>
<p><a href="https://i.sstatic.net/WaTVy.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/WaTVy.png" alt="Question" /></a></p>
<p>My working:</p>
<p>START -&gt; M1 -&gt; M2 -&gt; M3 -&gt; M4 -&gt; M5 -&gt; M6 -&gt; M7 -&gt; END</p>
<p>Probability Vector [A, T, C, G]</p>
<p>M1 : [0.6, 0.4, 0, 0]</p>
<p>M2 : [0.6, 0.4, 0, 0]</p>
<p>M3 : [0.4, 0.4, 0.2, 0]</p>
<p>M4 : [0.6, 0.4, 0, 0]</p>
<p>M5 : [0.4, 0.6, 0, 0]</p>
<p>M6 : [1, 0, 0, 0]</p>
<p>M7 : [0, 0, 0, 1]</p>
<p>To generate CTAAAAG = 0 * 0.4 * 0.4 * 0.6 * 0.4 * 1 * 1 = 0</p>

<homework><hidden-markov-models><multiple-sequence-alignment>
Generating sequences from HMM
# Generating sequences from HMM

(Asked by: username_0 on 2021-09-19)

I encountered this question in a textbook (source: <https://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.721.2540&rep=rep1&type=pdf>) and was trying to workout the solution for it. Was wondering for the last question, wouldn't the probability be 0?

[![Question](https://i.sstatic.net/WaTVy.png)](https://i.sstatic.net/WaTVy.png)

My working:

START -> M1 -> M2 -> M3 -> M4 -> M5 -> M6 -> M7 -> END

Probability Vector [A, T, C, G]

M1 : [0.6, 0.4, 0, 0]

M2 : [0.6, 0.4, 0, 0]

M3 : [0.4, 0.4, 0.2, 0]

M4 : [0.6, 0.4, 0, 0]

M5 : [0.4, 0.6, 0, 0]

M6 : [1, 0, 0, 0]

M7 : [0, 0, 0, 1]

To generate CTAAAAG = 0 \* 0.4 \* 0.4 \* 0.6 \* 0.4 \* 1 \* 1 = 0

**Tags:** homework, hidden-markov-models, multiple-sequence-alignment

---

## 1 answers

### Answer by username_1 on 2021-09-21. Score: 1 | Accepted answer

*[Comments from other post migrated as answer]*

The parenthetical statement in the first bullet point says **without corrections**. In which case, if an unseen nucleotide has a probability of zero, the probability of the sequence is zero. If the unseen nucleotides had the probability of NaN, then the sequence has a probability of NaN, which is a more thorough solution.

The correction would be adding a small iota value to the probabilities to be non zero —**fudging** against the zero outcome you otherwise find, which may be the result of the training being too small. You have 5 training sequences, so the iota would be <1/5. Let's hypothetically assume that if you were to have picked a 6th MSA sequence it would have had the missing value, so you could set the iota at 1/6. The assumption that you may find that element were you to sample twice as many is more statistically sensible, so iota to 1/10.

I used the letter iota, which is common parlance for something small, but iota is a really bad in maths as it looks like a 1 with English handwriting or in print: you can call the fudge value anything.


---

