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

invpois_pdf(n,rho,theta)
%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

%if(isempty(coef))
    coef = (-rho*theta) - log(exp(theta)-1);
    logth = log(theta);
%end

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

return
    
    
    
    



Contact us