Code covered by the BSD License  

Highlights from
Generation of Random Variates

image thumbnail

Generation of Random Variates

by

 

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

%if(isempty(coef))
    coef = gammaln(c+1) - b*log(c);
%end

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

return


Contact us