Thursday, February 02, 2017

Symmetric Dirichlet in d dimensions

function res=dirchrnd(alpha,d)
res = zeros(d,1);
for i=1:d
res(i)=gamrnd(alpha,1);
end
res=res/sum(res);
end

No comments:

Turkce-Ingilizce Tekerleme

I scream, you scream we all scream for ice scream I run, you run we all run for ayran