Code covered by the BSD License  

Highlights from
Generation of Random Variates

image thumbnail

Generation of Random Variates

by

James Huntley (view profile)

 

generates random variates from over 870 univariate distributions

genpoiss_pdf(n, theta, lambda)
% genpoiss_pdf.m - evaluates a Generalized Poisson Probability Density.
%   See "A Branching Process Approximation ...", I. Dobson et al, Proc. 37th Hawaii Intl Conf Sys Sci, 2004.
%
%  Created by Jim Huntley,  8/26/04
%

function [pdf] = genpoiss_pdf(n, theta, lambda)

pdf = 0;
if(n >= 0)
    pdf = theta * (n*lambda+theta)^(n-1) * exp(-n*lambda-theta);
    pdf = exp(log(pdf) - gammaln(n+1));
end

return

Contact us