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

invpol_pdf(n,nn,s,b,w)
% invpol_pdf.m - evaluates an Inverse Polya Probability Density.
%   See "Lagramgian Probability Distributions", P.C. Consul & F. Famoye,   
%   Birkauser, 2006, p.95. 
%
%  Created by Jim Huntley,  06/07/11
%

function [pdf] = invpol_pdf(n,nn,s,b,w)

coef = log(nn) + gammaln((b+w)/s) - (gammaln(b/s)+gammaln(w/s));
argn = nn + n;
lbcnndx = log(binomial_coef(argn,n));
pdf = exp(coef + lbcnndx + gammaln(b/s+n) + gammaln(w/s+nn) - ...
      log(argn) - gammaln((b+w)/s + argn));

return

Contact us