Prev: Need help in define integer programing in GA
Next: looking for help (I think its a basic MATLAB question)
From: Sumeet on 6 Jul 2010 22:49 Hello, I am attempting to train a hidden Markov model based on a reference data sequence I have obtained. The data sequence contains binary data only and is contained in the vector e in the code below. When I call hmmtrain to train the model it quickly converges one of my state transition probabilities such that it is unable to transition from the state once it is entered. The data generated by the resulting model contains a sequence of ones because it gets stuck in a single state. Is there something wrong with the way I'm training the model? My code is below: seq = num2cell(e) TRGUESS = [0.95, 0.05; 0.8, 0.2]; EMITGUESS = [1, 0; 0, 1]; SYMBOLS = [ 0, 1]; [ESTTR,ESTEMIT] = hmmtrain(seq,TRGUESS,EMITGUESS, 'Symbols', SYMBOLS, 'Verbose', true) [gen_seq, states] = hmmgenerate(length(e),ESTTR, ESTEMIT, 'symbols', SYMBOLS); This results in: Relative Changes in Log Likelihood, Transition Matrix and Emission MatrixIteration 2 relative changes: Log Likelihood: 0.340247 Transition Matrix: 0.000000 Emission Matrix: 0.000000Iteration 3 relative changes: Log Likelihood: 0.000000 Transition Matrix: 0.000000 Emission Matrix: 0.000000Algorithm converged after 3 iterations. ESTTR = 0.7050 0.2950 0 1.0000 ESTEMIT = 1 0 0 1 The vector e used for training contains data similar to this: e = 1 0 0 1 1 1 1 0 0 1 0 0 0 0 0 0 0 0 0 1 0 1 Any help would be appreciated, Thanks. |