Code covered by the BSD License  

Highlights from
Generation of Random Variates

image thumbnail

Generation of Random Variates


James Huntley (view profile)


generates random variates from over 870 univariate distributions

%invpois_pdf.m - evaluates an Intervened Poisson Probability Density Distribution.
%   "Univariate Discrete Distributions", Johnson, Kemp, and Kotz,
%   Wiley, 2005, p. 206.

function [pdf] = invpois_pdf(n,rho,theta)

%persistent coef logth

    coef = (-rho*theta) - log(exp(theta)-1);
    logth = log(theta);

pdf = exp(coef + log((1+rho)^n-rho^n+eps) + n*logth - gammaln(n+1));


Contact us