# HMM (Hidden Markov Matrix) Evaluation

#### jiapei100

Hi, all:

There are 3 methods to carry out HMM evaluation.
1) forward algorithm
2) backward algorithm
3) forward-backward algorithm

Sometimes, forward algorithm and backward algorithm may not give out the same result.
Can anybody (mathematician) help to explain it clearly?

I designed my data as: 2 hidden states, 3 observations, and the sequence if of length 4

1) initial state probability of state 1 and 2: 0.6, 0.4 sequentially

2) transition probability :
from state 1 to state 1: 0.7
from state 1 to state 2: 0.3
from state 2 to state 1: 0.4
from state 2 to state 2: 0.6

3) observation probability:
from state 1 to observation 1: 0.1
from state 1 to observation 2: 0.4
from state 1 to observation 3: 0.5
from state 2 to observation 1: 0.6
from state 2 to observation 2: 0.3
from state 2 to observation 3: 0.1

4) the observation sequence is known as: 0->1->2->
that is
observation 1 to observation 2 to observation 3 to observation 1

According to my implementation, forward algorithm got the probability as: 0.0090887999999999993
while backward algorithm got the probability as: 0.0090888000000000010

I'm wondering if this is the precision problem during the computation?
Or there are some other problems hidden in my wrong coding???
(Sorry that I didn't afford my coding at this moment,
I'm guessing Julius has its own HMM to have the above simple example computed)

The difference between two probabilities using my HMM looks like a precision issue,

Can anybody give a hand to confirm this?

Cheers
JIA

Related General Math Workshop News on Phys.org

#### Mark44

Mentor

"HMM (Hidden Markov Matrix) Evaluation"

### Physics Forums Values

We Value Quality
• Topics based on mainstream science
• Proper English grammar and spelling
We Value Civility
• Positive and compassionate attitudes
• Patience while debating
We Value Productivity
• Disciplined to remain on-topic
• Recognition of own weaknesses
• Solo and co-op problem solving