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

dirichlet sample #39

Open
GoogleCodeExporter opened this issue Jun 8, 2015 · 0 comments
Open

dirichlet sample #39

GoogleCodeExporter opened this issue Jun 8, 2015 · 0 comments

Comments

@GoogleCodeExporter
Copy link

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 [email protected] on 11 Jan 2015 at 1:09

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