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

survivor_pdf(n, a, b, nn)
% survivor_pdf.m - evaluates a Survivors Probability Density.
%   See "Univariate Discrete Distributions", Johnson, Kemp, and Kotz,
%   J. Wiley, p.446, 2005. 
%
%  Created by Jim Huntley,  10/09/07
%

function [pdf] = survivor_pdf(n, a, b, nn)

sumr = 0;
for r = n:nn
    sumr = sumr + (-1)^(r-n) * exp(log(binomial_coef(nn-n,r-n)) - a*log((1+b*r)^a));
end
pdf = binomial_coef(nn,n) * max(sumr,0);

return


Contact us