UTF8gbsn
After we known the HMM
λ
=
(
A
,
B
,
π
)
\lambda=(A,B,\pi)
λ=(A,B,π) and
O
=
(
o
1
,
o
2
,
⋯
,
o
T
)
O=\left( o_1, o_2, \cdots, o_T \right)
O=(o1,o2,⋯,oT), the probability
P
(
O
∣
λ
)
P(O|\lambda)
P(O∣λ)
can be computed directly. We illustrate possible state sequences of
I
=
(
i
1
,
i
2
,
⋯
,
i
T
)
I=\left( i_1, i_2, \cdots, i_T \right)
I=(i1,i2,⋯,iT) and compute
P
(
O
∣
λ
)
P(O|\lambda)
P(O∣λ) by
the sum of all joint probabilities
P
(
O
,
I
∣
λ
)
P(O,I|\lambda)
P(O,I∣λ).
For a given state sequence
I
=
(
i
1
,
i
2
,
⋯
,
i
T
)
I=\left( i_1, i_2, \cdots, i_T \right)
I=(i1,i2,⋯,iT), the
probability of this sequence is:
P
(
I
∣
λ
)
=
π
i
1
a
i
1
i
2
a
i
2
i
3
⋯
a
i
T
−
1
i
T
P(I|\lambda)=\pi_{i_1}a_{i_1 i_2}a_{i_2 i_3}\cdots a_{i_{T-1}i_T}
P(I∣λ)=πi1ai1i2ai2i3⋯aiT−1iT
Fixed
I
=
(
i
1
,
i
2
,
⋯
,
i
T
)
I=\left( i_1, i_2, \cdots, i_T \right)
I=(i1,i2,⋯,iT) and
O
=
(
o
1
,
o
2
,
⋯
,
o
T
)
O=\left( o_1, o_2, \cdots, o_T \right)
O=(o1,o2,⋯,oT) have fixed conditional
probability
P
(
O
∣
I
,
λ
)
P(O|I, \lambda)
P(O∣I,λ):
P
(
O
∣
I
,
λ
)
=
b
i
1
(
o
1
)
b
i
2
(
o
2
)
⋯
b
i
T
(
o
T
)
P(O|I,\lambda)=b_{i_1}(o_1)b_{i_2}(o_2)\cdots b_{i_T}(o_T)
P(O∣I,λ)=bi1(o1)bi2(o2)⋯biT(oT)
P ( O , I ∣ λ ) = P ( O ∣ I , λ ) P ( I ∣ λ ) = π i 1 b i 1 ( o 1 ) a i 1 i 2 b i 1 ( o 2 ) ⋯ a i T − 1 i T b i T ( o T ) \left. \begin{aligned} P(O,I|\lambda)&=P(O|I,\lambda)P(I|\lambda)\\ &=\pi_{i_1}b_{i_1}(o_1)a_{i_1i_2}b_{i_1}(o_2)\cdots a_{i_{T-1}i_T}b_{i_T}(o_T) \end{aligned} \right. P(O,I∣λ)=P(O∣I,λ)P(I∣λ)=πi1bi1(o1)ai1i2bi1(o2)⋯aiT−1iTbiT(oT)
Now, we can sum all the P ( O , I ∣ λ ) P(O,I|\lambda) P(O,I∣λ) together: P ( O ∣ λ ) = ∑ I P ( O ∣ I , λ ) P ( I ∣ λ ) = ∑ i 1 , i 2 , ⋯ , i T π i 1 b i 1 ( o 1 ) a i 1 i 2 b i 2 ( o 2 ) ⋯ a i T − 1 i T b i T ( o T ) \left. \begin{aligned} P(O|\lambda)&=\sum_{I}P(O|I,\lambda)P(I|\lambda)\\ &=\sum_{i_1,i_2,\cdots, i_T}\pi_{i_1}b_{i_1}(o_1)a_{i_1i_2}b_{i_2}(o_2)\cdots a_{i_{T-1}i_T}b_{i_T}(o_T) \end{aligned} \right. P(O∣λ)=I∑P(O∣I,λ)P(I∣λ)=i1,i2,⋯,iT∑πi1bi1(o1)ai1i2bi2(o2)⋯aiT−1iTbiT(oT)
The complexity of this direct method is
O
(
N
T
T
)
O(N^TT)
O(NTT) , and it’s a costly
algorithm of computing
P
(
O
∣
λ
)
P(O|\lambda)
P(O∣λ)