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

modpois1_cdf(n,lambda,k)
% modpois1_cdf.m - compute a First Modified Poisson Cumulative Distribution Function.
%   See "Univariate Discrete Distributions", Johnson, Kemp, and Kotz,
%   J. Wiley, p.492, 2005.                 
%
%  Created by:  Jim Huntley,  01/11/07.
%

function [cdf] = modpois1_cdf(n,lambda,k)

logl = log(lambda);

sum1 = 0;
for jn = 1:n+1
    sum1 = sum1 + (1-k*n)^(jn-1) * exp((jn-1)*logl + lambda*(k*n-1) - gammaln(jn));
end

cdf =  sum1;

return



Contact us