Code covered by the BSD License  

Highlights from
Generation of Random Variates

image thumbnail

Generation of Random Variates


James Huntley


generates random variates from over 870 univariate distributions

poisgam_int_pdf(n, b, t, p)
% poisgam_int_pdf.m - evaluates a discrete Poisson Gamma Probability Density.
%   See "Laplace Transforms, Mellin Transforms and Mixed Poisson Processes", 
%   P. Albrecht, Scand. Actuarial J., vol.1, p.58, 1984.
%  Created by Jim Huntley,  09/21/09

function [pdf] = poisgam_int_pdf(n, b, t, p)

%persistent coef

    coef = p*log(b) - gammaln(p);

pdf = exp(coef + n*log(t) + gammaln(n+p) - ((n+p)*log(b+t) + gammaln(n+1)));


Contact us