![](bg3.png)
4 EMPIRICAL RESULTS
This section focuses on building simulation scenar-
ios and representing the empirical results. Our overall
simulation follows the next outline and more specific
details can be found in Section 4.1.
i We firstly generate an HMM, keeping a uniform
transition matrix
ii For that HMM, we generate the hidden sequence
of states and the observation sequence of emis-
sions.
iii We apply the Viterbi algorithm on the emissions
and retrieve the predicted set of states.
iv We compare the explanation retrieved from
Viterbi against the actual set of states generated
in step (ii) to calculate its accuracy.
v The experiment is repeated several times to pro-
duce the mean of accuracy.
The results of 3 × 3 matrix, 4 × 4 matrix are pre-
sented separately in section 4.2 and we analyzed the
possible contributors to the accuracy of the Viterbi al-
gorithm as well.
4.1 Simulation Scenarios
In this section, we illustrate the simulation scenarios
in more detail.
4.1.1 The State Sequence
We generated a state sequence as a reference. These
states are recorded to track the accuracy later on. The
initial state is set randomly, and the state sequence is
generated randomly based on the probability of the
transition.
4.1.2 Initial Probability
The initial probability is specified as
1
n
; it is equally
likely to be chosen as the initial state.
4.1.3 Transition Probability
As discussed in the scope of this paper, the transition
probability is set to equal between all states. That is,
from any state, it is equally likely to transition to any
of the other states (including itself).
4.1.4 Emission Probability
As the main study area of this paper, we consider dif-
ferent scenarios on emission probability and divide
them into three categories.
1. Emission probability for every emission is the
same from every state, as the Scenarios 3(10) in
Table 5.
2. Emission probability uniquely defines a state;
they’re either a 0 or a 1. In other words, each
emission comes from only a single state. The ma-
trix, in this case, looks like a permutation of the
identity matrix, as the Scenarios 3(1) in Table 5.
3. Emission probabilities are random; they are nei-
ther the same nor uniquely defined.
4.2 Numerical Results
In this section, we outline the results of the 1000 ex-
periments within 15-length of the state sequence on
the scenario described in section 4.1. We tested two
different data sets for this, 3×3 and 4×4 respectively,
and the results are included in Table 1 and Table 2.
For the data matrix of 3 × 3, We set all transition
probability to be
1
3
first. Then, we need to obtain three
cosine similarity, respectively. As shown in Table 1,
cos1 is the cosine similarity of E1 and E2, cos2 is the
cosine similarity of E2 and E3, and cos 3 is the cosine
similarity of E1 and E3. Meanwhile, we also compare
the prediction accuracy (PA) proposed by formula 1
with the Viterbi algorithm’s accuracy (AA), and the
difference between the two variables, is called an Er-
ror.
For the data matrix of 4 × 4, we have to change
the transition probability to
1
4
, and another difference
with 3 × 3 is that the 4 × 4 data matrix requires six
cosine similarities. cos1 is the Cosine similarity be-
tween E1 and E2, cos 2 is the Cosine similarity be-
tween E1 and E3, cos 3 is the Cosine similarity be-
tween E1 and E4, cos 4 is the Cosine similarity be-
tween E2 and E3, cos 5 is the Cosine similarity be-
tween E2 and E4, and cos 6 is the Cosine similarity
between E3 and E4.
4.3 Discussion
In the experiments, we attempted to establish a dif-
ferent matrix of transition probability under the cir-
cumstance of using the same emission probability;
we found that different entries of transition probabil-
ity will have an impact on the accuracy of the Viterbi
algorithm. Therefore, to keep the consistency of ex-
perimental results, we divided every variable in the
transition matrix Table 3 and Table 4 into equal parts
to reduce the effect of the transition probability on the
result.
In Table 1, the emission probability has size 3× 3;
we calculate the cosine similarity for the three pairs
Pairwise Cosine Similarity of Emission Probability Matrix as an Indicator of Prediction Accuracy of the Viterbi Algorithm
943