Generation of Random Variates
09 Feb 2012
generates random variates from over 870 univariate distributions
|genurn_pdf(n, nn, w, b, c)
% genurn_pdf.m - evaluates a General URN Probability Density.
% See "Univariate Discrete Distributions", Johnson, Kemp, and Kotz,
% J. Wiley, p.251, 2005.
% Created by Jim Huntley, 02/16/07
function [pdf] = genurn_pdf(n, nn, w, b, c)
arg1 = -(w + b) / c;
arg2 = -w / c;
nn = fix(-w/c)+1;
pdf = binomial_coef(nn,n) * binomial_coef(-nn+arg1,-n+arg2) / ...