Generation of Random Variates
09 Feb 2012
generates random variates from over 870 univariate distributions
|polyaurn_pdf(n, nn, w, b, c)
% polyaurn_pdf.m - evaluates a Polya Urn Probability Density.
% See "Univariate Discrete Distributions", Johnson, Kemp, and Kotz,
% J. Wiley, 2005, p.258.
% Created by Jim Huntley, 9/18/07
function [pdf] = polyaurn_pdf(n, nn, w, b, c)
%persistent coef wdc bdc
wdc = w / c;
bdc = b / c;
coef = 1 / beta(wdc,bdc);
pdf = coef * binomial_coef(nn,n) * beta(n+wdc,nn-n+bdc);