Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

hmmLogprob greater than zero #7

Closed
GoogleCodeExporter opened this issue Apr 23, 2016 · 3 comments
Closed

hmmLogprob greater than zero #7

GoogleCodeExporter opened this issue Apr 23, 2016 · 3 comments

Comments

@GoogleCodeExporter
Copy link

What steps will reproduce the problem?
1. Fully  defined a HMM (hmmCreate)
2. Sampled training and test data  (hmmSample)
3. Trained a HMM (hmmFit)
4. Tested HMM (hmmLogprob)
-> Got a log likelihood greater than zero.

Things that look weird:

The state-transition matrix A of the trained model is not normalized: 
normalize(model.A)-model.A should be zero(..).

Could also be a numerical over-/underflow issue: I am using relative long 
sequencces.

Or my sampling HMM could be crap:

%d=1
nstates = 7;
pi = [1 0 0 0 0 0 0];
A = normalize(diag(ones(nstates, 1)) + ...
            diag(ones(nstates-1, 1), 1), 2);
sigma = [[0.05],[0.05],[0.05],[0.05],[0.05],[0.05],[0.05]];
mu = [0.7, 1.4, 2.1, 2.8, 3.5, 4.2, 4.9];
emission = condGaussCpdCreate(mu, sigma);

modelValid = hmmCreate('gauss', pi, A, emission);

What is the expected output? What do you see instead?
The log of a probality can't be greater than zero.

What version / revision of the product are you using? On what operating
system?
MATLAB 2009a


Please provide any additional information below.

Original issue reported on code.google.com by business...@gmail.com on 15 Nov 2010 at 9:46

Attachments:

@GoogleCodeExporter
Copy link
Author

State-transion matrix of the trained model is normalized. Re-checked my 
results, but the logprob is positive in one case.

Original comment by business...@gmail.com on 3 Dec 2010 at 9:22

@GoogleCodeExporter
Copy link
Author

Probability density functions (eg Gaussian) can be > 1
(eg normpdf(0, 0,   0.9/sqrt(2*pi))
Try MAP estimation to regularize things. See discussion on pmtk list Feb 2011.

Original comment by murphyk2 on 28 Feb 2011 at 7:44

@GoogleCodeExporter
Copy link
Author

Original comment by murphyk2 on 16 May 2013 at 4:17

  • Changed state: Invalid

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant