Mercurial > hg > camir-aes2014
comparison toolboxes/FullBNT-1.0.7/KPMstats/multinomial_prob.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 B = eval_pdf_cond_multinomial(data, obsmat) | |
2 % EVAL_PDF_COND_MULTINOMIAL Evaluate pdf of conditional multinomial | |
3 % function B = eval_pdf_cond_multinomial(data, obsmat) | |
4 % | |
5 % Notation: Y = observation (O values), Q = conditioning variable (K values) | |
6 % | |
7 % Inputs: | |
8 % data(t) = t'th observation - must be an integer in {1,2,...,K}: cannot be 0! | |
9 % obsmat(i,o) = Pr(Y(t)=o | Q(t)=i) | |
10 % | |
11 % Output: | |
12 % B(i,t) = Pr(y(t) | Q(t)=i) | |
13 | |
14 [Q O] = size(obsmat); | |
15 T = prod(size(data)); % length(data); | |
16 B = zeros(Q,T); | |
17 | |
18 for t=1:T | |
19 B(:,t) = obsmat(:, data(t)); | |
20 end |