Re: [sage-support] possible bug in DiscreteHiddenMarkovModel - NaN produced in output matrices

2014-05-09 Thread Jesse Hersch
On Thursday, May 8, 2014 5:59:10 PM UTC-7, William wrote: Do you recall if you handled the underflow problem in your implementation? I believe it does not. I haven't studied the code yet, but it seems like this could be the culprit. I think you're right. You should implement it!

[sage-support] possible bug in DiscreteHiddenMarkovModel - NaN produced in output matrices

2014-05-08 Thread Jesse Hersch
Hi there, I think I may have found a bug in the class hmm.DiscreteHiddenMarkovModel. The repro is below. It probably has something to do with one emission value being much more common than the others, but that shouldn't be invalid from my understanding of HMMs. I am running Sage Version

Re: [sage-support] possible bug in DiscreteHiddenMarkovModel - NaN produced in output matrices

2014-05-08 Thread Jesse Hersch
On Thursday, May 8, 2014 4:14:32 PM UTC-7, William wrote: I could be wrong, but I don't think the implementation of Baum-Welch is wrong. The BM algorithm [1] using double precision numbers (which is all the HMM algorithm in Sage uses) can lead to overflow, given the sort of computations