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

% nsuccess_cdf.m - compute Number of Success Runs of Length K (or longer) 
%                   Cumulative Distribution Function.
%   See "Univariate Discrete Distributions", Johnson, Kemp, and Kotz,
%   J. Wiley, p.255, 2005.                 
%  Created by:  Jim Huntley,  8/03/07.

function [cdf] = nsuccess_cdf(n,p,k,nn)

sum1 = nsuccess_pdf(0, p, k, nn);
for jn = 1:n
    sum1 = sum1 + nsuccess_pdf(jn, p, k, nn);
cdf = sum1;


Contact us