e) suppose, you generate O={o1,o2,...,o200} as
> O
[1] 3 1 5 6 1 2 6 2 6 3 1 2 4 6 6 5 4 1 1 2 5 3 1 1 5 2 3 4 3 3 3 1 1 4 4 5 4
[38] 4 4 4 5 5 5 2 4 5 3 2 6 3 1 5 6 4 1 1 4 3 1 6 3 4 2 3 1 4 4 4 5 5 4 4 6 5
[75] 3 4 4 5 3 3 1 3 3 4 1 5 2 3 2 3 4 5 4 6 4 2 2 4 6 6 6 2 3 3 2 1 5 4 6 5 4
[112] 2 5 1 2 6 2 6 5 1 2 5 5 3 5 3 2 1 4 6 1 4 1 3 4 1 5 2 5 3 1 6 3 6 3 3 2 6
[149] 1 6 3 3 6 4 3 6 1 1 6 2 1 5 2 6 1 6 1 6 6 5 3 5 1 2 2 4 4 5 4 4 3 5 3 1 2
[186] 2 3 2 2 2 5 6 4 4 2 4 5 5 3 4
and Q={q1,q2,...,q200} as
> Q
[1] "L" "F" "F" "F" "F" "F" "F" "F" "F" "F" "F" "F" "F" "F" "F" "F" "F" "F"
[19] "F" "F" "F" "F" "F" "F" "F" "F" "F" "F" "F" "F" "F" "F" "F" "F" "F" "F"
[37] "F" "F" "F" "F" "F" "F" "F" "F" "F" "F" "F" "F" "F" "F" "F" "F" "F" "F"
[55] "F" "F" "F" "F" "F" "F" "F" "F" "F" "F" "F" "F" "F" "F" "F" "F" "F" "F"
[73] "F" "F" "F" "F" "F" "F" "L" "L" "F" "F" "F" "F" "F" "F" "F" "F" "F" "F"
[91] "F" "F" "F" "F" "F" "F" "F" "F" "F" "F" "F" "F" "L" "L" "L" "L" "F" "F"
[109] "F" "F" "F" "F" "F" "F" "F" "F" "F" "F" "F" "F" "F" "F" "F" "F" "F" "F"
[127] "F" "F" "F" "F" "F" "F" "F" "F" "F" "F" "F" "F" "F" "L" "L" "L" "L" "L"
[145] "L" "L" "L" "L" "L" "L" "L" "L" "F" "F" "F" "F" "F" "F" "F" "F" "F" "F"
[163] "F" "F" "F" "F" "F" "F" "F" "F" "F" "F" "F" "F" "F" "F" "F" "F" "F" "F"
[181] "F" "F" "F" "F" "F" "F" "F" "F" "F" "F" "F" "F" "F" "F" "F" "F" "F" "F"
[199] "F" "F"
Pretend you don't know Q, use Forward-Backward algorithm to estimate (Q'), and compare Q'with Q, what's the accuracy?print Forward table and Backward table, What are P(qi=F|O) and P(qi=L|O) for each i=1,2,...200 ? what is P(O) ? find P(q47=F|o1,o2...,o47), P(q47=F|o47,o48..,o200) , P(q56=L|o45,o46,...o60), P(o201=3|O) (10pt)
f) using the same O and Q as in e), use Viterbi to figure out Q*, and compare with Q, what's the accuracy? print table A and table B in log scale, print matrix q (4 pt).
g) suppose P(qi+1=L|qi=F)=0.4 for i being even number, P(qi+1=L|qi=F)=0.01 for i being odd number. Everything else remains the same.
We have
> O
[1] 3 5 3 3 3 5 3 1 6 1 6 3 5 6 1 2 3 3 3 3 3 3 6 4 3 3 3 5 3 3 4 3 3 6 4 4 4 6 3 2 1 5 5 3 2 3 6 6
[49] 6 2 3 1 1 4 4 3 1 1 2 3 1 3 5 1 3 4 3 3 4 5 2 6 5 3 1 3 6 5 4 4 1 1 6 6 4 1 4 4 3 3 3 3 4 6 2 4
[97] 2 1 3 3 3 3 2 2 1 6 3 3 1 3 3 3 6 3 3 5 6 1 3 5 3 3 3 5 3 1 6 4 2 6 3 4 3 3 4 4 5 2 3 1 3 3 4 1
[145] 3 2 3 3 6 5 2 3 6 4 6 1 5 3 5 3 3 2 2 1 6 1 5 6 6 2 2 3 4 3 3 3 1 4 1 6 3 1 3 1 2 3 3 3 1 6 1 4
[193] 2 1 2 3 3 1 5 1
> Q
[1] "L" "L" "L" "L" "L" "L" "L" "L" "L" "F" "F" "F" "F" "F" "F" "L" "L" "L" "L" "L" "L" "L" "F" "L" "L" "L" "F" "F" "L" "L" "F" "F" "L"
[34] "F" "F" "F" "L" "L" "L" "L" "L" "L" "L" "L" "F" "L" "F" "F" "F" "F" "F" "L" "L" "F" "F" "F" "F" "L" "F" "F" "F" "L" "L" "L" "L" "L"
[67] "L" "L" "L" "F" "F" "F" "F" "L" "F" "F" "F" "F" "L" "L" "L" "L" "L" "F" "L" "F" "L" "F" "L" "L" "L" "L" "L" "F" "F" "F" "F" "L" "L"
[100] "L" "L" "L" "L" "F" "F" "F" "L" "L" "L" "L" "L" "L" "F" "F" "F" "F" "F" "L" "L" "L" "F" "F" "L" "F" "F" "F" "L" "F" "F" "F" "F" "L"
[133] "F" "F" "F" "F" "L" "F" "L" "L" "L" "L" "L" "L" "L" "L" "L" "L" "L" "L" "L" "L" "L" "F" "F" "L" "L" "L" "F" "L" "L" "F" "L" "L" "L"
[166] "F" "F" "F" "F" "F" "L" "L" "L" "L" "L" "L" "F" "F" "F" "F" "L" "L" "L" "L" "L" "L" "L" "L" "L" "L" "F" "F" "F" "F" "F" "L" "L" "F"
[199] "F" "L"
>
Pretend you don't know Q, use Forward-Backward algorithm to estimate (Q'), print Forward table, Backward table, and compare Q'with Q, what's the accuracy? What are P(qi=F|O) and P(qi=L|O) for each i=1,2,...200 ? what is P(O) ? (5 bonus pt)