Code covered by the BSD License  

Highlights from
Generation of Random Variates

image thumbnail

Generation of Random Variates

by

James Huntley (view profile)

 

generates random variates from over 870 univariate distributions

eggpolurn_pdf(n, N, m, s, u)
% eggpolurn_pdf.m - evaluates an Eggenberger Polya Urn Probability Density.
%     "q-Probability: I. Basic Discrete Distributions", 
%     B. Kupershmidt, J. Nonlinear Math., vol. 7, No. 1 p.73, 2000.
%
%  Created by Jim Huntley,  02/28/07
%

function [pdf] = eggpolurn_pdf(n, N, m, s, u)

proda = 1;
prodb = 1;
prodc = 1;
for ja = 1:n
    proda = proda * (m + (ja-1)*s);
end
for jb = 1:N-n
    prodb = prodb * (u + (jb-1)*s);
end
for jc = 1:N
    prodc = prodc * (m + u + (jc-1)*s);
end
pdf = binomial_coef(N,n) * proda * prodb / prodc;

return


Contact us