Mercurial > hg > camir-aes2014
comparison toolboxes/FullBNT-1.0.7/bnt/inference/dynamic/@hmm_inf_engine/private/mk_hmm_obs_lik_matrix.m @ 0:e9a9cd732c1e tip
first hg version after svn
author | wolffd |
---|---|
date | Tue, 10 Feb 2015 15:05:51 +0000 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
-1:000000000000 | 0:e9a9cd732c1e |
---|---|
1 function obslik = mk_hmm_obs_lik_matrix(engine, evidence) | |
2 | |
3 T = size(evidence,2); | |
4 Q = length(engine.startprob); | |
5 obslik = ones(Q, T); | |
6 bnet = bnet_from_engine(engine); | |
7 % P(o1,o2| Q1,Q2) = P(o1|Q1,Q2) * P(o2|Q1,Q2) | |
8 onodes = bnet.observed; | |
9 for i=1:length(onodes) | |
10 data = cell2num(evidence(onodes(i),:)); | |
11 if bnet.auto_regressive(onodes(i)) | |
12 params = engine.obsprob{i}; | |
13 mu = params.big_mu; | |
14 Sigma = params.big_Sigma, | |
15 W = params.big_W; | |
16 mu0 = params.big_mu0; | |
17 Sigma0 = params.big_Sigma0; | |
18 %obslik_i = mk_arhmm_obs_lik(data, mu, Sigma, W, mu0, Sigma0 | |
19 obslik_i = clg_prob(data(:,1:T-1), data(:,2:T), mu, Sigma, W); | |
20 obslik_i = [mixgauss_prob(data(:,1), mu0, Sigma0) obslik_i]; | |
21 elseif myismember(onodes(i), bnet.dnodes) | |
22 %obslik_i = eval_pdf_cond_multinomial(data, engine.obsprob{i}.big_CPT); | |
23 obslik_i = multinomial_prob(data, engine.obsprob{i}.big_CPT); | |
24 else | |
25 %obslik_i = eval_pdf_cond_gauss(data, engine.obsprob{i}.big_mu, engine.obsprob{i}.big_Sigma); | |
26 obslik_i = mixgauss_prob(data, engine.obsprob{i}.big_mu, engine.obsprob{i}.big_Sigma); | |
27 end | |
28 obslik = obslik .* obslik_i; | |
29 end | |
30 |