Mercurial > hg > camir-ismir2012
comparison toolboxes/FullBNT-1.0.7/HMM/dhmm_logprob_brute_force.m @ 0:cc4b1211e677 tip
initial commit to HG from
Changeset:
646 (e263d8a21543) added further path and more save "camirversion.m"
author | Daniel Wolff |
---|---|
date | Fri, 19 Aug 2016 13:07:06 +0200 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
-1:000000000000 | 0:cc4b1211e677 |
---|---|
1 function logp = enumerate_HMM_loglik(prior, transmat, obsmat) | |
2 % ENUMERATE_HMM_LOGLIK Compute the log likelihood of a sequence by exhaustive (O(Q^T)) enumeration. | |
3 % logp = enumerate_HMM_loglik(prior, transmat, obsmat) | |
4 % | |
5 % Inputs: | |
6 % prior(i) = Pr(Q(1) = i) | |
7 % transmat(i,j) = Pr(Q(t+1)=j | Q(t)=i) | |
8 % obsmat(i,t) = Pr(y(t) | Q(t)=i) | |
9 | |
10 Q = length(prior); | |
11 T = size(obsmat, 2); | |
12 sizes = repmat(Q, 1, T); | |
13 | |
14 psum = 0; | |
15 for i=1:Q^T | |
16 qs = ind2subv(sizes, i); % make the state sequence | |
17 psum = psum + prob_path(prior, transmat, obsmat, qs); | |
18 end | |
19 logp = log(psum) | |
20 | |
21 |