Hey all,

I am having some issues with NaNs in my HMM implementation and wonder if anybody has come across this or even better knows a solution. I pretty much follow Stamp's tutorial to the letter but sometimes I get a situation where during the last iteration of the alpha pass, either all alphas or values of B for this step are zero, resulting in a zero sum of all alphas, which in turn results in an infinite scaling factor.

Now in the alpha pass I don't really notice this since 0 * infinity = 0.

This problem only shows up further down the line where I use the scaling factor in the beta pass, multiplying with it and getting an all-NaN beta array.

I found this post from 2004 with someone having the very same problem while using the stamp pseudocode. This suggests to me that ...

- The pseudocode still has a problem/bug regarding numerical stability OR
- This is to be expected OR
- I made the same mistake as other people ( I know of at least two).

Using this implementation I am still able to get a 200points score though since it doesn't happen every time.

Does anybody have pointers to where the problem might lie?