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

genneyman_cdf(n, alpha, bet, phi, lambda, nn)
% genneyman_cdf.m - compute Generalized Neyman A Cumulative Distribution Function.
%   See "Univariate Discrete Distributions", Johnson, Kemp, and Kotz,
%   J. Wiley, p.417, 2005.                 
%
%  Created by:  Jim Huntley,  07/24/07.
%

function [cdf] = genneyman_cdf(n, alpha, bet, phi, lambda, nn)


sum1 = genneyman_pdf(0, alpha, bet, phi, lambda, nn);
if(n < 1)
    cdf = sum1;
end
sum2 = genneyman_pdf(1, alpha, bet, phi, lambda, nn);
if(n >= 1 & n < 2)
    cdf = sum1 + sum2;
end
sum3 = sum1 + sum2;
if(n >= 2)
    for jn = 2:n
        sum3 = sum3 + genneyman_pdf(jn, alpha, bet, phi, lambda, nn);
    end
    cdf = sum3;
end

return



Contact us