Code covered by the BSD License  

Highlights from
Generation of Random Variates

image thumbnail

Generation of Random Variates



generates random variates from over 870 univariate distributions

occupy_pdf(n, c, b)
% occupy_pdf.m - evaluates an Occupancy Probability Density.
%   See "Univariate Discrete Distributions", Johnson, Kemp, and Kotz,
%   J. Wiley, p.439, 2005. 
%  Created by Jim Huntley,  8/03/07

function [pdf] = occupy_pdf(n, c, b)

%persistent coef

    coef = gammaln(c+1) - b*log(c);

pdf = exp(coef + log(stirling2(b,c-n)+eps) - gammaln(n+1));


Contact us