Tomm994 / bnt

Automatically exported from code.google.com/p/bnt
0 stars 0 forks source link

dirichlet sample #39

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?

I looked at dirichlet_sample script file under FullBNT-1.0.7\bnt\KPMstats, and 
written like No.2. I wonder both code No.2 is wrong, and it should be changed 
like codes in No.1. Or both of the case are correct?  

Could you please clarify on this. 

No.1)

alpha = [1/3 1/3 1/3];  % gamma distribution shape parameter (vector)
    scale = [1 1 1];        % gamma distribution scale parameter 

    CPT = zeros(N, k);      % conditional prob. table: 4 x 3  -> P(F(3) | H(2),I(2))   

    for j=1:N
      CPT(j,:) = gamrnd(alpha, scale, 1, k);    % generate N x 1 Gamma random numbers with shape(=alpha)/scale parameters  
    end

No.2)

alpha = [1/3 1/3 1/3];  % gamma distribution shape parameter (vector)
    scale = [1 1 1];        % gamma distribution scale parameter 

    CPT = zeros(N, k);      % conditional prob. table: 4 x 3  -> P(F(3) | H(2),I(2))   

    for j=1:k
      CPT(:,j) = gamrnd(alpha(j), scale(j), N, 1);    % generate N x 1 Gamma random numbers with shape(=alpha)/scale parameters  
    end

What is the expected output? What do you see instead?

it seems that both of the output on the code above look correct. 

What version of the product are you using? On what operating system?

FullBNT-1.0.7, Matlab2014b, Windows

Please provide any additional information below.

Original issue reported on code.google.com by Hwayoung...@gmail.com on 11 Jan 2015 at 1:09